Gallery-dl: [Mangadex] Choosing the language of the manga chapters

Created on 28 Feb 2019  路  2Comments  路  Source: mikf/gallery-dl

Since MangaDex hosts manga translations in other languages than English, there should be an option to list the available languages for any given manga chapter (and if an URL to a manga title is given, the program should show what chapters are available in what language), to choose what language you want or don't want the program to download chapters in and also to have the option to create separate folders for every language after the scheme "MangaDex/Manga Title/Language/Chapter" and / or "MangaDex/Language/Manga Title/Chapter".

question

Most helpful comment

For the most part, you can already do what you are describing here:

  • --chapter-filter (or the chapter-filter option) lets you, who would have guessed, filter chapters by whatever criterion you want based on the available metadata. Try gallery-dl -j <manga-url> to get a list of all chapters and their metadata-values.

To filter by language, you can do something like --chapter-filter "lang == 'en'" or "lang in ('zh', 'de', 'fr')". It just has to be a valid Python expression. (The language short-codes are ISO 639-1)

  • The directory images are stored in can be set with the directory option through a list of format strings. The field names are, again, the names of the metadata-values you can see with -j or -K.

    For your example

    "directory": ["MangaDex", "{language}", "{manga}", "{chapter:>03}{chapter_minor}"]
    

    would work.

  • For a list of available languages, you could parse the output of -j and group by language. That's the one thing gallery-dl can't do on its own.

All 2 comments

For the most part, you can already do what you are describing here:

  • --chapter-filter (or the chapter-filter option) lets you, who would have guessed, filter chapters by whatever criterion you want based on the available metadata. Try gallery-dl -j <manga-url> to get a list of all chapters and their metadata-values.

To filter by language, you can do something like --chapter-filter "lang == 'en'" or "lang in ('zh', 'de', 'fr')". It just has to be a valid Python expression. (The language short-codes are ISO 639-1)

  • The directory images are stored in can be set with the directory option through a list of format strings. The field names are, again, the names of the metadata-values you can see with -j or -K.

    For your example

    "directory": ["MangaDex", "{language}", "{manga}", "{chapter:>03}{chapter_minor}"]
    

    would work.

  • For a list of available languages, you could parse the output of -j and group by language. That's the one thing gallery-dl can't do on its own.

Thanks for the explanation, I'm gonna modify my gallery-dl wrapper script to do that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hrxn picture Hrxn  路  82Comments

Djole137 picture Djole137  路  11Comments

ucok66 picture ucok66  路  10Comments

Vishvamitra picture Vishvamitra  路  12Comments

biznizz picture biznizz  路  55Comments