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.
|
The above copyright notice and this permission notice shall be included in all
|
||||||
2. Proper credit must be given to the original author in any public use, distribution, or derivative works.
|
copies or substantial portions of the Software.
|
||||||
3. Commercial use, resale, or sublicensing of the Software or any derivative works is strictly prohibited without explicit written permission.
|
|
||||||
|
|
||||||
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
|
<div>
|
||||||
This guide provides a comprehensive overview of all user interface elements, input fields, buttons, popups, and functionalities available in the Kemono Downloader.
|
<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>
|
||||||
## 1. Main Interface & Workflow
|
<hr>
|
||||||
These are the primary controls you'll interact with to initiate and manage downloads.
|
<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>
|
||||||
### 1.1. Core Inputs
|
<h3><strong>Primary Inputs (Top-Left)</strong></h3>
|
||||||
**🔗 Creator/Post URL Input Field**
|
<ul>
|
||||||
- **Purpose**: Paste the URL of the content you want to download.
|
<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>
|
||||||
- **Supported Sites**: Kemono.su, Coomer.party, Simpcity.su.
|
<li><strong>🎨 Creator Selection Popup</strong>: This button opens a powerful dialog listing all known creators. From here, you can:
|
||||||
- **Supported URL Types**:
|
<ul>
|
||||||
- Creator pages (e.g., `https://kemono.su/patreon/user/12345`).
|
<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>
|
||||||
- Individual posts (e.g., `https://kemono.su/patreon/user/12345/post/98765`).
|
<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>
|
||||||
- **Note**: When ⭐ Favorite Mode is active, this field is disabled. For Simpcity.su URLs, the "Use Cookie" option is mandatory and auto-enabled.
|
</ul>
|
||||||
|
</li>
|
||||||
**🎨 Creator Selection Button**
|
<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>
|
||||||
- **Icon**: 🎨 (Artist Palette)
|
<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>
|
||||||
- **Purpose**: Opens the "Creator Selection" dialog to browse and queue downloads from known creators.
|
</ul>
|
||||||
- **Dialog Features**:
|
<hr>
|
||||||
- Loads creators from `creators.json`.
|
<h2><strong>Filtering & Naming (Left Panel)</strong></h2>
|
||||||
- **Search Bar**: Filter creators by name.
|
<p>These features give you precise control over what gets downloaded and how it's named and organized.</p>
|
||||||
- **Creator List**: Displays creators with their service (e.g., Patreon, Fanbox).
|
<ul>
|
||||||
- **Selection**: Checkboxes to select one or more creators.
|
<li><strong>Filter by Character(s)</strong>: A powerful tool to download content featuring specific characters. You can enter multiple names separated by commas.
|
||||||
- **Download Scope**: Organize downloads by Characters or Creators.
|
<ul>
|
||||||
- **Add to Queue**: Adds selected creators or their posts to the download queue.
|
<li><strong>Filter: [Scope] Button</strong>: This button changes how the character filter works:
|
||||||
|
<ul>
|
||||||
**Page Range (Start to End) Input Fields**
|
<li><strong>Title</strong>: Downloads posts only if a character's name is in the post title.</li>
|
||||||
- **Purpose**: Specify a range of pages to fetch for creator URLs.
|
<li><strong>Files</strong>: Downloads posts if a character's name is in any of the filenames within the post.</li>
|
||||||
- **Usage**: Enter the starting and ending page numbers.
|
<li><strong>Both</strong>: Combines the "Title" and "Files" logic.</li>
|
||||||
- **Behavior**:
|
<li><strong>Comments (Beta)</strong>: Downloads a post if a character's name is mentioned in the comments section.</li>
|
||||||
- If blank, all pages are processed.
|
</ul>
|
||||||
- Disabled for single post URLs.
|
</li>
|
||||||
|
</ul>
|
||||||
**📁 Download Location Input Field & Browse Button**
|
</li>
|
||||||
- **Purpose**: Specify the main directory for downloaded files.
|
<li><strong>Skip with Words</strong>: A keyword-based filter to avoid unwanted content (e.g., <code>WIP</code>, <code>sketch</code>).
|
||||||
- **Usage**: Type the path or click "Browse..." to select a folder.
|
<ul>
|
||||||
- **Requirement**: Mandatory for all download operations.
|
<li><strong>Scope: [Type] Button</strong>: This button changes how the skip filter works:
|
||||||
|
<ul>
|
||||||
### 1.2. Action Buttons
|
<li><strong>Posts</strong>: Skips the entire post if a keyword is found in the title.</li>
|
||||||
**⬇️ Start Download / 🔗 Extract Links Button**
|
<li><strong>Files</strong>: Skips only individual files if a keyword is found in the filename.</li>
|
||||||
- **Purpose**: Initiates downloading or link extraction.
|
<li><strong>Both</strong>: Applies both levels of skipping.</li>
|
||||||
- **Behavior**:
|
</ul>
|
||||||
- Shows "🔗 Extract Links" if "Only Links" is selected.
|
</li>
|
||||||
- Otherwise, shows "⬇️ Start Download".
|
</ul>
|
||||||
- Supports single-threaded or multi-threaded downloads based on settings.
|
</li>
|
||||||
|
<li><strong>Remove Words from name</strong>: Automatically cleans downloaded filenames by removing any specified words (e.g., "patreon," "HD").</li>
|
||||||
**🔄 Restore Download Button**
|
</ul>
|
||||||
- **Visibility**: Appears if an incomplete session is detected on startup.
|
<h3><strong>File Type Filter (Radio Buttons)</strong></h3>
|
||||||
- **Purpose**: Resumes a previously interrupted download session.
|
<p>This section lets you choose the kind of content you want:</p>
|
||||||
|
<ul>
|
||||||
**⏸️ Pause / ▶️ Resume Download Button**
|
<li><strong>All, Images/GIFs, Videos, 🎧 Only Audio, 📦 Only Archives</strong>: These options filter the downloads to only include the selected file types.</li>
|
||||||
- **Purpose**: Pause or resume the ongoing download.
|
<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>
|
||||||
- **Behavior**: Toggles between "Pause" and "Resume". Some UI settings can be changed while paused.
|
<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>
|
||||||
**❌ Cancel & Reset UI Button**
|
<hr>
|
||||||
- **Purpose**: Stops the current operation and performs a "soft" reset.
|
<h2><strong>Download Options & Advanced Settings (Checkboxes)</strong></h2>
|
||||||
- **Behavior**: Halts background threads, preserves URL and Download Location inputs, resets other settings.
|
<ul>
|
||||||
|
<li><strong>Skip .zip</strong>: A simple toggle to ignore archive files during downloads.</li>
|
||||||
**🔄 Reset Button (in the log area)**
|
<li><strong>Download Thumbnails Only</strong>: Downloads only the small preview images instead of the full-resolution files.</li>
|
||||||
- **Purpose**: Performs a "hard" reset when no operation is active.
|
<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>
|
||||||
- **Behavior**: Clears all inputs, resets options to default, and clears logs.
|
<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>
|
||||||
## 2. Filtering & Content Selection
|
<li><strong>Subfolder per Post</strong>: Organizes downloads by creating a unique folder for each post, named after the post's title.</li>
|
||||||
These options allow precise control over downloaded content.
|
<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>
|
||||||
### 2.1. Content Filtering
|
<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>
|
||||||
**🎯 Filter by Character(s) Input Field**
|
<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>
|
||||||
- **Purpose**: Download content related to specific characters or series.
|
<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>
|
||||||
- **Usage**: Enter comma-separated character names.
|
</ul>
|
||||||
- **Advanced Syntax**:
|
<hr>
|
||||||
- `Nami`: Simple filter.
|
<h2><strong>Known Names Management (Bottom-Left)</strong></h2>
|
||||||
- `(Vivi, Ulti)`: Grouped filter. Matches posts with "Vivi" OR "Ulti". Creates a shared folder like `Vivi Ulti` if subfolders are enabled.
|
<p>This powerful feature automates the creation of organized, named folders.</p>
|
||||||
- `(Boa, Hancock)~`: Aliased filter. Treats "Boa" and "Hancock" as the same entity.
|
<ul>
|
||||||
|
<li><strong>Known Shows/Characters List</strong>: Displays all the names and groups you've saved.</li>
|
||||||
**Filter: [Type] Button (Character Filter Scope)**
|
<li><strong>Search...</strong>: Filters the list to quickly find a name.</li>
|
||||||
- **Purpose**: Defines where the character filter is applied. Cycles on click.
|
<li><strong>Open Known.txt</strong>: Opens the source file in a text editor for advanced manual editing.</li>
|
||||||
- **Options**:
|
<li><strong>Add New Name</strong>:
|
||||||
- **Filter: Title** (Default): Matches post titles.
|
<ul>
|
||||||
- **Filter: Files**: Matches filenames.
|
<li><strong>Single Name</strong>: Typing <code>Tifa Lockhart</code> and clicking <strong>➕ Add</strong> creates an entry that will match "Tifa Lockhart".</li>
|
||||||
- **Filter: Both**: Checks title first, then filenames.
|
<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>
|
||||||
- **Filter: Comments (Beta)**: Checks filenames, then post comments.
|
</ul>
|
||||||
|
</li>
|
||||||
**🚫 Skip with Words Input Field**
|
<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>
|
||||||
- **Purpose**: Exclude posts/files with specified keywords (e.g., `WIP`, `sketch`).
|
<li><strong>🗑️ Delete Selected</strong>: Removes highlighted names from your list.</li>
|
||||||
|
</ul>
|
||||||
**Scope: [Type] Button (Skip Words Scope)**
|
<hr>
|
||||||
- **Purpose**: Defines where skip words are applied. Cycles on click.
|
<h2><strong>Action Buttons & Status Controls</strong></h2>
|
||||||
- **Options**:
|
<ul>
|
||||||
- **Scope: Posts** (Default): Skips posts if the title contains a skip word.
|
<li><strong>⬇️ Start Download / 🔗 Extract Links</strong>: The main action button. Its function is dynamic:
|
||||||
- **Scope: Files**: Skips files if the filename contains a skip word.
|
<ul>
|
||||||
- **Scope: Both**: Applies both rules.
|
<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>
|
||||||
**✂️ Remove Words from Name Input Field**
|
<li><strong>Update Confirmation</strong>: After new posts are found, it changes to <strong>⬇️ Start Download (X new)</strong>.</li>
|
||||||
- **Purpose**: Remove unwanted text from filenames (e.g., `patreon`, `[HD]`).
|
<li><strong>Link Extraction Mode</strong>: The text changes to <strong>🔗 Extract Links</strong>.</li>
|
||||||
|
</ul>
|
||||||
### 2.2. File Type Filtering
|
</li>
|
||||||
**Filter Files (Radio Buttons)**
|
<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>
|
||||||
- **Purpose**: Select file types to download.
|
<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>
|
||||||
- **Options**:
|
<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:
|
||||||
- **All**: All file types.
|
<ul>
|
||||||
- **Images/GIFs**: Common image formats.
|
<li>Select specific files to <strong>Retry</strong> downloading.</li>
|
||||||
- **Videos**: Common video formats.
|
<li><strong>Export</strong> the list of failed URLs to a <code>.txt</code> file.</li>
|
||||||
- **🎧 Only Audio**: Common audio formats.
|
</ul>
|
||||||
- **📦 Only Archives**: Only `.zip` and `.rar` files.
|
</li>
|
||||||
- **🔗 Only Links**: Extracts external links without downloading files.
|
<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>
|
||||||
**Skip .zip / Skip .rar Checkboxes**
|
<li><strong>📜 (History)</strong>: Opens the Download History dialog.</li>
|
||||||
- **Purpose**: Skip downloading `.zip` or `.rar` files.
|
<li><strong>? (Help)</strong>: Opens a helpful guide explaining the application's features.</li>
|
||||||
- **Behavior**: Disabled when "📦 Only Archives" is active.
|
<li><strong>❤️ Support</strong>: Opens a dialog with information on how to support the developer.</li>
|
||||||
|
</ul>
|
||||||
## 3. Download Customization
|
<hr>
|
||||||
Options to refine the download process and output.
|
<h2><strong>Specialized Modes & Features</strong></h2>
|
||||||
|
<h3><strong>⭐ Favorite Mode</strong></h3>
|
||||||
- **Download Thumbnails Only**: Downloads small preview images instead of full-resolution files.
|
<p>Activating this mode transforms the UI for managing saved collections:</p>
|
||||||
- **Scan Content for Images**: Scans post HTML for `<img>` tags, crucial for images in descriptions.
|
<ul>
|
||||||
- **Compress to WebP**: Converts images to WebP format (requires Pillow library).
|
<li>The URL input is disabled.</li>
|
||||||
- **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`).
|
<li>The main action buttons are replaced with:
|
||||||
- **🗄️ Custom Folder Name (Single Post Only)**: Specify a custom folder name for a single post's content (appears if subfolders are enabled).
|
<ul>
|
||||||
|
<li><strong>🖼️ Favorite Artists</strong>: Opens a dialog to browse and queue downloads from your saved favorite creators.</li>
|
||||||
## 4. 📖 Manga/Comic Mode
|
<li><strong>📄 Favorite Posts</strong>: Opens a dialog to browse and queue downloads for specific saved favorite posts.</li>
|
||||||
A mode for downloading creator feeds in chronological order, ideal for sequential content.
|
</ul>
|
||||||
|
</li>
|
||||||
- **Activation**: Active when downloading a creator's entire feed (not a single post).
|
<li><strong>Scope: [Location] Button</strong>: Toggles where the favorited content is saved:
|
||||||
- **Core Behavior**: Fetches all posts, processing from oldest to newest.
|
<ul>
|
||||||
- **Filename Style Toggle Button (in the log area)**:
|
<li><strong>Selected Location</strong>: Saves all content directly into the main "Download Location".</li>
|
||||||
- **Purpose**: Controls file naming in Manga Mode. Cycles on click.
|
<li><strong>Artist Folders</strong>: Creates a subfolder for each artist inside the main "Download Location".</li>
|
||||||
- **Options**:
|
</ul>
|
||||||
- **Name: Post Title**: First file named after post title; others keep original names.
|
</li>
|
||||||
- **Name: Original File**: Files keep server-provided names, with optional prefix.
|
</ul>
|
||||||
- **Name: Title+G.Num**: Global numbering with post title prefix (e.g., `Chapter 1_001.jpg`).
|
<h3><strong>📖 Manga/Comic Mode</strong></h3>
|
||||||
- **Name: Date Based**: Sequential naming by post date (e.g., `001.jpg`), with optional prefix.
|
<p>This mode is designed for sequential content and has several effects:</p>
|
||||||
- **Name: Post ID**: Files named after post ID to avoid clashes.
|
<ul>
|
||||||
- **Name: Date + Title**: Combines post date and title for filenames.
|
<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>
|
||||||
## 5. Folder Organization & Known.txt
|
<li><strong>Disables Multithreading (for certain styles)</strong>: To guarantee perfect sequential numbering, multithreading for posts is automatically disabled for certain naming styles.</li>
|
||||||
Controls for structuring downloaded content.
|
</ul>
|
||||||
|
<h3><strong>Session & Error Management</strong></h3>
|
||||||
- **Separate Folders by Name/Title Checkbox**: Enables automatic subfolder creation.
|
<ul>
|
||||||
- **Subfolder per Post Checkbox**: Creates subfolders for each post, named after the post title.
|
<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>
|
||||||
- **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.
|
<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>
|
||||||
- **Known.txt Management UI (Bottom Left)**:
|
</ul>
|
||||||
- **Purpose**: Manages a local `Known.txt` file for series, characters, or terms used in folder creation.
|
<h3><strong>Logging & Monitoring</strong></h3>
|
||||||
- **List Display**: Shows primary names from `Known.txt`.
|
<ul>
|
||||||
- **➕ Add Button**: Adds names or groups (e.g., `(Character A, Alias B)~`).
|
<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>
|
||||||
- **⤵️ Add to Filter Button**: Select names from `Known.txt` for the character filter.
|
<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>
|
||||||
- **🗑️ Delete Selected Button**: Removes selected names from `Known.txt`.
|
</ul>
|
||||||
- **Open Known.txt Button**: Opens the file in the default text editor.
|
</div>
|
||||||
- **❓ 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).
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class DownloadManager:
|
|||||||
if self.thread_pool:
|
if self.thread_pool:
|
||||||
self.thread_pool.shutdown(wait=True)
|
self.thread_pool.shutdown(wait=True)
|
||||||
self.is_running = False
|
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({
|
self.progress_queue.put({
|
||||||
'type': 'finished',
|
'type': 'finished',
|
||||||
'payload': (self.total_downloads, self.total_skips, self.cancellation_event.is_set(), self.all_kept_original_filenames)
|
'payload': (self.total_downloads, self.total_skips, self.cancellation_event.is_set(), self.all_kept_original_filenames)
|
||||||
|
|||||||
@@ -594,6 +594,33 @@ class PostProcessorWorker:
|
|||||||
except OSError: pass
|
except OSError: pass
|
||||||
return 0, 1, filename_to_save_in_main_path, was_original_name_kept_flag, FILE_DOWNLOAD_STATUS_SKIPPED, None
|
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
|
effective_save_folder = target_folder_path
|
||||||
base_name, extension = os.path.splitext(filename_to_save_in_main_path)
|
base_name, extension = os.path.splitext(filename_to_save_in_main_path)
|
||||||
counter = 1
|
counter = 1
|
||||||
@@ -610,15 +637,17 @@ class PostProcessorWorker:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if data_to_write_io:
|
if data_to_write_io:
|
||||||
|
# Write the compressed data from the in-memory buffer
|
||||||
with open(final_save_path, 'wb') as f_out:
|
with open(final_save_path, 'wb') as f_out:
|
||||||
time.sleep(0.05)
|
|
||||||
f_out.write(data_to_write_io.getvalue())
|
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):
|
if downloaded_part_file_path and os.path.exists(downloaded_part_file_path):
|
||||||
try:
|
try:
|
||||||
os.remove(downloaded_part_file_path)
|
os.remove(downloaded_part_file_path)
|
||||||
except OSError as e_rem:
|
except OSError as e_rem:
|
||||||
self.logger(f" -> Failed to remove .part after compression: {e_rem}")
|
self.logger(f" -> Failed to remove .part after compression: {e_rem}")
|
||||||
else:
|
else:
|
||||||
|
# No compression was done, just rename the original file
|
||||||
if downloaded_part_file_path and os.path.exists(downloaded_part_file_path):
|
if downloaded_part_file_path and os.path.exists(downloaded_part_file_path):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
os.rename(downloaded_part_file_path, final_save_path)
|
os.rename(downloaded_part_file_path, final_save_path)
|
||||||
@@ -691,7 +720,6 @@ class PostProcessorWorker:
|
|||||||
else:
|
else:
|
||||||
return 0, 1, filename_to_save_in_main_path, was_original_name_kept_flag, FILE_DOWNLOAD_STATUS_FAILED_RETRYABLE_LATER, details_for_failure
|
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):
|
def process(self):
|
||||||
|
|
||||||
result_tuple = (0, 0, [], [], [], None, None)
|
result_tuple = (0, 0, [], [], [], None, None)
|
||||||
@@ -859,17 +887,6 @@ class PostProcessorWorker:
|
|||||||
result_tuple = (0, num_potential_files_in_post, [], [], [], None, None)
|
result_tuple = (0, num_potential_files_in_post, [], [], [], None, None)
|
||||||
return result_tuple
|
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:
|
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.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)")
|
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.")
|
self.logger(f"⚠️ Corrupt attachment data for post {post_id} (expected list, got {type(post_attachments)}). Skipping attachments.")
|
||||||
post_attachments = []
|
post_attachments = []
|
||||||
|
|
||||||
|
# CORRECTED LOGIC: Determine folder path BEFORE skip checks
|
||||||
base_folder_names_for_post_content = []
|
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
|
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:
|
if not self.extract_links_only and self.use_subfolders:
|
||||||
@@ -1028,6 +1046,28 @@ class PostProcessorWorker:
|
|||||||
break
|
break
|
||||||
determined_post_save_path_for_history = os.path.join(base_path_for_post_subfolder, final_post_subfolder_name)
|
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:
|
if self.filter_mode == 'text_only' and not self.extract_links_only:
|
||||||
self.logger(f" Mode: Text Only (Scope: {self.text_only_scope})")
|
self.logger(f" Mode: Text Only (Scope: {self.text_only_scope})")
|
||||||
post_title_lower = post_title.lower()
|
post_title_lower = post_title.lower()
|
||||||
|
|||||||
@@ -969,6 +969,9 @@ class EmptyPopupDialog (QDialog ):
|
|||||||
self .parent_app .link_input .setPlaceholderText (
|
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 .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 ()
|
self .accept ()
|
||||||
else :
|
else :
|
||||||
QMessageBox .information (self ,self ._tr ("no_selection_title","No Selection"),
|
QMessageBox .information (self ,self ._tr ("no_selection_title","No Selection"),
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ from PyQt5.QtWidgets import (
|
|||||||
QScrollArea, QListWidgetItem, QSizePolicy, QProgressBar, QAbstractItemView, QFrame,
|
QScrollArea, QListWidgetItem, QSizePolicy, QProgressBar, QAbstractItemView, QFrame,
|
||||||
QMainWindow, QAction, QGridLayout,
|
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 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 ..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
|
from ..core.workers import DownloadThread as BackendDownloadThread
|
||||||
@@ -228,6 +233,7 @@ class DownloaderApp (QWidget ):
|
|||||||
self.downloaded_hash_counts = defaultdict(int)
|
self.downloaded_hash_counts = defaultdict(int)
|
||||||
self.downloaded_hash_counts_lock = threading.Lock()
|
self.downloaded_hash_counts_lock = threading.Lock()
|
||||||
self.session_temp_files = []
|
self.session_temp_files = []
|
||||||
|
self.single_pdf_mode = False
|
||||||
self.save_creator_json_enabled_this_session = True
|
self.save_creator_json_enabled_this_session = True
|
||||||
|
|
||||||
print(f"ℹ️ Known.txt will be loaded/saved at: {self.config_file}")
|
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):
|
def _check_if_all_work_is_done(self):
|
||||||
"""
|
"""
|
||||||
Checks if the fetcher thread is done AND if all submitted tasks have been processed.
|
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.
|
If so, finalizes the download. This is the central point for completion logic.
|
||||||
"""
|
"""
|
||||||
fetcher_is_done = not self.is_fetcher_thread_running
|
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:
|
if fetcher_is_done and (all_workers_are_done or is_cancelled):
|
||||||
self.log_signal.emit("🏁 All fetcher and worker tasks complete.")
|
if not self.is_finishing:
|
||||||
self.finished_signal.emit(self.download_counter, self.skip_counter, self.cancellation_event.is_set(), self.all_kept_original_filenames)
|
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 ):
|
def _sync_queue_with_link_input (self ,current_text ):
|
||||||
"""
|
"""
|
||||||
@@ -4155,49 +4167,34 @@ class DownloaderApp (QWidget ):
|
|||||||
self ._update_log_display_mode_button_text ()
|
self ._update_log_display_mode_button_text ()
|
||||||
self ._filter_links_log ()
|
self ._filter_links_log ()
|
||||||
|
|
||||||
def cancel_download_button_action (self ):
|
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
|
Signals all active download processes to cancel but DOES NOT reset the UI.
|
||||||
self .log_signal .emit ("⚠️ Requesting cancellation of download process (soft reset)...")
|
The UI reset is now handled by the 'download_finished' method.
|
||||||
self._cleanup_temp_files()
|
"""
|
||||||
self._clear_session_file() # Clear session file on explicit cancel
|
if self.cancellation_event.is_set():
|
||||||
if self .external_link_download_thread and self .external_link_download_thread .isRunning ():
|
self.log_signal.emit("ℹ️ Cancellation is already in progress.")
|
||||||
self .log_signal .emit (" Cancelling active External Link download thread...")
|
return
|
||||||
self .external_link_download_thread .cancel ()
|
|
||||||
|
|
||||||
current_url =self .link_input .text ()
|
self.log_signal.emit("⚠️ Requesting cancellation of download process...")
|
||||||
current_dir =self .dir_input .text ()
|
self.cancellation_event.set()
|
||||||
|
|
||||||
self .cancellation_event .set ()
|
# Update UI to "Cancelling" state
|
||||||
self .is_fetcher_thread_running =False
|
self.pause_btn.setEnabled(False)
|
||||||
if self .download_thread and self .download_thread .isRunning ():self .download_thread .requestInterruption ();self .log_signal .emit (" Signaled single download thread to interrupt.")
|
self.cancel_btn.setEnabled(False)
|
||||||
if self .thread_pool :
|
self.progress_label.setText(self._tr("status_cancelling", "Cancelling... Please wait."))
|
||||||
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 =[]
|
|
||||||
|
|
||||||
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 )
|
if self.thread_pool:
|
||||||
|
self.log_signal.emit(" Signaling worker pool to cancel futures...")
|
||||||
|
|
||||||
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.')}")
|
if self.external_link_download_thread and self.external_link_download_thread.isRunning():
|
||||||
self .file_progress_label .setText ("")
|
self.log_signal.emit(" Cancelling active External Link download thread...")
|
||||||
if self .pause_event :self .pause_event .clear ()
|
self.external_link_download_thread.cancel()
|
||||||
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
|
|
||||||
|
|
||||||
def _get_domain_for_service (self ,service_name :str )->str :
|
def _get_domain_for_service (self ,service_name :str )->str :
|
||||||
"""Determines the base domain for a given service."""
|
"""Determines the base domain for a given service."""
|
||||||
@@ -4215,119 +4212,129 @@ class DownloaderApp (QWidget ):
|
|||||||
return
|
return
|
||||||
self.is_finishing = True
|
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("🏁 Download of current item complete.")
|
||||||
self.log_signal.emit("✅ Item finished. Processing next in queue...")
|
|
||||||
self._process_next_favorite_download()
|
|
||||||
return
|
|
||||||
|
|
||||||
if self.is_processing_favorites_queue:
|
if self.is_processing_favorites_queue and self.favorite_download_queue:
|
||||||
self.is_processing_favorites_queue = False
|
self.log_signal.emit("✅ Item finished. Processing next in queue...")
|
||||||
self.log_signal.emit("✅ All items from the download queue have been processed.")
|
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:
|
if self.is_processing_favorites_queue:
|
||||||
self._clear_session_file()
|
self.is_processing_favorites_queue = False
|
||||||
self.interrupted_session_data = None
|
self.log_signal.emit("✅ All items from the download queue have been processed.")
|
||||||
self.is_restore_pending = False
|
|
||||||
|
|
||||||
self._finalize_download_history()
|
if not cancelled_by_user and not self.retryable_failed_files_info:
|
||||||
status_message = self._tr("status_cancelled_by_user", "Cancelled by user") if cancelled_by_user else self._tr("status_completed", "Completed")
|
self._clear_session_file()
|
||||||
if cancelled_by_user and self.retryable_failed_files_info:
|
self.interrupted_session_data = None
|
||||||
self.log_signal.emit(f" Download cancelled, discarding {len(self.retryable_failed_files_info)} file(s) that were pending retry.")
|
self.is_restore_pending = False
|
||||||
self.retryable_failed_files_info.clear()
|
|
||||||
|
|
||||||
summary_log = "=" * 40
|
self._finalize_download_history()
|
||||||
summary_log += f"\n🏁 Download {status_message}!\n Summary: Downloaded Files={total_downloaded}, Skipped Files={total_skipped}\n"
|
status_message = self._tr("status_completed", "Completed")
|
||||||
summary_log += "=" * 40
|
|
||||||
self.log_signal.emit(summary_log)
|
|
||||||
self.log_signal.emit("")
|
|
||||||
|
|
||||||
if self.thread_pool:
|
summary_log = "=" * 40
|
||||||
self.log_signal.emit(" Shutting down worker thread pool...")
|
summary_log += f"\n🏁 Download {status_message}!\n Summary: Downloaded Files={total_downloaded}, Skipped Files={total_skipped}\n"
|
||||||
self.thread_pool.shutdown(wait=False)
|
summary_log += "=" * 40
|
||||||
self.thread_pool = None
|
self.log_signal.emit(summary_log)
|
||||||
self.log_signal.emit(" Thread pool shut down.")
|
self.log_signal.emit("")
|
||||||
|
|
||||||
if self.single_pdf_setting and self.session_temp_files and not cancelled_by_user:
|
if self.thread_pool:
|
||||||
try:
|
self.thread_pool.shutdown(wait=False)
|
||||||
self._trigger_single_pdf_creation()
|
self.thread_pool = None
|
||||||
finally:
|
|
||||||
|
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._cleanup_temp_files()
|
||||||
self.single_pdf_setting = False
|
self.single_pdf_setting = False
|
||||||
else:
|
|
||||||
self._cleanup_temp_files()
|
|
||||||
self.single_pdf_setting = False
|
|
||||||
|
|
||||||
if kept_original_names_list is None:
|
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 []
|
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:
|
if kept_original_names_list is None:
|
||||||
kept_original_names_list = []
|
kept_original_names_list = []
|
||||||
|
|
||||||
if kept_original_names_list:
|
if kept_original_names_list:
|
||||||
intro_msg = (
|
intro_msg = (
|
||||||
HTML_PREFIX +
|
HTML_PREFIX +
|
||||||
"<p>ℹ️ The following files from multi-file manga posts "
|
"<p>ℹ️ The following files from multi-file manga posts "
|
||||||
"(after the first file) kept their <b>original names</b>:</p>"
|
"(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)
|
self.file_progress_label.setText("")
|
||||||
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:
|
if not cancelled_by_user and self.retryable_failed_files_info:
|
||||||
try:
|
num_failed = len(self.retryable_failed_files_info)
|
||||||
if hasattr(self.download_thread, 'progress_signal'): self.download_thread.progress_signal.disconnect(self.handle_main_log)
|
reply = QMessageBox.question(self, "Retry Failed Downloads?",
|
||||||
if hasattr(self.download_thread, 'add_character_prompt_signal'): self.download_thread.add_character_prompt_signal.disconnect(self.add_character_prompt_signal)
|
f"{num_failed} file(s) failed with potentially recoverable errors (e.g., IncompleteRead).\n\n"
|
||||||
if hasattr(self.download_thread, 'finished_signal'): self.download_thread.finished_signal.disconnect(self.download_finished)
|
"Would you like to attempt to download these failed files again?",
|
||||||
if hasattr(self.download_thread, 'receive_add_character_result'): self.character_prompt_response_signal.disconnect(self.download_thread.receive_add_character_result)
|
QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
|
||||||
if hasattr(self.download_thread, 'external_link_signal'): self.download_thread.external_link_signal.disconnect(self.handle_external_link_signal)
|
if reply == QMessageBox.Yes:
|
||||||
if hasattr(self.download_thread, 'file_progress_signal'): self.download_thread.file_progress_signal.disconnect(self.update_file_progress_display)
|
self.is_finishing = False # Allow retry session to start
|
||||||
if hasattr(self.download_thread, 'missed_character_post_signal'): self.download_thread.missed_character_post_signal.disconnect(self.handle_missed_character_post)
|
self._start_failed_files_retry_session()
|
||||||
if hasattr(self.download_thread, 'retryable_file_failed_signal'): self.download_thread.retryable_file_failed_signal.disconnect(self._handle_retryable_file_failure)
|
return # Exit to allow retry session to run
|
||||||
if hasattr(self.download_thread, 'file_successfully_downloaded_signal'): self.download_thread.file_successfully_downloaded_signal.disconnect(self._handle_actual_file_downloaded)
|
else:
|
||||||
if hasattr(self.download_thread, 'post_processed_for_history_signal'): self.download_thread.post_processed_for_history_signal.disconnect(self._add_to_history_candidates)
|
self.log_signal.emit("ℹ️ User chose not to retry failed files.")
|
||||||
except (TypeError, RuntimeError) as e:
|
self.permanently_failed_files_for_dialog.extend(self.retryable_failed_files_info)
|
||||||
self.log_signal.emit(f"ℹ️ Note during single-thread signal disconnection: {e}")
|
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():
|
self.is_fetcher_thread_running = False
|
||||||
if self.download_thread:
|
|
||||||
self.download_thread.deleteLater()
|
|
||||||
self.download_thread = None
|
|
||||||
|
|
||||||
self.progress_label.setText(
|
self.set_ui_enabled(True)
|
||||||
f"{status_message}: "
|
self._update_button_states_and_connections()
|
||||||
f"{total_downloaded} {self._tr('files_downloaded_label', 'downloaded')}, "
|
self.cancellation_message_logged_this_session = False
|
||||||
f"{total_skipped} {self._tr('files_skipped_label', 'skipped')}."
|
self.active_update_profile = None
|
||||||
)
|
finally:
|
||||||
self.file_progress_label.setText("")
|
self.is_finishing = False
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
def _handle_keep_duplicates_toggled(self, checked):
|
def _handle_keep_duplicates_toggled(self, checked):
|
||||||
"""Shows the duplicate handling dialog when the checkbox is checked."""
|
"""Shows the duplicate handling dialog when the checkbox is checked."""
|
||||||
|
|||||||
Reference in New Issue
Block a user