A powerful, threaded manga downloader with both CLI and GUI interfaces for downloading manga from KunManga.com. Features include selective chapter download, PDF/CBZ conversion, and optional image cleanup.
- Features
- Prerequisites
- Installation
- Getting cf_clearance Cookie
- Usage
- CLI Version
- GUI Version
- Configuration
- Project Structure
- License
- Dual Interface: Interactive CLI and sleek GUI
- Flexible Chapter Selection: Download single chapters, ranges, or all chapters
- Multiple Formats: Convert to PDF or CBZ
- Threaded Downloads: Parallel chapter and image downloads for speed
- Cloudflare Bypass: Uses
cloudscraperto handle Cloudflare protection
- Python 3.7+
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/Yui007/kunmanga_downloader cd kunmanga-downloader -
Install the required packages:
pip install -r requirements.txt
Before using the downloader, you need to obtain the cf_clearance cookie from KunManga.com. This is required to bypass Cloudflare protection.
- Open Chrome and navigate to https://kunmanga.com
- Solve the CAPTCHA if presented
- Press
F12to open Developer Tools - Go to the "Application" tab
- In the left sidebar, expand "Cookies" and click on "https://kunmanga.com"
- Find the
cf_clearancecookie in the list - Copy its value and paste it into your
cookies.jsonfile:{ "cf_clearance": "YOUR_CF_CLEARANCE_VALUE_HERE" }
- Open Microsoft Edge and navigate to https://kunmanga.com
- Solve the CAPTCHA if presented
- Press
F12to open Developer Tools - Go to the "Application" tab
- In the left sidebar, expand "Cookies" and click on "https://kunmanga.com"
- Find the
cf_clearancecookie in the list - Copy its value and paste it into your
cookies.jsonfile
- Open Firefox and navigate to https://kunmanga.com
- Solve the CAPTCHA if presented
- Press
F12to open Developer Tools - Go to the "Storage" tab
- In the left sidebar, expand "Cookies" and click on "https://kunmanga.com"
- Find the
cf_clearancecookie in the list - Copy its value and paste it into your
cookies.jsonfile
- Open Brave and navigate to https://kunmanga.com
- Solve the CAPTCHA if presented
- Press
F12to open Developer Tools - Go to the "Application" tab
- In the left sidebar, expand "Cookies" and click on "https://kunmanga.com"
- Find the
cf_clearancecookie in the list - Copy its value and paste it into your
cookies.jsonfile
You can also use browser extensions to export cookies:
- Install a cookie manager extension (e.g., "Cookie-Editor" for Chrome/Edge/Firefox/Brave)
- Navigate to https://kunmanga.com and solve the CAPTCHA
- Open the cookie extension and find the
cf_clearancecookie - Export all cookies to a JSON file and save it as
cookies.jsonin the project directory
Run the CLI version with:
python main.pyFollow the interactive prompts to:
- Enter the manga URL
- Select chapters to download
- Choose conversion format (PDF/CBZ/None)
- Decide whether to delete images after conversion
Run the GUI version with:
python gui.pyThe GUI provides the same functionality as the CLI with a user-friendly interface:
- Enter the manga URL in the input field
- Click "Scrape Chapters" to fetch the chapter list
- Select chapters using the list and "Select All"/"Deselect All" buttons
- Choose conversion format and cleanup options
- Click "Download Selected Chapters" to start the download
Pro Tip: You can quickly select or deselect multiple chapters by holding down the left mouse button and drag your cursor up or down the chapter list to quickly select or deselect multiple chapters.
Adjust settings in config.py:
MAX_CHAPTER_THREADS: Maximum concurrent chapter downloads (default: 5)MAX_IMAGE_THREADS: Maximum concurrent image downloads per chapter (default: 10)DOWNLOAD_PATH: Directory for downloaded manga (default: './downloads/')DELETE_IMAGES_AFTER_CONVERSION: Delete original images after conversion (default: True)
kunmanga_downloader/
├── main.py # CLI entry point
├── gui.py # GUI interface
├── config.py # Configuration parameters
├── cookies.json # Cloudflare cookies
├── requirements.txt # Python dependencies
├── gui.PNG # GUI screenshot
└── downloader/
├── __init__.py
├── scraper.py # Manga/chapter scraping
├── download.py # Threaded image downloading
├── converter.py # PDF/CBZ conversion
└── utils.py # Helper functions
This project is licensed under the MIT License - see the LICENSE file for details.