mirror of
https://github.com/Yuvi9587/Kemono-Downloader.git
synced 2025-12-29 16:14:44 +00:00
Compare commits
5 Commits
5d8737b59e
...
v6.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9db89cfad0 | ||
|
|
0a6034a632 | ||
|
|
2da69e7017 | ||
|
|
3209770d00 | ||
|
|
337cdd342c |
24
LICENSE
24
LICENSE
@@ -1,11 +1,21 @@
|
||||
Custom License - No Commercial Use
|
||||
MIT License
|
||||
|
||||
Copyright [Yuvi9587] [2025]
|
||||
Copyright (c) [2025] [Yuvi9587]
|
||||
|
||||
Permission is hereby granted to any person obtaining a copy of this software and associated documentation files (the "Software"), to use, copy, modify, and distribute the Software for **non-commercial purposes only**, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
2. Proper credit must be given to the original author in any public use, distribution, or derivative works.
|
||||
3. Commercial use, resale, or sublicensing of the Software or any derivative works is strictly prohibited without explicit written permission.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND...
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
339
features.md
339
features.md
@@ -1,192 +1,147 @@
|
||||
# Kemono Downloader - Feature Guide
|
||||
This guide provides a comprehensive overview of all user interface elements, input fields, buttons, popups, and functionalities available in the Kemono Downloader.
|
||||
|
||||
## 1. Main Interface & Workflow
|
||||
These are the primary controls you'll interact with to initiate and manage downloads.
|
||||
|
||||
### 1.1. Core Inputs
|
||||
**🔗 Creator/Post URL Input Field**
|
||||
- **Purpose**: Paste the URL of the content you want to download.
|
||||
- **Supported Sites**: Kemono.su, Coomer.party, Simpcity.su.
|
||||
- **Supported URL Types**:
|
||||
- Creator pages (e.g., `https://kemono.su/patreon/user/12345`).
|
||||
- Individual posts (e.g., `https://kemono.su/patreon/user/12345/post/98765`).
|
||||
- **Note**: When ⭐ Favorite Mode is active, this field is disabled. For Simpcity.su URLs, the "Use Cookie" option is mandatory and auto-enabled.
|
||||
|
||||
**🎨 Creator Selection Button**
|
||||
- **Icon**: 🎨 (Artist Palette)
|
||||
- **Purpose**: Opens the "Creator Selection" dialog to browse and queue downloads from known creators.
|
||||
- **Dialog Features**:
|
||||
- Loads creators from `creators.json`.
|
||||
- **Search Bar**: Filter creators by name.
|
||||
- **Creator List**: Displays creators with their service (e.g., Patreon, Fanbox).
|
||||
- **Selection**: Checkboxes to select one or more creators.
|
||||
- **Download Scope**: Organize downloads by Characters or Creators.
|
||||
- **Add to Queue**: Adds selected creators or their posts to the download queue.
|
||||
|
||||
**Page Range (Start to End) Input Fields**
|
||||
- **Purpose**: Specify a range of pages to fetch for creator URLs.
|
||||
- **Usage**: Enter the starting and ending page numbers.
|
||||
- **Behavior**:
|
||||
- If blank, all pages are processed.
|
||||
- Disabled for single post URLs.
|
||||
|
||||
**📁 Download Location Input Field & Browse Button**
|
||||
- **Purpose**: Specify the main directory for downloaded files.
|
||||
- **Usage**: Type the path or click "Browse..." to select a folder.
|
||||
- **Requirement**: Mandatory for all download operations.
|
||||
|
||||
### 1.2. Action Buttons
|
||||
**⬇️ Start Download / 🔗 Extract Links Button**
|
||||
- **Purpose**: Initiates downloading or link extraction.
|
||||
- **Behavior**:
|
||||
- Shows "🔗 Extract Links" if "Only Links" is selected.
|
||||
- Otherwise, shows "⬇️ Start Download".
|
||||
- Supports single-threaded or multi-threaded downloads based on settings.
|
||||
|
||||
**🔄 Restore Download Button**
|
||||
- **Visibility**: Appears if an incomplete session is detected on startup.
|
||||
- **Purpose**: Resumes a previously interrupted download session.
|
||||
|
||||
**⏸️ Pause / ▶️ Resume Download Button**
|
||||
- **Purpose**: Pause or resume the ongoing download.
|
||||
- **Behavior**: Toggles between "Pause" and "Resume". Some UI settings can be changed while paused.
|
||||
|
||||
**❌ Cancel & Reset UI Button**
|
||||
- **Purpose**: Stops the current operation and performs a "soft" reset.
|
||||
- **Behavior**: Halts background threads, preserves URL and Download Location inputs, resets other settings.
|
||||
|
||||
**🔄 Reset Button (in the log area)**
|
||||
- **Purpose**: Performs a "hard" reset when no operation is active.
|
||||
- **Behavior**: Clears all inputs, resets options to default, and clears logs.
|
||||
|
||||
## 2. Filtering & Content Selection
|
||||
These options allow precise control over downloaded content.
|
||||
|
||||
### 2.1. Content Filtering
|
||||
**🎯 Filter by Character(s) Input Field**
|
||||
- **Purpose**: Download content related to specific characters or series.
|
||||
- **Usage**: Enter comma-separated character names.
|
||||
- **Advanced Syntax**:
|
||||
- `Nami`: Simple filter.
|
||||
- `(Vivi, Ulti)`: Grouped filter. Matches posts with "Vivi" OR "Ulti". Creates a shared folder like `Vivi Ulti` if subfolders are enabled.
|
||||
- `(Boa, Hancock)~`: Aliased filter. Treats "Boa" and "Hancock" as the same entity.
|
||||
|
||||
**Filter: [Type] Button (Character Filter Scope)**
|
||||
- **Purpose**: Defines where the character filter is applied. Cycles on click.
|
||||
- **Options**:
|
||||
- **Filter: Title** (Default): Matches post titles.
|
||||
- **Filter: Files**: Matches filenames.
|
||||
- **Filter: Both**: Checks title first, then filenames.
|
||||
- **Filter: Comments (Beta)**: Checks filenames, then post comments.
|
||||
|
||||
**🚫 Skip with Words Input Field**
|
||||
- **Purpose**: Exclude posts/files with specified keywords (e.g., `WIP`, `sketch`).
|
||||
|
||||
**Scope: [Type] Button (Skip Words Scope)**
|
||||
- **Purpose**: Defines where skip words are applied. Cycles on click.
|
||||
- **Options**:
|
||||
- **Scope: Posts** (Default): Skips posts if the title contains a skip word.
|
||||
- **Scope: Files**: Skips files if the filename contains a skip word.
|
||||
- **Scope: Both**: Applies both rules.
|
||||
|
||||
**✂️ Remove Words from Name Input Field**
|
||||
- **Purpose**: Remove unwanted text from filenames (e.g., `patreon`, `[HD]`).
|
||||
|
||||
### 2.2. File Type Filtering
|
||||
**Filter Files (Radio Buttons)**
|
||||
- **Purpose**: Select file types to download.
|
||||
- **Options**:
|
||||
- **All**: All file types.
|
||||
- **Images/GIFs**: Common image formats.
|
||||
- **Videos**: Common video formats.
|
||||
- **🎧 Only Audio**: Common audio formats.
|
||||
- **📦 Only Archives**: Only `.zip` and `.rar` files.
|
||||
- **🔗 Only Links**: Extracts external links without downloading files.
|
||||
|
||||
**Skip .zip / Skip .rar Checkboxes**
|
||||
- **Purpose**: Skip downloading `.zip` or `.rar` files.
|
||||
- **Behavior**: Disabled when "📦 Only Archives" is active.
|
||||
|
||||
## 3. Download Customization
|
||||
Options to refine the download process and output.
|
||||
|
||||
- **Download Thumbnails Only**: Downloads small preview images instead of full-resolution files.
|
||||
- **Scan Content for Images**: Scans post HTML for `<img>` tags, crucial for images in descriptions.
|
||||
- **Compress to WebP**: Converts images to WebP format (requires Pillow library).
|
||||
- **Keep Duplicates**: Normally, if a post contains multiple files with the same name, only the first is downloaded. Checking this option will download all of them, renaming subsequent unique files with a numeric suffix (e.g., `image_1.jpg`).
|
||||
- **🗄️ Custom Folder Name (Single Post Only)**: Specify a custom folder name for a single post's content (appears if subfolders are enabled).
|
||||
|
||||
## 4. 📖 Manga/Comic Mode
|
||||
A mode for downloading creator feeds in chronological order, ideal for sequential content.
|
||||
|
||||
- **Activation**: Active when downloading a creator's entire feed (not a single post).
|
||||
- **Core Behavior**: Fetches all posts, processing from oldest to newest.
|
||||
- **Filename Style Toggle Button (in the log area)**:
|
||||
- **Purpose**: Controls file naming in Manga Mode. Cycles on click.
|
||||
- **Options**:
|
||||
- **Name: Post Title**: First file named after post title; others keep original names.
|
||||
- **Name: Original File**: Files keep server-provided names, with optional prefix.
|
||||
- **Name: Title+G.Num**: Global numbering with post title prefix (e.g., `Chapter 1_001.jpg`).
|
||||
- **Name: Date Based**: Sequential naming by post date (e.g., `001.jpg`), with optional prefix.
|
||||
- **Name: Post ID**: Files named after post ID to avoid clashes.
|
||||
- **Name: Date + Title**: Combines post date and title for filenames.
|
||||
|
||||
## 5. Folder Organization & Known.txt
|
||||
Controls for structuring downloaded content.
|
||||
|
||||
- **Separate Folders by Name/Title Checkbox**: Enables automatic subfolder creation.
|
||||
- **Subfolder per Post Checkbox**: Creates subfolders for each post, named after the post title.
|
||||
- **Date Prefix for Post Subfolders Checkbox**: When used with "Subfolder per Post," this option prefixes the folder name with the post's upload date (e.g., `2025-07-11 Post Title`), allowing for chronological sorting.
|
||||
- **Known.txt Management UI (Bottom Left)**:
|
||||
- **Purpose**: Manages a local `Known.txt` file for series, characters, or terms used in folder creation.
|
||||
- **List Display**: Shows primary names from `Known.txt`.
|
||||
- **➕ Add Button**: Adds names or groups (e.g., `(Character A, Alias B)~`).
|
||||
- **⤵️ Add to Filter Button**: Select names from `Known.txt` for the character filter.
|
||||
- **🗑️ Delete Selected Button**: Removes selected names from `Known.txt`.
|
||||
- **Open Known.txt Button**: Opens the file in the default text editor.
|
||||
- **❓ Help Button**: Opens this feature guide.
|
||||
- **📜 History Button**: Views recent download history.
|
||||
|
||||
## 6. ⭐ Favorite Mode (Kemono.su Only)
|
||||
Download from favorited artists/posts on Kemono.su.
|
||||
|
||||
- **Enable Checkbox ("⭐ Favorite Mode")**:
|
||||
- Switches to Favorite Mode.
|
||||
- Disables the main URL input.
|
||||
- Changes action buttons to "Favorite Artists" and "Favorite Posts".
|
||||
- Requires cookies.
|
||||
- **🖼️ Favorite Artists Button**: Select and download from favorited artists.
|
||||
- **📄 Favorite Posts Button**: Select and download specific favorited posts.
|
||||
- **Favorite Download Scope Button**:
|
||||
- **Scope: Selected Location**: Downloads favorites to the main directory.
|
||||
- **Scope: Artist Folders**: Creates subfolders per artist.
|
||||
|
||||
## 7. Advanced Settings & Performance
|
||||
- **🍪 Cookie Management**:
|
||||
- **Use Cookie Checkbox**: Enables cookies for restricted content.
|
||||
- **Cookie Text Field**: Paste cookie string.
|
||||
- **Browse... Button**: Select a `cookies.txt` file (Netscape format).
|
||||
- **Use Multithreading Checkbox & Threads Input**:
|
||||
- **Purpose**: Configures simultaneous operations.
|
||||
- **Behavior**: Sets concurrent post processing (creator feeds) or file downloads (single posts).
|
||||
- **Multi-part Download Toggle Button**:
|
||||
- **Purpose**: Enables/disables multi-segment downloading for large files.
|
||||
- **Note**: Best for large files; less efficient for small files.
|
||||
|
||||
## 8. Logging, Monitoring & Error Handling
|
||||
- **📜 Progress Log Area**: Displays messages, progress, and errors.
|
||||
- **👁️ / 🙈 Log View Toggle Button**: Switches between Progress Log and Missed Character Log (skipped posts).
|
||||
- **Show External Links in Log**: Displays external links (e.g., Mega, Google Drive) in a secondary panel.
|
||||
- **Export Links Button**: Saves extracted links to a `.txt` file in "Only Links" mode.
|
||||
- **Download Extracted Links Button**: Downloads files from supported external links in "Only Links" mode.
|
||||
- **🆘 Error Button & Dialog**:
|
||||
- **Purpose**: Active if files fail to download. The button will display a live count of failed files (e.g., **(3) Error**).
|
||||
- **Dialog Features**:
|
||||
- Lists failed files.
|
||||
- Retry failed downloads.
|
||||
- Export failed URLs to a text file.
|
||||
|
||||
## 9. Application Settings (⚙️)
|
||||
- **Appearance**: Switch between Light and Dark themes.
|
||||
- **Language**: Change UI language (restart required).
|
||||
<div>
|
||||
<h1>Kemono Downloader - Comprehensive Feature Guide</h1>
|
||||
<p>This guide provides a detailed overview of all user interface elements, input fields, buttons, popups, and functionalities available in the application.</p>
|
||||
<hr>
|
||||
<h2><strong>Main Window: Core Functionality</strong></h2>
|
||||
<p>The application is divided into a configuration panel on the left and a status/log panel on the right.</p>
|
||||
<h3><strong>Primary Inputs (Top-Left)</strong></h3>
|
||||
<ul>
|
||||
<li><strong>URL Input Field</strong>: This is the starting point for most downloads. You can paste a URL for a specific post or for an entire creator's feed. The application's behavior adapts based on the URL type.</li>
|
||||
<li><strong>🎨 Creator Selection Popup</strong>: This button opens a powerful dialog listing all known creators. From here, you can:
|
||||
<ul>
|
||||
<li><strong>Search and Queue</strong>: Search for creators and check multiple names. Clicking "Add Selected" populates the main input field, preparing a batch download.</li>
|
||||
<li><strong>Check for Updates</strong>: Select a single creator's saved profile. This loads their information and switches the main download button to "Check for Updates" mode, allowing you to download only new content since your last session.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Download Location</strong>: The primary folder where all content will be saved. The <strong>Browse...</strong> button lets you select this folder from your computer.</li>
|
||||
<li><strong>Page Range (Start/End)</strong>: These fields activate only for creator feed URLs. They allow you to download a specific slice of a creator's history (e.g., pages 5 through 10) instead of their entire feed.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h2><strong>Filtering & Naming (Left Panel)</strong></h2>
|
||||
<p>These features give you precise control over what gets downloaded and how it's named and organized.</p>
|
||||
<ul>
|
||||
<li><strong>Filter by Character(s)</strong>: A powerful tool to download content featuring specific characters. You can enter multiple names separated by commas.
|
||||
<ul>
|
||||
<li><strong>Filter: [Scope] Button</strong>: This button changes how the character filter works:
|
||||
<ul>
|
||||
<li><strong>Title</strong>: Downloads posts only if a character's name is in the post title.</li>
|
||||
<li><strong>Files</strong>: Downloads posts if a character's name is in any of the filenames within the post.</li>
|
||||
<li><strong>Both</strong>: Combines the "Title" and "Files" logic.</li>
|
||||
<li><strong>Comments (Beta)</strong>: Downloads a post if a character's name is mentioned in the comments section.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Skip with Words</strong>: A keyword-based filter to avoid unwanted content (e.g., <code>WIP</code>, <code>sketch</code>).
|
||||
<ul>
|
||||
<li><strong>Scope: [Type] Button</strong>: This button changes how the skip filter works:
|
||||
<ul>
|
||||
<li><strong>Posts</strong>: Skips the entire post if a keyword is found in the title.</li>
|
||||
<li><strong>Files</strong>: Skips only individual files if a keyword is found in the filename.</li>
|
||||
<li><strong>Both</strong>: Applies both levels of skipping.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Remove Words from name</strong>: Automatically cleans downloaded filenames by removing any specified words (e.g., "patreon," "HD").</li>
|
||||
</ul>
|
||||
<h3><strong>File Type Filter (Radio Buttons)</strong></h3>
|
||||
<p>This section lets you choose the kind of content you want:</p>
|
||||
<ul>
|
||||
<li><strong>All, Images/GIFs, Videos, 🎧 Only Audio, 📦 Only Archives</strong>: These options filter the downloads to only include the selected file types.</li>
|
||||
<li><strong>🔗 Only Links</strong>: This special mode doesn't download any files. Instead, it scans post descriptions and lists all external links (like Mega, Google Drive) in the log panel.</li>
|
||||
<li><strong>More</strong>: Opens a dialog for text-only downloads. You can choose to save post <strong>descriptions</strong> or <strong>comments</strong> as formatted <strong>PDF, DOCX, or TXT</strong> files. A key feature here is the <strong>"Single PDF"</strong> option, which compiles the text from all downloaded posts into one continuous, sorted PDF document.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h2><strong>Download Options & Advanced Settings (Checkboxes)</strong></h2>
|
||||
<ul>
|
||||
<li><strong>Skip .zip</strong>: A simple toggle to ignore archive files during downloads.</li>
|
||||
<li><strong>Download Thumbnails Only</strong>: Downloads only the small preview images instead of the full-resolution files.</li>
|
||||
<li><strong>Scan Content for Images</strong>: A crucial feature that scans the post's text content for embedded images that may not be listed in the API, ensuring a more complete download.</li>
|
||||
<li><strong>Compress to WebP</strong>: Saves disk space by automatically converting large images into the efficient WebP format.</li>
|
||||
<li><strong>Keep Duplicates</strong>: Opens a dialog to control how files with identical content are handled. The default is to skip duplicates, but you can choose to keep all of them or set a specific limit (e.g., "keep up to 2 copies of the same file").</li>
|
||||
<li><strong>Subfolder per Post</strong>: Organizes downloads by creating a unique folder for each post, named after the post's title.</li>
|
||||
<li><strong>Date Prefix</strong>: When "Subfolder per Post" is on, this adds the post's date to the beginning of the folder name (e.g., <code>2025-07-25 Post Title</code>).</li>
|
||||
<li><strong>Separate Folders by Known.txt</strong>: This enables the automatic folder organization system based on your "Known Names" list.</li>
|
||||
<li><strong>Use Cookie</strong>: Allows the application to use browser cookies to access content that might be behind a paywall or login. You can paste a cookie string directly or use <strong>Browse...</strong> to select a <code>cookies.txt</code> file.</li>
|
||||
<li><strong>Use Multithreading</strong>: Greatly speeds up downloads of creator feeds by processing multiple posts at once. The number of <strong>Threads</strong> can be configured.</li>
|
||||
<li><strong>Show External Links in Log</strong>: When checked, a secondary log panel appears at the bottom of the right side, dedicated to listing any external links found.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h2><strong>Known Names Management (Bottom-Left)</strong></h2>
|
||||
<p>This powerful feature automates the creation of organized, named folders.</p>
|
||||
<ul>
|
||||
<li><strong>Known Shows/Characters List</strong>: Displays all the names and groups you've saved.</li>
|
||||
<li><strong>Search...</strong>: Filters the list to quickly find a name.</li>
|
||||
<li><strong>Open Known.txt</strong>: Opens the source file in a text editor for advanced manual editing.</li>
|
||||
<li><strong>Add New Name</strong>:
|
||||
<ul>
|
||||
<li><strong>Single Name</strong>: Typing <code>Tifa Lockhart</code> and clicking <strong>➕ Add</strong> creates an entry that will match "Tifa Lockhart".</li>
|
||||
<li><strong>Group</strong>: Typing <code>(Boa, Hancock, Snake Princess)~</code> and clicking <strong>➕ Add</strong> creates a single entry named "Boa Hancock Snake Princess". The application will then look for "Boa," "Hancock," OR "Snake Princess" in titles/filenames and save any matches into that combined folder.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>⤵️ Add to Filter</strong>: Opens a dialog with your full Known Names list, allowing you to check multiple entries and add them all to the "Filter by Character(s)" field at once.</li>
|
||||
<li><strong>🗑️ Delete Selected</strong>: Removes highlighted names from your list.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h2><strong>Action Buttons & Status Controls</strong></h2>
|
||||
<ul>
|
||||
<li><strong>⬇️ Start Download / 🔗 Extract Links</strong>: The main action button. Its function is dynamic:
|
||||
<ul>
|
||||
<li><strong>Normal Mode</strong>: Starts the download based on the current settings.</li>
|
||||
<li><strong>Update Mode</strong>: After selecting a creator profile, this button changes to <strong>🔄 Check for Updates</strong>.</li>
|
||||
<li><strong>Update Confirmation</strong>: After new posts are found, it changes to <strong>⬇️ Start Download (X new)</strong>.</li>
|
||||
<li><strong>Link Extraction Mode</strong>: The text changes to <strong>🔗 Extract Links</strong>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>⏸️ Pause / ▶️ Resume Download</strong>: Pauses the ongoing download, allowing you to change certain settings (like filters) on the fly. Click again to resume.</li>
|
||||
<li><strong>❌ Cancel & Reset UI</strong>: Immediately stops all download activity and resets the UI to a clean state, preserving your URL and Download Location inputs.</li>
|
||||
<li><strong>Error Button</strong>: If files fail to download, they are logged. This button opens a dialog listing all failed files and will show a count of errors (e.g., <strong>(5) Error</strong>). From the dialog, you can:
|
||||
<ul>
|
||||
<li>Select specific files to <strong>Retry</strong> downloading.</li>
|
||||
<li><strong>Export</strong> the list of failed URLs to a <code>.txt</code> file.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>🔄 Reset (Top-Right)</strong>: A hard reset that clears all logs and returns every single UI element to its default state.</li>
|
||||
<li><strong>⚙️ (Settings)</strong>: Opens the main Settings dialog.</li>
|
||||
<li><strong>📜 (History)</strong>: Opens the Download History dialog.</li>
|
||||
<li><strong>? (Help)</strong>: Opens a helpful guide explaining the application's features.</li>
|
||||
<li><strong>❤️ Support</strong>: Opens a dialog with information on how to support the developer.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h2><strong>Specialized Modes & Features</strong></h2>
|
||||
<h3><strong>⭐ Favorite Mode</strong></h3>
|
||||
<p>Activating this mode transforms the UI for managing saved collections:</p>
|
||||
<ul>
|
||||
<li>The URL input is disabled.</li>
|
||||
<li>The main action buttons are replaced with:
|
||||
<ul>
|
||||
<li><strong>🖼️ Favorite Artists</strong>: Opens a dialog to browse and queue downloads from your saved favorite creators.</li>
|
||||
<li><strong>📄 Favorite Posts</strong>: Opens a dialog to browse and queue downloads for specific saved favorite posts.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Scope: [Location] Button</strong>: Toggles where the favorited content is saved:
|
||||
<ul>
|
||||
<li><strong>Selected Location</strong>: Saves all content directly into the main "Download Location".</li>
|
||||
<li><strong>Artist Folders</strong>: Creates a subfolder for each artist inside the main "Download Location".</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3><strong>📖 Manga/Comic Mode</strong></h3>
|
||||
<p>This mode is designed for sequential content and has several effects:</p>
|
||||
<ul>
|
||||
<li><strong>Reverses Download Order</strong>: It fetches and downloads posts from <strong>oldest to newest</strong>.</li>
|
||||
<li><strong>Enables Special Naming</strong>: A <strong><code>Name: [Style]</code></strong> button appears, allowing you to choose how files are named to maintain their correct order (e.g., by Post Title, by Date, or simple sequential numbering like <code>001, 002, 003...</code>).</li>
|
||||
<li><strong>Disables Multithreading (for certain styles)</strong>: To guarantee perfect sequential numbering, multithreading for posts is automatically disabled for certain naming styles.</li>
|
||||
</ul>
|
||||
<h3><strong>Session & Error Management</strong></h3>
|
||||
<ul>
|
||||
<li><strong>Session Restore</strong>: If the application is closed unexpectedly during a download, it will detect the incomplete session on the next launch. The UI will present a <strong>🔄 Restore Download</strong> button to resume exactly where you left off. You can also choose to discard the session.</li>
|
||||
<li><strong>Update Checking</strong>: By selecting a creator profile via the <strong>🎨 Creator Selection Popup</strong>, you can run an update check. The application compares the posts on the server with your download history for that creator and will prompt you to download only the new content.</li>
|
||||
</ul>
|
||||
<h3><strong>Logging & Monitoring</strong></h3>
|
||||
<ul>
|
||||
<li><strong>Progress Log</strong>: The main log provides real-time feedback on the download process, including status messages, file saves, skips, and errors.</li>
|
||||
<li><strong>👁️ Log View Toggle</strong>: Switches the log view between the standard <strong>Progress Log</strong> and a <strong>Missed Character Log</strong>, which shows potential character names from posts that were skipped by your filters, helping you discover new names to add to your list.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -159,7 +159,7 @@ class DownloadManager:
|
||||
if self.thread_pool:
|
||||
self.thread_pool.shutdown(wait=True)
|
||||
self.is_running = False
|
||||
self._log("🏁 All processing tasks have completed.")
|
||||
self._log("🏁 All processing tasks have completed or been cancelled.")
|
||||
self.progress_queue.put({
|
||||
'type': 'finished',
|
||||
'payload': (self.total_downloads, self.total_skips, self.cancellation_event.is_set(), self.all_kept_original_filenames)
|
||||
|
||||
@@ -593,6 +593,33 @@ class PostProcessorWorker:
|
||||
os.remove(downloaded_part_file_path)
|
||||
except OSError: pass
|
||||
return 0, 1, filename_to_save_in_main_path, was_original_name_kept_flag, FILE_DOWNLOAD_STATUS_SKIPPED, None
|
||||
|
||||
if (self.compress_images and downloaded_part_file_path and
|
||||
is_image(api_original_filename) and
|
||||
os.path.getsize(downloaded_part_file_path) > 1.5 * 1024 * 1024):
|
||||
|
||||
self.logger(f" 🔄 Compressing '{api_original_filename}' to WebP...")
|
||||
try:
|
||||
with Image.open(downloaded_part_file_path) as img:
|
||||
# Convert to RGB to avoid issues with paletted images or alpha channels in WebP
|
||||
if img.mode not in ('RGB', 'RGBA'):
|
||||
img = img.convert('RGBA')
|
||||
|
||||
# Use an in-memory buffer to save the compressed image
|
||||
output_buffer = BytesIO()
|
||||
img.save(output_buffer, format='WebP', quality=85)
|
||||
|
||||
# This buffer now holds the compressed data
|
||||
data_to_write_io = output_buffer
|
||||
|
||||
# Update the filename to use the .webp extension
|
||||
base, _ = os.path.splitext(filename_to_save_in_main_path)
|
||||
filename_to_save_in_main_path = f"{base}.webp"
|
||||
self.logger(f" ✅ Compression successful. New size: {len(data_to_write_io.getvalue()) / (1024*1024):.2f} MB")
|
||||
|
||||
except Exception as e_compress:
|
||||
self.logger(f" ⚠️ Failed to compress '{api_original_filename}': {e_compress}. Saving original file instead.")
|
||||
data_to_write_io = None # Ensure we fall back to saving the original
|
||||
|
||||
effective_save_folder = target_folder_path
|
||||
base_name, extension = os.path.splitext(filename_to_save_in_main_path)
|
||||
@@ -610,15 +637,17 @@ class PostProcessorWorker:
|
||||
|
||||
try:
|
||||
if data_to_write_io:
|
||||
# Write the compressed data from the in-memory buffer
|
||||
with open(final_save_path, 'wb') as f_out:
|
||||
time.sleep(0.05)
|
||||
f_out.write(data_to_write_io.getvalue())
|
||||
# Clean up the original downloaded part file
|
||||
if downloaded_part_file_path and os.path.exists(downloaded_part_file_path):
|
||||
try:
|
||||
os.remove(downloaded_part_file_path)
|
||||
except OSError as e_rem:
|
||||
self.logger(f" -> Failed to remove .part after compression: {e_rem}")
|
||||
else:
|
||||
# No compression was done, just rename the original file
|
||||
if downloaded_part_file_path and os.path.exists(downloaded_part_file_path):
|
||||
time.sleep(0.1)
|
||||
os.rename(downloaded_part_file_path, final_save_path)
|
||||
@@ -691,7 +720,6 @@ class PostProcessorWorker:
|
||||
else:
|
||||
return 0, 1, filename_to_save_in_main_path, was_original_name_kept_flag, FILE_DOWNLOAD_STATUS_FAILED_RETRYABLE_LATER, details_for_failure
|
||||
|
||||
|
||||
def process(self):
|
||||
|
||||
result_tuple = (0, 0, [], [], [], None, None)
|
||||
@@ -859,17 +887,6 @@ class PostProcessorWorker:
|
||||
result_tuple = (0, num_potential_files_in_post, [], [], [], None, None)
|
||||
return result_tuple
|
||||
|
||||
if self.skip_words_list and (self.skip_words_scope == SKIP_SCOPE_POSTS or self.skip_words_scope == SKIP_SCOPE_BOTH):
|
||||
if self._check_pause(f"Skip words (post title) for post {post_id}"):
|
||||
result_tuple = (0, num_potential_files_in_post, [], [], [], None, None)
|
||||
return result_tuple
|
||||
post_title_lower = post_title.lower()
|
||||
for skip_word in self.skip_words_list:
|
||||
if skip_word.lower() in post_title_lower:
|
||||
self.logger(f" -> Skip Post (Keyword in Title '{skip_word}'): '{post_title[:50]}...'. Scope: {self.skip_words_scope}")
|
||||
result_tuple = (0, num_potential_files_in_post, [], [], [], None, None)
|
||||
return result_tuple
|
||||
|
||||
if not self.extract_links_only and self.manga_mode_active and current_character_filters and (self.char_filter_scope == CHAR_SCOPE_TITLE or self.char_filter_scope == CHAR_SCOPE_BOTH) and not post_is_candidate_by_title_char_match:
|
||||
self.logger(f" -> Skip Post (Manga Mode with Title/Both Scope - No Title Char Match): Title '{post_title[:50]}' doesn't match filters.")
|
||||
self._emit_signal('missed_character_post', post_title, "Manga Mode: No title match for character filter (Title/Both scope)")
|
||||
@@ -880,6 +897,7 @@ class PostProcessorWorker:
|
||||
self.logger(f"⚠️ Corrupt attachment data for post {post_id} (expected list, got {type(post_attachments)}). Skipping attachments.")
|
||||
post_attachments = []
|
||||
|
||||
# CORRECTED LOGIC: Determine folder path BEFORE skip checks
|
||||
base_folder_names_for_post_content = []
|
||||
determined_post_save_path_for_history = self.override_output_dir if self.override_output_dir else self.download_root
|
||||
if not self.extract_links_only and self.use_subfolders:
|
||||
@@ -1028,6 +1046,28 @@ class PostProcessorWorker:
|
||||
break
|
||||
determined_post_save_path_for_history = os.path.join(base_path_for_post_subfolder, final_post_subfolder_name)
|
||||
|
||||
if self.skip_words_list and (self.skip_words_scope == SKIP_SCOPE_POSTS or self.skip_words_scope == SKIP_SCOPE_BOTH):
|
||||
if self._check_pause(f"Skip words (post title) for post {post_id}"):
|
||||
result_tuple = (0, num_potential_files_in_post, [], [], [], None, None)
|
||||
return result_tuple
|
||||
post_title_lower = post_title.lower()
|
||||
for skip_word in self.skip_words_list:
|
||||
if skip_word.lower() in post_title_lower:
|
||||
self.logger(f" -> Skip Post (Keyword in Title '{skip_word}'): '{post_title[:50]}...'. Scope: {self.skip_words_scope}")
|
||||
# Create a history object for the skipped post to record its ID
|
||||
history_data_for_skipped_post = {
|
||||
'post_id': post_id,
|
||||
'service': self.service,
|
||||
'user_id': self.user_id,
|
||||
'post_title': post_title,
|
||||
'top_file_name': "N/A (Post Skipped)",
|
||||
'num_files': num_potential_files_in_post,
|
||||
'upload_date_str': post_data.get('published') or post_data.get('added') or "Unknown",
|
||||
'download_location': determined_post_save_path_for_history
|
||||
}
|
||||
result_tuple = (0, num_potential_files_in_post, [], [], [], history_data_for_skipped_post, None)
|
||||
return result_tuple
|
||||
|
||||
if self.filter_mode == 'text_only' and not self.extract_links_only:
|
||||
self.logger(f" Mode: Text Only (Scope: {self.text_only_scope})")
|
||||
post_title_lower = post_title.lower()
|
||||
|
||||
@@ -969,6 +969,9 @@ class EmptyPopupDialog (QDialog ):
|
||||
self .parent_app .link_input .setPlaceholderText (
|
||||
self .parent_app ._tr ("items_in_queue_placeholder","{count} items in queue from popup.").format (count =total_in_queue )
|
||||
)
|
||||
|
||||
self.selected_creators_for_queue.clear()
|
||||
|
||||
self .accept ()
|
||||
else :
|
||||
QMessageBox .information (self ,self ._tr ("no_selection_title","No Selection"),
|
||||
|
||||
@@ -23,6 +23,11 @@ from PyQt5.QtWidgets import (
|
||||
QScrollArea, QListWidgetItem, QSizePolicy, QProgressBar, QAbstractItemView, QFrame,
|
||||
QMainWindow, QAction, QGridLayout,
|
||||
)
|
||||
try:
|
||||
from PIL import Image
|
||||
except ImportError:
|
||||
Image = None
|
||||
|
||||
from PyQt5.QtCore import Qt, QThread, pyqtSignal, QObject, QTimer, QSettings, QStandardPaths, QUrl, QSize, QProcess, QMutex, QMutexLocker, QCoreApplication
|
||||
from ..services.drive_downloader import download_mega_file as drive_download_mega_file ,download_gdrive_file ,download_dropbox_file
|
||||
from ..core.workers import DownloadThread as BackendDownloadThread
|
||||
@@ -228,6 +233,7 @@ class DownloaderApp (QWidget ):
|
||||
self.downloaded_hash_counts = defaultdict(int)
|
||||
self.downloaded_hash_counts_lock = threading.Lock()
|
||||
self.session_temp_files = []
|
||||
self.single_pdf_mode = False
|
||||
self.save_creator_json_enabled_this_session = True
|
||||
|
||||
print(f"ℹ️ Known.txt will be loaded/saved at: {self.config_file}")
|
||||
@@ -1424,15 +1430,21 @@ class DownloaderApp (QWidget ):
|
||||
|
||||
def _check_if_all_work_is_done(self):
|
||||
"""
|
||||
Checks if the fetcher thread is done AND if all submitted tasks have been processed.
|
||||
If so, finalizes the download.
|
||||
Checks if the fetcher thread is done AND if all submitted tasks have been processed OR if a cancellation was requested.
|
||||
If so, finalizes the download. This is the central point for completion logic.
|
||||
"""
|
||||
fetcher_is_done = not self.is_fetcher_thread_running
|
||||
all_workers_are_done = (self.total_posts_to_process > 0 and self.processed_posts_count >= self.total_posts_to_process)
|
||||
all_workers_are_done = (self.processed_posts_count >= self.total_posts_to_process)
|
||||
is_cancelled = self.cancellation_event.is_set()
|
||||
|
||||
if fetcher_is_done and all_workers_are_done:
|
||||
self.log_signal.emit("🏁 All fetcher and worker tasks complete.")
|
||||
self.finished_signal.emit(self.download_counter, self.skip_counter, self.cancellation_event.is_set(), self.all_kept_original_filenames)
|
||||
if fetcher_is_done and (all_workers_are_done or is_cancelled):
|
||||
if not self.is_finishing:
|
||||
if is_cancelled:
|
||||
self.log_signal.emit("🏁 Fetcher cancelled. Finalizing...")
|
||||
else:
|
||||
self.log_signal.emit("🏁 All fetcher and worker tasks complete. Finalizing...")
|
||||
|
||||
self.finished_signal.emit(self.download_counter, self.skip_counter, is_cancelled, self.all_kept_original_filenames)
|
||||
|
||||
def _sync_queue_with_link_input (self ,current_text ):
|
||||
"""
|
||||
@@ -4155,49 +4167,34 @@ class DownloaderApp (QWidget ):
|
||||
self ._update_log_display_mode_button_text ()
|
||||
self ._filter_links_log ()
|
||||
|
||||
def cancel_download_button_action (self ):
|
||||
self.is_finishing = True
|
||||
if not self .cancel_btn .isEnabled ()and not self .cancellation_event .is_set ():self .log_signal .emit ("ℹ️ No active download to cancel or already cancelling.");return
|
||||
self .log_signal .emit ("⚠️ Requesting cancellation of download process (soft reset)...")
|
||||
self._cleanup_temp_files()
|
||||
self._clear_session_file() # Clear session file on explicit cancel
|
||||
if self .external_link_download_thread and self .external_link_download_thread .isRunning ():
|
||||
self .log_signal .emit (" Cancelling active External Link download thread...")
|
||||
self .external_link_download_thread .cancel ()
|
||||
def cancel_download_button_action(self):
|
||||
"""
|
||||
Signals all active download processes to cancel but DOES NOT reset the UI.
|
||||
The UI reset is now handled by the 'download_finished' method.
|
||||
"""
|
||||
if self.cancellation_event.is_set():
|
||||
self.log_signal.emit("ℹ️ Cancellation is already in progress.")
|
||||
return
|
||||
|
||||
current_url =self .link_input .text ()
|
||||
current_dir =self .dir_input .text ()
|
||||
self.log_signal.emit("⚠️ Requesting cancellation of download process...")
|
||||
self.cancellation_event.set()
|
||||
|
||||
self .cancellation_event .set ()
|
||||
self .is_fetcher_thread_running =False
|
||||
if self .download_thread and self .download_thread .isRunning ():self .download_thread .requestInterruption ();self .log_signal .emit (" Signaled single download thread to interrupt.")
|
||||
if self .thread_pool :
|
||||
self .log_signal .emit (" Initiating non-blocking shutdown and cancellation of worker pool tasks...")
|
||||
self .thread_pool .shutdown (wait =False ,cancel_futures =True )
|
||||
self .thread_pool =None
|
||||
self .active_futures =[]
|
||||
# Update UI to "Cancelling" state
|
||||
self.pause_btn.setEnabled(False)
|
||||
self.cancel_btn.setEnabled(False)
|
||||
self.progress_label.setText(self._tr("status_cancelling", "Cancelling... Please wait."))
|
||||
|
||||
self .external_link_queue .clear ();self ._is_processing_external_link_queue =False ;self ._current_link_post_title =None
|
||||
# Signal all active components to stop
|
||||
if self.download_thread and self.download_thread.isRunning():
|
||||
self.download_thread.requestInterruption()
|
||||
self.log_signal.emit(" Signaled single download thread to interrupt.")
|
||||
|
||||
self ._perform_soft_ui_reset (preserve_url =current_url ,preserve_dir =current_dir )
|
||||
|
||||
self .progress_label .setText (f"{self ._tr ('status_cancelled_by_user','Cancelled by user')}. {self ._tr ('ready_for_new_task_text','Ready for new task.')}")
|
||||
self .file_progress_label .setText ("")
|
||||
if self .pause_event :self .pause_event .clear ()
|
||||
self .log_signal .emit ("ℹ️ UI reset. Ready for new operation. Background tasks are being terminated.")
|
||||
self .is_paused =False
|
||||
if hasattr (self ,'retryable_failed_files_info')and self .retryable_failed_files_info :
|
||||
self .log_signal .emit (f" Discarding {len (self .retryable_failed_files_info )} pending retryable file(s) due to cancellation.")
|
||||
self .cancellation_message_logged_this_session =False
|
||||
self .retryable_failed_files_info .clear ()
|
||||
self .favorite_download_queue .clear ()
|
||||
self .permanently_failed_files_for_dialog .clear ()
|
||||
self .is_processing_favorites_queue =False
|
||||
self .favorite_download_scope =FAVORITE_SCOPE_SELECTED_LOCATION
|
||||
self ._update_favorite_scope_button_text ()
|
||||
if hasattr (self ,'link_input'):
|
||||
self .last_link_input_text_for_queue_sync =self .link_input .text ()
|
||||
self .cancellation_message_logged_this_session =False
|
||||
if self.thread_pool:
|
||||
self.log_signal.emit(" Signaling worker pool to cancel futures...")
|
||||
|
||||
if self.external_link_download_thread and self.external_link_download_thread.isRunning():
|
||||
self.log_signal.emit(" Cancelling active External Link download thread...")
|
||||
self.external_link_download_thread.cancel()
|
||||
|
||||
def _get_domain_for_service (self ,service_name :str )->str :
|
||||
"""Determines the base domain for a given service."""
|
||||
@@ -4215,119 +4212,129 @@ class DownloaderApp (QWidget ):
|
||||
return
|
||||
self.is_finishing = True
|
||||
|
||||
self.log_signal.emit("🏁 Download of current item complete.")
|
||||
try:
|
||||
if cancelled_by_user:
|
||||
self.log_signal.emit("✅ Cancellation complete. Resetting UI.")
|
||||
current_url = self.link_input.text()
|
||||
current_dir = self.dir_input.text()
|
||||
self._perform_soft_ui_reset(preserve_url=current_url, preserve_dir=current_dir)
|
||||
self.progress_label.setText(f"{self._tr('status_cancelled_by_user', 'Cancelled by user')}. {self._tr('ready_for_new_task_text', 'Ready for new task.')}")
|
||||
self.file_progress_label.setText("")
|
||||
if self.pause_event: self.pause_event.clear()
|
||||
self.is_paused = False
|
||||
return # Exit after handling cancellation
|
||||
|
||||
if self.is_processing_favorites_queue and self.favorite_download_queue:
|
||||
self.log_signal.emit("✅ Item finished. Processing next in queue...")
|
||||
self._process_next_favorite_download()
|
||||
return
|
||||
self.log_signal.emit("🏁 Download of current item complete.")
|
||||
|
||||
if self.is_processing_favorites_queue:
|
||||
self.is_processing_favorites_queue = False
|
||||
self.log_signal.emit("✅ All items from the download queue have been processed.")
|
||||
if self.is_processing_favorites_queue and self.favorite_download_queue:
|
||||
self.log_signal.emit("✅ Item finished. Processing next in queue...")
|
||||
self.is_finishing = False # Allow the next item in queue to start
|
||||
self._process_next_favorite_download()
|
||||
return
|
||||
|
||||
if not cancelled_by_user and not self.retryable_failed_files_info:
|
||||
self._clear_session_file()
|
||||
self.interrupted_session_data = None
|
||||
self.is_restore_pending = False
|
||||
if self.is_processing_favorites_queue:
|
||||
self.is_processing_favorites_queue = False
|
||||
self.log_signal.emit("✅ All items from the download queue have been processed.")
|
||||
|
||||
self._finalize_download_history()
|
||||
status_message = self._tr("status_cancelled_by_user", "Cancelled by user") if cancelled_by_user else self._tr("status_completed", "Completed")
|
||||
if cancelled_by_user and self.retryable_failed_files_info:
|
||||
self.log_signal.emit(f" Download cancelled, discarding {len(self.retryable_failed_files_info)} file(s) that were pending retry.")
|
||||
self.retryable_failed_files_info.clear()
|
||||
if not cancelled_by_user and not self.retryable_failed_files_info:
|
||||
self._clear_session_file()
|
||||
self.interrupted_session_data = None
|
||||
self.is_restore_pending = False
|
||||
|
||||
summary_log = "=" * 40
|
||||
summary_log += f"\n🏁 Download {status_message}!\n Summary: Downloaded Files={total_downloaded}, Skipped Files={total_skipped}\n"
|
||||
summary_log += "=" * 40
|
||||
self.log_signal.emit(summary_log)
|
||||
self.log_signal.emit("")
|
||||
|
||||
if self.thread_pool:
|
||||
self.log_signal.emit(" Shutting down worker thread pool...")
|
||||
self.thread_pool.shutdown(wait=False)
|
||||
self.thread_pool = None
|
||||
self.log_signal.emit(" Thread pool shut down.")
|
||||
self._finalize_download_history()
|
||||
status_message = self._tr("status_completed", "Completed")
|
||||
|
||||
if self.single_pdf_setting and self.session_temp_files and not cancelled_by_user:
|
||||
try:
|
||||
self._trigger_single_pdf_creation()
|
||||
finally:
|
||||
summary_log = "=" * 40
|
||||
summary_log += f"\n🏁 Download {status_message}!\n Summary: Downloaded Files={total_downloaded}, Skipped Files={total_skipped}\n"
|
||||
summary_log += "=" * 40
|
||||
self.log_signal.emit(summary_log)
|
||||
self.log_signal.emit("")
|
||||
|
||||
if self.thread_pool:
|
||||
self.thread_pool.shutdown(wait=False)
|
||||
self.thread_pool = None
|
||||
|
||||
if self.single_pdf_setting and self.session_temp_files:
|
||||
try:
|
||||
self._trigger_single_pdf_creation()
|
||||
finally:
|
||||
self._cleanup_temp_files()
|
||||
else:
|
||||
self._cleanup_temp_files()
|
||||
self.single_pdf_setting = False
|
||||
else:
|
||||
self._cleanup_temp_files()
|
||||
self.single_pdf_setting = False
|
||||
|
||||
if kept_original_names_list is None:
|
||||
kept_original_names_list = list(self.all_kept_original_filenames) if hasattr(self, 'all_kept_original_filenames') else []
|
||||
if kept_original_names_list is None:
|
||||
kept_original_names_list = []
|
||||
if kept_original_names_list is None:
|
||||
kept_original_names_list = list(self.all_kept_original_filenames) if hasattr(self, 'all_kept_original_filenames') else []
|
||||
if kept_original_names_list is None:
|
||||
kept_original_names_list = []
|
||||
|
||||
if kept_original_names_list:
|
||||
intro_msg = (
|
||||
HTML_PREFIX +
|
||||
"<p>ℹ️ The following files from multi-file manga posts "
|
||||
"(after the first file) kept their <b>original names</b>:</p>"
|
||||
if kept_original_names_list:
|
||||
intro_msg = (
|
||||
HTML_PREFIX +
|
||||
"<p>ℹ️ The following files from multi-file manga posts "
|
||||
"(after the first file) kept their <b>original names</b>:</p>"
|
||||
)
|
||||
self.log_signal.emit(intro_msg)
|
||||
html_list_items = "<ul>"
|
||||
for name in kept_original_names_list:
|
||||
html_list_items += f"<li><b>{name}</b></li>"
|
||||
html_list_items += "</ul>"
|
||||
self.log_signal.emit(HTML_PREFIX + html_list_items)
|
||||
self.log_signal.emit("=" * 40)
|
||||
|
||||
if self.download_thread:
|
||||
try:
|
||||
if hasattr(self.download_thread, 'progress_signal'): self.download_thread.progress_signal.disconnect(self.handle_main_log)
|
||||
if hasattr(self.download_thread, 'add_character_prompt_signal'): self.download_thread.add_character_prompt_signal.disconnect(self.add_character_prompt_signal)
|
||||
if hasattr(self.download_thread, 'finished_signal'): self.download_thread.finished_signal.disconnect(self.download_finished)
|
||||
if hasattr(self.download_thread, 'receive_add_character_result'): self.character_prompt_response_signal.disconnect(self.download_thread.receive_add_character_result)
|
||||
if hasattr(self.download_thread, 'external_link_signal'): self.download_thread.external_link_signal.disconnect(self.handle_external_link_signal)
|
||||
if hasattr(self.download_thread, 'file_progress_signal'): self.download_thread.file_progress_signal.disconnect(self.update_file_progress_display)
|
||||
if hasattr(self.download_thread, 'missed_character_post_signal'): self.download_thread.missed_character_post_signal.disconnect(self.handle_missed_character_post)
|
||||
if hasattr(self.download_thread, 'retryable_file_failed_signal'): self.download_thread.retryable_file_failed_signal.disconnect(self._handle_retryable_file_failure)
|
||||
if hasattr(self.download_thread, 'file_successfully_downloaded_signal'): self.download_thread.file_successfully_downloaded_signal.disconnect(self._handle_actual_file_downloaded)
|
||||
if hasattr(self.download_thread, 'post_processed_for_history_signal'): self.download_thread.post_processed_for_history_signal.disconnect(self._add_to_history_candidates)
|
||||
except (TypeError, RuntimeError) as e:
|
||||
self.log_signal.emit(f"ℹ️ Note during single-thread signal disconnection: {e}")
|
||||
|
||||
if not self.download_thread.isRunning():
|
||||
if self.download_thread:
|
||||
self.download_thread.deleteLater()
|
||||
self.download_thread = None
|
||||
|
||||
self.progress_label.setText(
|
||||
f"{status_message}: "
|
||||
f"{total_downloaded} {self._tr('files_downloaded_label', 'downloaded')}, "
|
||||
f"{total_skipped} {self._tr('files_skipped_label', 'skipped')}."
|
||||
)
|
||||
self.log_signal.emit(intro_msg)
|
||||
html_list_items = "<ul>"
|
||||
for name in kept_original_names_list:
|
||||
html_list_items += f"<li><b>{name}</b></li>"
|
||||
html_list_items += "</ul>"
|
||||
self.log_signal.emit(HTML_PREFIX + html_list_items)
|
||||
self.log_signal.emit("=" * 40)
|
||||
self.file_progress_label.setText("")
|
||||
|
||||
if self.download_thread:
|
||||
try:
|
||||
if hasattr(self.download_thread, 'progress_signal'): self.download_thread.progress_signal.disconnect(self.handle_main_log)
|
||||
if hasattr(self.download_thread, 'add_character_prompt_signal'): self.download_thread.add_character_prompt_signal.disconnect(self.add_character_prompt_signal)
|
||||
if hasattr(self.download_thread, 'finished_signal'): self.download_thread.finished_signal.disconnect(self.download_finished)
|
||||
if hasattr(self.download_thread, 'receive_add_character_result'): self.character_prompt_response_signal.disconnect(self.download_thread.receive_add_character_result)
|
||||
if hasattr(self.download_thread, 'external_link_signal'): self.download_thread.external_link_signal.disconnect(self.handle_external_link_signal)
|
||||
if hasattr(self.download_thread, 'file_progress_signal'): self.download_thread.file_progress_signal.disconnect(self.update_file_progress_display)
|
||||
if hasattr(self.download_thread, 'missed_character_post_signal'): self.download_thread.missed_character_post_signal.disconnect(self.handle_missed_character_post)
|
||||
if hasattr(self.download_thread, 'retryable_file_failed_signal'): self.download_thread.retryable_file_failed_signal.disconnect(self._handle_retryable_file_failure)
|
||||
if hasattr(self.download_thread, 'file_successfully_downloaded_signal'): self.download_thread.file_successfully_downloaded_signal.disconnect(self._handle_actual_file_downloaded)
|
||||
if hasattr(self.download_thread, 'post_processed_for_history_signal'): self.download_thread.post_processed_for_history_signal.disconnect(self._add_to_history_candidates)
|
||||
except (TypeError, RuntimeError) as e:
|
||||
self.log_signal.emit(f"ℹ️ Note during single-thread signal disconnection: {e}")
|
||||
if not cancelled_by_user and self.retryable_failed_files_info:
|
||||
num_failed = len(self.retryable_failed_files_info)
|
||||
reply = QMessageBox.question(self, "Retry Failed Downloads?",
|
||||
f"{num_failed} file(s) failed with potentially recoverable errors (e.g., IncompleteRead).\n\n"
|
||||
"Would you like to attempt to download these failed files again?",
|
||||
QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
|
||||
if reply == QMessageBox.Yes:
|
||||
self.is_finishing = False # Allow retry session to start
|
||||
self._start_failed_files_retry_session()
|
||||
return # Exit to allow retry session to run
|
||||
else:
|
||||
self.log_signal.emit("ℹ️ User chose not to retry failed files.")
|
||||
self.permanently_failed_files_for_dialog.extend(self.retryable_failed_files_info)
|
||||
if self.permanently_failed_files_for_dialog:
|
||||
self.log_signal.emit(f"🆘 Error button enabled. {len(self.permanently_failed_files_for_dialog)} file(s) can be viewed.")
|
||||
self.cancellation_message_logged_this_session = False
|
||||
self.retryable_failed_files_info.clear()
|
||||
|
||||
if not self.download_thread.isRunning():
|
||||
if self.download_thread:
|
||||
self.download_thread.deleteLater()
|
||||
self.download_thread = None
|
||||
self.is_fetcher_thread_running = False
|
||||
|
||||
self.progress_label.setText(
|
||||
f"{status_message}: "
|
||||
f"{total_downloaded} {self._tr('files_downloaded_label', 'downloaded')}, "
|
||||
f"{total_skipped} {self._tr('files_skipped_label', 'skipped')}."
|
||||
)
|
||||
self.file_progress_label.setText("")
|
||||
|
||||
if not cancelled_by_user and self.retryable_failed_files_info:
|
||||
num_failed = len(self.retryable_failed_files_info)
|
||||
reply = QMessageBox.question(self, "Retry Failed Downloads?",
|
||||
f"{num_failed} file(s) failed with potentially recoverable errors (e.g., IncompleteRead).\n\n"
|
||||
"Would you like to attempt to download these failed files again?",
|
||||
QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
|
||||
if reply == QMessageBox.Yes:
|
||||
self._start_failed_files_retry_session()
|
||||
return
|
||||
else:
|
||||
self.log_signal.emit("ℹ️ User chose not to retry failed files.")
|
||||
self.permanently_failed_files_for_dialog.extend(self.retryable_failed_files_info)
|
||||
if self.permanently_failed_files_for_dialog:
|
||||
self.log_signal.emit(f"🆘 Error button enabled. {len(self.permanently_failed_files_for_dialog)} file(s) can be viewed.")
|
||||
self.cancellation_message_logged_this_session = False
|
||||
self.retryable_failed_files_info.clear()
|
||||
|
||||
self.is_fetcher_thread_running = False
|
||||
|
||||
self.set_ui_enabled(True)
|
||||
self._update_button_states_and_connections()
|
||||
self.cancellation_message_logged_this_session = False
|
||||
self.active_update_profile = None
|
||||
self.set_ui_enabled(True)
|
||||
self._update_button_states_and_connections()
|
||||
self.cancellation_message_logged_this_session = False
|
||||
self.active_update_profile = None
|
||||
finally:
|
||||
self.is_finishing = False
|
||||
|
||||
def _handle_keep_duplicates_toggled(self, checked):
|
||||
"""Shows the duplicate handling dialog when the checkbox is checked."""
|
||||
|
||||
Reference in New Issue
Block a user