# manga-dlp - python script to download mangas > Full docs: https://manga-dlp.ivn.sh Code Analysis [![Coverage](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=coverage&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp) [![Bugs](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=bugs&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp) [![Maintainability Rating](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=sqale_rating&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp) [![Reliability Rating](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=reliability_rating&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp) [![Security Rating](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=security_rating&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp) Meta [![Formatter](https://img.shields.io/badge/code%20style-ruff-black)](https://github.com/charliermarsh/ruff) [![Linter](https://img.shields.io/badge/linter-ruff-red)](https://github.com/charliermarsh/ruff) [![Types](https://img.shields.io/badge/types-mypy-blue)](https://github.com/python/mypy) [![Tests](https://img.shields.io/badge/tests-pytest%20%7C%20tox-yellow)](https://github.com/pytest-dev/pytest/) [![Coverage](https://img.shields.io/badge/coverage-coveragepy-green)](https://github.com/nedbat/coveragepy) [![License](https://img.shields.io/badge/license-MIT-9400d3.svg)](https://snyk.io/learn/what-is-mit-license/) [![Compatibility](https://img.shields.io/badge/python-3.11-blue)]() --- ## Description A manga download script written in python. It only supports [mangadex.org](https://mangadex.org/) for now. But support for other sites is _planned™_. Before downloading a new chapter, the script always checks if there is already a chapter with the same name in the download directory. If found the chapter is skipped. So you can run the script on a schedule to only download new chapters without any additional setup. The default behaiviour is to pack the images to a [cbz archive](https://en.wikipedia.org/wiki/Comic_book_archive). If you just want the folder with all the pictures use the flag `--format ""`. ## _Currently_ Supported sites - [Mangadex.org](https://mangadex.org/) ## Features (not complete) - Metadata support with [ComicInfo.xml](https://anansi-project.github.io/docs/comicinfo/intro) - Json caching - Custom hooks after/before each download - Custom chapter name format - Volume support - Multiple archive formats supported (cbz,cbr,zip,none) - Language selection - Download all chapters directly - And others... ## Usage ### Quick start ```sh python3 manga-dlp.py \ --url https://mangadex.org/title/a96676e5-8ae2-425e-b549-7f15dd34a6d8/komi-san-wa-komyushou-desu \ --language "en" \ --chapters "all" ``` ### With GitHub ```sh git clone https://github.com/olofvndrhr/manga-dlp.git # clone the repository cd manga-dlp # go in the directory pip install -r requirements.txt # install required packages # on windows python manga-dlp.py # on unix python3 manga-dlp.py ``` ### With pip ([pypi](https://pypi.org/project/manga-dlp/)) ```sh python3 -m pip install manga-dlp # download the package from pypi python3 -m mangadlp # start the script as a module OR manga-dlp # call script directly OR mangadlp # call script directly ``` ### With docker See the docker [README](https://manga-dlp.ivn.sh/docker/) ## Options ```txt Usage: manga-dlp.py [OPTIONS] Script to download mangas from various sites Options: --help Show this message and exit. --version Show the version and exit. source: [mutually_exclusive, required] -u, --url, --uuid TEXT URL or UUID of the manga --read FILE Path of file with manga links to download. One per line verbosity: [mutually_exclusive] --loglevel INTEGER Custom log level --warn Only log warnings and higher --debug Debug logging. Log EVERYTHING -c, --chapters TEXT Chapters to download -p, --path PATH Download path [default: downloads] -l, --language TEXT Manga language [default: en] --list List all available chapters --format [cbz|cbr|zip|pdf|] Archive format to create. An empty string means don't archive the folder [default: cbz] --name-format TEXT Naming format to use when saving chapters. See docs for more infos [default: {default}] --name-format-none TEXT String to use when the variable of the custom name format is empty --forcevol Force naming of volumes. For mangas where chapters reset each volume --wait FLOAT Time to wait for each picture to download in seconds(float) [default: 0.5] --hook-manga-pre TEXT Commands to execute before the manga download starts --hook-manga-post TEXT Commands to execute after the manga download finished --hook-chapter-pre TEXT Commands to execute before the chapter download starts --hook-chapter-post TEXT Commands to execute after the chapter download finished --cache-path PATH Where to store the cache-db. If no path is given, cache is disabled --add-metadata / --no-metadata Enable/disable creation of metadata via ComicInfo.xml [default: add-metadata] ``` ## Contribution / Bugs For suggestions for improvement, just open a pull request. If you want to add support for a new site, there is an api [template file](contrib/api_template.py) which you can use. And more infos and tools are in the contrib [README.md](contrib/README.md) Otherwise, you can open an issue with the name of the site which you want support for (not guaranteed to be implemented). If you encounter any bugs, also just open an issue with a description of the problem. ## TODO's - Make docker container for easy distribution --> [Dockerhub](https://hub.docker.com/r/olofvndrhr/manga-dlp) - Automate release --> Done with woodpecker-ci - Make pypi package --> Done with release [2.1.7](https://pypi.org/project/manga-dlp/) - Add more supported sites