A Python tool to download manga from MangaDex and create CBR/CBZ archives with proper volume/chapter organization.
- Download manga volumes and chapters from MangaDex
- Beautiful web interface with real-time progress tracking
- Support for proxy usage with automatic IP rotation
- Concurrent image downloads with configurable batch size
- Progress tracking with colored output
- Creates properly organized CBR/CBZ archives
- Maintains correct ordering of volumes, chapters, and pages
- Kawaii-styled interface with cute notifications
- Docker support for easy deployment
The main download interface with real-time progress tracking
Manage your downloaded manga with cute notifications
- Docker
- Docker Compose
- Clone the repository:
git clone https://github.com/WasamiKirua/mangadex-hydra
cd mangadex-hydra- Build and start the containers:
docker-compose up --build- Access the web interface at
http://localhost:5001
# Start the application
docker-compose up -d
# Stop the application
docker-compose down
# Rebuild after changes
docker-compose up --build
# View logs
docker-compose logs -fThe default configuration includes:
- Hot-reloading for Python files
- Volume mounts for real-time code changes
- Debug mode enabled
- Persistent manga storage
volumes:
- ./app.py:/app/app.py
- ./functions.py:/app/functions.py
- ./main.py:/app/main.py
- ./templates:/app/templates
- ./data:/app/data # Persistent manga storageConfigure these in docker-compose.yml:
environment:
- FLASK_APP=app.py
- FLASK_ENV=development
- FLASK_DEBUG=1
- WITH_PROXY=no
- BATCH_SIZE=5Downloaded manga are stored in the ./data directory on your host machine:
data/
├── manga_name/
│ ├── json/ # API response data
│ ├── volumes/ # Downloaded images
│ ├── cover_art.jpg # Manga cover
│ └── manga_name.cbz/cbr # Final archive
-
Permission Issues
# Fix data directory permissions chmod -R 755 data/ -
Container Won't Start
# Check logs docker-compose logs # Rebuild from scratch docker-compose down docker-compose build --no-cache docker-compose up
-
Changes Not Reflecting
# Restart with build docker-compose down docker-compose up --build -
Clean Start
# Remove all related containers and volumes docker-compose down -v docker-compose up --build
If you prefer not to use Docker, you can install directly:
- Create a virtual environment and install dependencies using uv:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txtCreate a .env file in the project root with the following settings:
# Proxy settings (optional)
DATA_IMPULSE_LOGIN=your_login
DATA_IMPULSE_PASSWD=your_password
WITH_PROXY=yes # or 'no' to disable proxy
DOCKER=no # Set to 'yes' only if you use the docker web app
# Download settings
BATCH_SIZE=5 # Number of concurrent image downloads- Run the script:
python main.py- Input the MangaDex manga URL when prompted, or modify the URL variable in main.py
- The script will:
- Create necessary directories
- Download cover art
- Download volume and chapter information
- Download all images with progress tracking
- Create a CBR/CBZ archive (user's choice)
data/
├── manga_name/
│ ├── json/ # API response data
│ ├── volumes/ # Downloaded images
│ ├── cover_art.jpg # Manga cover
│ └── manga_name.cbz # Final archive
The generated CBR/CBZ will have the following structure:
manga_name.cbz/cbr
├── manga_name/
│ ├── cover.jpg
│ ├── Volume_01/
│ │ ├── Chapter_001/
│ │ │ ├── 001.png
│ │ │ ├── 002.png
│ │ │ └── ...
│ │ └── Chapter_002/
│ └── Volume_02/
- requests: HTTP requests
- aiohttp: Async HTTP client
- colorama: Colored terminal output
- python-dotenv: Environment variable management
- tqdm: Progress bars
- patool: CBR archive creation
- zipfile: CBZ archive creation
- Retries for failed downloads
- Proxy rotation timing
- Comprehensive error messages
- Cleanup of temporary files
- Only works with MangaDex URLs
- Requires proper volume/chapter structure on MangaDex
- CBR creation requires
patooland appropriate archive tool (rar, 7z, etc.)
Feel free to submit issues and enhancement requests.
[Your chosen license]
-
Proxy Connection Errors
Error: NO_HOST_CONNECTION- Verify your proxy credentials in
.env - Check if proxy service is active
- Try disabling proxy by setting
WITH_PROXY=no - Wait a few minutes as proxy IPs might be rate limited
- Verify your proxy credentials in
-
Rate Limiting
Error: 429 Too Many Requests- Increase delay between requests in
.env - Ensure proxy rotation is working
- Try reducing
BATCH_SIZE
- Increase delay between requests in
-
Archive Creation Fails
Error creating CBR archive- For CBR: Ensure you have
raror7zinstalled on your system - For CBZ: Check disk space and write permissions
- Try using CBZ format instead of CBR
- For CBR: Ensure you have
-
Missing Images
Warning: Failed to copy image- Check network connection
- Verify MangaDex is accessible
- Try downloading the chapter again
- Check if images exist on MangaDex
-
Memory Issues
MemoryError or system becomes slow- Reduce
BATCH_SIZEin.env - Close other memory-intensive applications
- Try downloading one volume at a time
- Reduce
-
UV Package Manager
Command 'uv' not foundcurl -LsSf https://astral.sh/uv/install.sh | sh -
Missing Dependencies
ModuleNotFoundError: No module named 'package_name'uv pip install -r requirements.txt
-
CBR Creation Tools
- Ubuntu/Debian:
sudo apt-get install rar unrar
- macOS:
brew install rar
- Windows:
- Install WinRAR or 7-Zip
- Ubuntu/Debian:
-
Verify .env Configuration
cat .env
Should show:
DATA_IMPULSE_LOGIN=xxxxx DATA_IMPULSE_PASSWD=xxxxx WITH_PROXY=yes BATCH_SIZE=5 -
Check Permissions
# Linux/macOS chmod +x main.py chmod -R 755 data/
Add to .env for detailed logging:
DEBUG=yes-
Interrupted Downloads
- The script will create new directories only if they don't exist
- Already downloaded images won't be downloaded again
- You can safely restart the script
-
Corrupt Archives
- Delete the failed archive
- Remove the
tempdirectory if it exists - Run
make_cbr_cbz(manga_name)again
-
Network Issues
- The script includes retry logic
- Failed downloads are logged
- Check
data/{manga_name}/jsonfor missing chapters
- Check the logs for specific error messages
- Verify your internet connection
- Ensure MangaDex is accessible from your location
- Try with and without proxy to compare
- Check system resources (memory, disk space)
- Verify all dependencies are correctly installed
For persistent issues:
- Clear the
datadirectory - Reinstall dependencies
- Try with a different manga URL
- Check for script updates