Downloads images (manga) from the web into cbz files, converts to pdf, and syncs between local cache and a device folder. Cache ensures files will not redownload.
Only syncs newer chapters. If older chapters are deleted from the device, only chapters after the latest chapter on device will be added. If no chapters exist on device, all chapters will be synced to device
python program.py [-h] [-u URL] [-a [ADD]] [-c [COMPLETED]] [-d [HAITUS]]
-h, --help: Show help message and exit
-u URL, --url URL: Url to read from
-a [ADD], --add [ADD]: Add url to sources.txt
-c [COMPLETED], --completed [COMPLETED]: Use completed.txt
-d [HAITUS], --haitus [HAITUS]: Use dead haitus.txt
-f [FILE], --file [FILE]: Convert individual file or directory to PDF
All arguments are optional. If no arguments are provided, the program will use the default ongoing source file (sources.txt).
If the -u argument is provided, the program will download the manga from the given url.
If the -a argument is provided with a url, the program will add the url to the sources file.
If any of the -o, -c, or -d arguments are provided, the program will use the corresponding source file instead of the default ongoing file.
If the -f argument is provided with a file or directory, the program convert to PDF.
Download manga from a url:
python program.py -u https://example.com/manga/1
Add a url to the sources file:
python program.py -u https://example.com/manga/1 -a
Use the completed source file:
python program.py -c
Use the dead haitus source file:
python program.py -d
Convert file to PDF:
python program.py -f path_to_file.cbz
Convert directory to PDF:
python program.py -f path_to_files
Even if the feed changes, the chapter number is attempted to be extracted from the feed. This will not redownload cached chapter numbers even if the file name would be different.
sources.txt
can support a flag to combine all chapters into a single file for those manga that like to be a page or two a chapter
url, True
Or keeping as separate chapters..
url
tested with kobo libra 2
and will work with any device that supports pdf or cbz (zip) files
cbz/pdf doesn't seem to support a series metadata tag, I do create a user collection of the manga.
Summary will display both download and synced information. If device is absent, will inform. If only sync happens, will inform.
Author is added to PDF metadata
pip install -r requirements.txt
Modify sources.txt
run with python 3
python program.py
Note:
mangadex
is looking for the GUID out of the url
https://danke.moe/read/manga/the-tsuntsuntsuntsuntsuntsuntsuntsuntsuntsuntsundere-girl/, True
https://danke.moe/read/manga/OL-cafe-crush/
https://mangadex.org/title/e5148679-29de-4fff-b1a1-c77c44c41d5a/crest-of-the-stars
Hardcoded to en
atm, and pretty much the first non-external source
✓ kobo detected
The Tsuntsuntsuntsuntsuntsuntsuntsuntsuntsuntsundere Girl Getting Less and Less Tsun Day by Day - mangadex
✓ cache: 84 ✓ remote: 85 downloading: 84 to 85.0
100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00, 1.20it/s]
x device: 84
The Overworked Office Lady's Café Crush - danke.moe
✓ cache: 3 ✓ remote: 3 ✓ device: 3
~~~~~~~~~~~~~~~~~~~~~
Content missing from device, synced to device
The Tsuntsuntsuntsuntsuntsuntsuntsuntsuntsuntsundere Girl Getting Less and Less Tsun Day by Day - 85.pdf
For non-server usage:
You can use ./config
directly which is default behavior of running the program. It assumes you are running the application locally without a server.
For server usage:
- On the server, add the necessary sources for manga content. This will populate the
./config
folder (sources.txt) by running the program. - Use the
./deploy
script to build a Docker image with the provided Dockerfile and run a container namedmanga-downloader
. This container will have two folders mounted:tmp
for downloads andconfig
for configuration. Theconfig
folder can be edited outside the container.
For client usage (syncing to e-reader):
Modify the sync
script with the following variables:
syncDestination="/run/media/chris/KOBOeReader" # Replace this with the path to your e-reader destination
sourceDestination="chris@valhalla:/home/chris/code/manga-kobo" # Replace this with the path to your server's manga-kobo directory
Running the sync command will attempt to mount the server's download and config folders locally. It won't download content as it assumes you have an auto-downloader already running. The command will move content from the server to your e-reader destination (syncDestination). After usage, these folders will be unmounted. For smooth operation, it's recommended to set up passwordless SSH to avoid prompts.