mansuf / mangadex-downloader

A command-line tool to download manga from MangaDex, written in Python.
https://mangadex-dl.mansuf.link/
MIT License
472 stars 37 forks source link

Handle manga with same title #68

Closed danieleg1 closed 8 months ago

danieleg1 commented 1 year ago

The idea

Right now I think the program assumes that a manga title (for generating the destination path) is unique, but that is not true.

Two example: https://mangadex.org/title/5a691c66-3e67-424b-b361-a56ea71ee9bc/amber https://mangadex.org/title/fc83c3d7-9501-4403-92f9-d41f8767b327/amber

https://mangadex.org/title/04528b4c-bcc5-48b4-9af4-096060ad278d/wonderful-days https://mangadex.org/title/d7492c2b-e15d-4e7c-95fb-f5f1d84fd8c6/wonderful-days

The problem is that those two manga ends up in the same folder, sharing the same database download.db and overwriting the cover.

Why this feature should be added to the app ?

I don't know an elegant way to check for duplicates titles, but a workaround could be to add an option to include the manga uuid in the folder name.

mansuf commented 1 year ago

Currently, it is planned to change --path behaviour in v3.0.0, so the path will be absolute.

Before

{CustomDirectory}/{MangaTitle}/{AllChaptersAndVolumes}

# Example
# --path "/home/myuser/mymanga/reading
"/home/myser/mymanga/reading/Tamamo no koi"

After

{CustomDirectory}/{AllChaptersAndVolumes}

# Example
# --path "/home/myuser/mymanga/reading
"/home/myser/mymanga/reading"

Of course, if you still like the old way, you can use placeholders such as %(manga.title)s to --path option.

Again, this feature is currently planned. So i don't have any ETA when v3.0.0 is out.

danieleg1 commented 1 year ago

Awesome, thank you.

mansuf commented 8 months ago

Hello, sorry for taking so long, i got too busy in real life things.

Anyways, this feature has been added in v3.0.0 branch (commit https://github.com/mansuf/mangadex-downloader/commit/3e257fb5264c6e46ecb23ac1e45eb8f269d257f1)

You can start trying it now by installing development version (v3.0.0 branch)

Installation with git + pip:

pip uninstall mangadex-downloader
pip install git+https://github.com/mansuf/mangadex-downloader.git@3e257fb5264c6e46ecb23ac1e45eb8f269d257f1

If you're installing mangadex-downloader from github releases, you can download the development version in here:

The download files are available in "artifacts" section

https://github.com/mansuf/mangadex-downloader/actions/runs/7248099641


--path option are now absolute and you can use placeholders so you can avoid that conflict issue like that

Example usage:

# This will download to directory "/home/sussyuser/manga/Some manga title - some_random_id/English"
mangadex-dl "URL" --path "/home/sussyuser/manga/{manga.title} - {manga.id}/{language.full}" -lang English

For more information about path placeholders, you can read the documentation here -> https://mangadex-dl.mansuf.link/en/v3.0.0/cli_ref/path_placeholders.html

If you have a problem, issue or bug, you can re-open and comment in this issue tracker here.