manga-dlp/README.md

147 lines
5 KiB
Markdown
Raw Permalink Normal View History

2021-12-22 11:28:54 +01:00
# manga-dlp
## python script to download mangas
2022-05-13 11:49:13 +02:00
[![status-badge](https://ci.44net.ch/api/badges/olofvndrhr/manga-dlp/status.svg)](https://ci.44net.ch/olofvndrhr/manga-dlp)
2022-05-10 18:42:17 +02:00
[![Quality Gate Status](https://sonarqube.44net.ch/api/project_badges/measure?project=olofvndrhr%3Amanga-dlp&metric=alert_status&token=f9558470580eea5b4899cf33f190eee16011346d)](https://sonarqube.44net.ch/dashboard?id=olofvndrhr%3Amanga-dlp)
[![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)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
2021-12-19 17:40:12 +01:00
2021-12-22 11:28:54 +01:00
## Description
2022-05-10 18:42:17 +02:00
2022-05-09 15:50:22 +02:00
A manga download script written in python. It only supports [mangadex.org](https://mangadex.org/) for now. But support
for other sites is planned.
2021-12-22 11:28:54 +01:00
2022-05-09 15:50:22 +02:00
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
2022-05-09 15:50:22 +02:00
you just want the folder with all the pictures use the flag `--nocbz`.
2021-12-22 11:28:54 +01:00
2021-12-25 00:26:16 +01:00
## *Currently* Supported sites
* [Mangadex.org](https://mangadex.org/)
2021-12-22 11:28:54 +01:00
## 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"
```
2021-12-22 14:42:04 +01:00
### With GitHub
2021-12-22 11:28:54 +01:00
```sh
git clone https://github.com/olofvndrhr/manga-dlp.git # clone the repository
cd manga-dlp # go in the directory
2021-12-22 14:35:07 +01:00
pip install -r requirements.txt # install required packages
2021-12-22 11:28:54 +01:00
# on windows
python manga-dlp.py <options>
# on unix
python3 manga-dlp.py <options>
```
### With pip (pypi)
2022-05-09 15:50:22 +02:00
(not yet done)
2021-12-22 11:28:54 +01:00
### With docker
2022-05-09 15:50:22 +02:00
See the docker [README](./docker/README.md)
2021-12-22 11:28:54 +01:00
## Options
```txt
usage: manga-dlp.py [-h] [-u URL] [-c CHAPTERS] [-p PATH] [-l LANG] [--read READ] [--list] [--nocbz] [--forcevol] [--wait WAIT]
[--verbose]
optional arguments:
-h, --help Show this help message and exit
2022-05-09 15:50:22 +02:00
-u URL/UUID, --url URL/UUID URL or UUID of the manga
2021-12-22 11:28:54 +01:00
-c CHAPTERS, --chapters CHAPTERS Chapters to download
-p PATH, --path PATH Download path. Defaults to "<script_dir>/downloads"
-l LANG, --language LANG Manga language. Defaults to "en" --> english
--read READ Path of file with manga links to download. One per line
--list List all available chapters. Defaults to false
--nocbz Dont pack it to a cbz archive. Defaults to false
--forcevol Force naming of volumes. For mangas where chapters reset each volume
--wait WAIT Time to wait for each picture to download in seconds(float). Defaults 0.5
--verbose Verbose logging. Defaults to false
```
### Downloads file-structure
2022-05-09 15:50:22 +02:00
2021-12-22 11:28:54 +01:00
```txt
.
└── <download path>/
└── <manga title>/
└── <chapter title>/
```
2022-05-09 15:50:22 +02:00
2021-12-22 11:28:54 +01:00
#### Example:
2022-05-09 15:50:22 +02:00
2021-12-22 11:28:54 +01:00
```txt
./downloads/mangatitle/chaptertitle(.cbz)
```
### Read list of links from file
2022-05-09 15:50:22 +02:00
With the option `--read` you can specify a file with links to multiple mangas. They will be parsed from top to bottom
one at a time. Every link will be matched for the right api to use. It is important that you only have one link per
line, otherwise they can't be parsed.
2021-12-22 11:28:54 +01:00
#### Example:
2022-05-09 15:50:22 +02:00
2021-12-22 11:28:54 +01:00
```txt
# mangas.txt
link1
link2
link3
```
2022-05-09 15:50:22 +02:00
2021-12-22 11:28:54 +01:00
`python3 manga-dlp.py --read mangas.txt --list`
This will list all available chapters for link1, link2 and link3.
### Set download path
2022-05-09 15:50:22 +02:00
With the option `-p/--path` you can specify a path to download the chapters to. The default path
is `<script_dir>/downloads`. Absolute and relative paths are supported.
2021-12-22 11:28:54 +01:00
#### Example:
2022-05-09 15:50:22 +02:00
2021-12-22 11:28:54 +01:00
`python3 manga-dlp.py <other options> --path /media/mangas`
This will save all mangas/chapters in the path `/media/mangas/<manga title>/<chapter name>`
## 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.
Otherwise you can open a 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 a issue with a description of the problem.
## TODO's
2022-05-09 15:50:22 +02:00
* <del>Make docker container for easy distribution</del>
--> [Dockerhub](https://hub.docker.com/repository/docker/olofvndrhr/manga-dlp)
2022-05-13 11:49:13 +02:00
* <del>Automate release</del>
--> Done with woodpecker-ci
2021-12-22 11:28:54 +01:00
* Make pypi package
* Add more supported sites
2021-12-19 17:40:12 +01:00
2021-12-24 16:47:44 +01:00