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

Cover locale choice #66

Closed DJScias closed 1 year ago

DJScias commented 1 year ago

The idea

We can now embed the covers from "Art" in the volumes by using --use-volume-cover which is amazing.

However for example with "Rising of the SHield Hero" there are covers in like 10 different languages: https://mangadex.org/title/0f237a5f-07ad-4e43-bbd9-2a320694434d/tate-no-yuusha-no-nariagari?tab=art

It seems to grab the first one it can find for every volume. Which is sometimes Russian, sometimes Japanese, etc.. It's a real mess honestly to see each volume do a lottery on which language it'll use for a cover.

It'd be a real great quality of life if in some way the user could choose the locale "en", "jp" or somehow to define which language the covers should prefer.

Why this feature should be added to the app ?

It would fix the somewhat messy multiple cover languages that we're currently getting when a manga has multiple language art covers.

mansuf commented 1 year ago

It's more like an issue to be honest. But, i agree about user could choose cover locale. I will fix this bug and add a new option --cover-language for ability to choose cover locale

mansuf commented 1 year ago

I've made PR #73 that will close this issue, you can try test it from development version.

Installation with git + pip:

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

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/5212468729


The volume cover language now follow --language value by default. So you don't have to worry the volume cover language are not consistent.

Also i added --volume-cover-language (-vcl) option to change volume cover language.

Example usage:

mangadex-dl "https://mangadex.org/title/0f237a5f-07ad-4e43-bbd9-2a320694434d/tate-no-yuusha-no-nariagari?tab=art" -f cbz-volume --volume-cover-language "Korean"

This will find volumes cover with Korean language.

Please note, the application can use main cover as replacement for volumes that didn't have cover for that language. You will notice warning like this

[WARNING] Failed to find volume cover for volume {volume}. Falling back to manga cover...
DJScias commented 1 year ago

Hello there,

Tested it out locally by checking out the branch (as I use the git clone variant).

Running the following two commands with just --volume-cover-language:

mangadex-dl "https://mangadex.org/title/0f237a5f-07ad-4e43-bbd9-2a320694434d/tate-no-yuusha-no-nariagari" --no-progress-bar --save-as "cbz-volume" --use-alt-details --use-volume-cover --volume-cover-language "English"

Gave me the English covers as requested.

and

mangadex-dl "https://mangadex.org/title/0f237a5f-07ad-4e43-bbd9-2a320694434d/tate-no-yuusha-no-nariagari" --no-progress-bar --save-as "cbz-volume" --use-alt-details --use-volume-cover --volume-cover-language "Japanese"

Gave me the Japanese covers as requested.

As a third, I also tested it with --language like so:

mangadex-dl "https://mangadex.org/title/0f237a5f-07ad-4e43-bbd9-2a320694434d/tate-no-yuusha-no-nariagari" --no-progress-bar --save-as "cbz-volume" --use-alt-details --use-volume-cover --language "Russian"

Which used Russian manga and covers.

And then finally to be thorough I combined both --language and --volume-cover-language:

mangadex-dl "https://mangadex.org/title/0f237a5f-07ad-4e43-bbd9-2a320694434d/tate-no-yuusha-no-nariagari" --no-progress-bar --save-as "cbz-volume" --use-alt-details --use-volume-cover --language "Russian" --volume-cover-language "English"

Which produced the Russian manga but with English covers as requested.

Feature seems to work from all my tests, thank you for the great work. :)