Manga Archiver
A terminal-based manga downloader and archiver.
About The Project
A terminal-based tool that makes it easy to search for and download manga from sources like MangaDex and AllManga.
Features
- Interactive TUI with keyboard and mouse support
- Download chapters in PDF, CBZ, or EPUB format
- Configurable output settings via in-app Settings screen
- Asynchronous download pipeline with configurable workers
- Local file output or Google Drive upload modes
- Backlog sync - automatically find and download missing chapters from your favorites
Getting Started
Prerequisites
- Python 3.10 or higher
Installation
Install the package with pip:
pip install manga-archiver
or clone the repository and install the package locally:
git clone https://github.com/jfang324/manga-archiver.git
cd manga-archiver
pip install .
Running the Application
manga-archiver
Google Drive Integration
The application supports uploading downloaded manga directly to Google Drive for cloud storage.
Setting Up Google Drive
-
Create a Google Cloud Project
- Go to Google Cloud Console
- Create a new project
- Enable the "Google Drive API"
-
Create OAuth Credentials
- Go to "APIs & Services" > "Credentials"
- Create "OAuth client ID" credentials
- Application type: TVs and Limited Input Devices
- Download the credentials JSON file
-
Configure the Application
- Download your OAuth credentials JSON file from Google Cloud Console
- Rename it to
client_secret.jsonand place it in~/.manga-archiver/
The file should have this structure (from Google's download):
{ "installed": { "client_id": "...", "client_secret": "...", "redirect_uris": [...], "token_uri": "..." } }
-
Authenticate
manga-archiver auth google-drive login
This will initiate the OAuth device flow, follow the instructions in the terminal.
Using Google Drive
Once authenticated, you can:
-
Use archive mode to upload downloads directly to Google Drive:
manga-archiver --archive -
Logout when you want to disconnect your account:
manga-archiver auth google-drive logout
How It Works
- A root folder "Manga-Archiver" is created in your Google Drive
- Each manga gets its own subfolder (created automatically or reused if existing)
- Downloaded files are uploaded to the corresponding manga folder
- File name collisions are handled by appending (1), (2), etc.
Backlog Sync
The backlog sync feature automatically finds missing chapters from your favorites by comparing your local downloads (stored in Google Drive) against the available chapters.
Usage:
# Sync missing chapters from favorites (requires --archive for Google Drive access)
manga-archiver --archive --backlog
This will:
- Fetch all your favorited manga from the database
- Scan each manga's folder in Google Drive to see which chapters you have
- Download any chapters you don't have yet
- Upload them to Google Drive automatically
Note: You must have:
- Authenticated with Google Drive (
manga-archiver auth google-drive login) - Favorites saved in the app (add manga to favorites in the TUI)
- Run with
--archiveto access Google Drive
Settings
Press Ctrl+S on the Settings screen to save your preferences.
Configurable options:
- Output Directory: Where downloaded files are saved (local mode)
- Output Format: PDF, CBZ, or EPUB
- Quality: 1-100 (higher = better quality, larger files)
- Optimize: Optimize PDF file size (slower generation)
Settings are stored in ~/.manga-archiver/settings.json
CLI Arguments
The following command-line arguments are available:
| Flag | Type | Default | Description |
|---|---|---|---|
--resolve-workers |
int | 2 | Number of workers retrieving download resources |
--download-workers |
int | 2 | Number of workers downloading images |
--merge-workers |
int | 2 | Number of workers merging images into output format |
--resolve-rate-limit |
int | 5 | Global rate limit for resolve workers (requests/sec) |
--download-rate-limit |
int | 5 | Global rate limit for download workers (requests/sec) |
--queue-size |
int | 2 | Queue size for data-heavy job queues |
--archive |
flag | false | Enable archive mode (upload to Google Drive instead of local save) |
--backlog |
flag | false | Sync favorites with Google Drive and download missing chapters |
--benchmark |
flag | false | Enable benchmark metrics collection, written to ~/.manga-archiver/benchmark/metrics.txt |
--version |
flag | - | Show the current version and exit |
--preset |
str | - | Apply a built-in runtime tuning preset (safe, slow, fast) |
--headless |
flag | false | Run without a TUI |
list presets |
sub | - | List built-in runtime tuning presets |
migrate |
sub | - | Run database migrations (subcommands: database, google-drive) |
auth google-drive |
sub | - | Google Drive authentication (subcommands: login, logout) |
health |
sub | - | Check provider API health |
config webhooks |
sub | - | Configure webhook integrations (subcommands: discord) |
Usage Examples
# Download with more workers for faster processing
manga-archiver --resolve-workers 10 --download-workers 10
# Upload directly to Google Drive
manga-archiver --archive
# Sync missing chapters from favorites
manga-archiver --archive --backlog
# Enable benchmark mode to collect performance metrics
manga-archiver --benchmark
# Show the installed version
manga-archiver --version
For more options, run manga-archiver --help.
Migration Commands
The application includes a migration system to handle database and Google Drive schema updates.
# Migrate database schema
manga-archiver migrate database
# Migrate Google Drive schema
manga-archiver migrate google-drive
Gallery
https://github.com/user-attachments/assets/f07d5eb4-91d3-4fa1-b90f-23f9f24bfbed
Acknowledgements
- MangaDex for providing the API used in this project
Known Issues
- AllManga integration may be slightly unstable at times
Development
See docs/development.md for setup and development commands.
Tools & Technologies
Core
- Python 3.10+
- Textual
- aiohttp
- asyncio
- Pillow
- ebooklib
- SQLite
Google Drive
- google-auth
- google-api-python-client
Code Quality
- Ruff
- Pyright
Testing
- pytest
- Coverage
- pytest-asyncio
Build & Package
- Poetry
- pip
Metadata
Release files for manga-archiver 1.5.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| manga_archiver-1.5.6.tar.gz | 85.8 kB | Without provenance | Details for manga_archiver-1.5.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| manga_archiver-1.5.6-py3-none-any.whl | Python 3 | none | any | Details for manga_archiver-1.5.6-py3-none-any.whl |
Total release size: 218.8 kB
Release files / manga_archiver-1.5.6.tar.gz
| Download URL | manga_archiver-1.5.6.tar.gz |
|---|---|
| Size | 85.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd3fbd8551dc7ddf4818061a2d85aa3c86500b7d4d6f7791d17732e085fd954f
|
|
BLAKE2b-256 checksum How to use checksums |
e97ece233fc879ef28d967ffb747b85ed160ba93fdaef02b390e5161d91430b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.12.7 Windows/11
|
Release files / manga_archiver-1.5.6-py3-none-any.whl
| Download URL | manga_archiver-1.5.6-py3-none-any.whl |
|---|---|
| Size | 133.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13b3c7a2eba0750db9f8c0954400ff4b687e0067a5cd1b5a52ecfd0d321a0c81
|
|
BLAKE2b-256 checksum How to use checksums |
58d509e2c2d4a932c71bc15f0e991d3776d742a9dafeeecd741a6da78f782d2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.12.7 Windows/11
|
Security for manga-archiver 1.5.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.