mansuf / mangadex-downloader

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

new --use-volume-cover causes exception #46

Closed benpoe closed 1 year ago

benpoe commented 1 year ago

What happened ?

while trying yo test the new use-volume-cover option, i get an error if the series has no volumes grouping

mangadex-dl -v mangadex-downloader v2.6.1 (https://github.com/mansuf/mangadex-downloader) Python: 3.9.16 arch: x64 bundled executable: no

command:

mangadex-dl https://mangadex.org/title/0210cda7-341d-4cdb-bbbb-3cf31e5f5f5c/a-mediocre-senior-brother --save-as cbz-volume --use-volume-cover --language "en" --use-chapter-title --folder /downloads/

exception

mangadex_downloader.errors.MangaDexException: Failed to find volume cover for volume None (manga_id: 0210cda7-341d-4cdb-bbbb-3cf31e5f5f5c). Please report this issue to https://github.com/mansuf/mangadex-downloader/issues

What did you expect to happen ?

if there is no vuolume, then just use the main cover

OS version

docker : python:3.9-alpine

App version

mangadex-downloader v2.6.1 (https://github.com/mansuf/mangadex-downloader) Python: 3.9.16 arch: x64 bundled executable: no

Installation origin

PyPI (Python Package Index)

Installation origin (other sources)

No response

Reproducible command

mangadex-dl https://mangadex.org/title/0210cda7-341d-4cdb-bbbb-3cf31e5f5f5c/a-mediocre-senior-brother --save-as cbz-volume --use-volume-cover --language "en" --use-chapter-title --folder /downloads/

Additional context

No response

mansuf commented 1 year ago

It should be fixed in https://github.com/mansuf/mangadex-downloader/commit/d708cd2318fe8c54295ca971872c581f48c515ee

I tested it locally using the exact command from you and it works without errors.

[INFO] Checking url = https://mangadex.org/title/0210cda7-341d-4cdb-bbbb-3cf31e5f5f5c/a-mediocre-senior-brother
[INFO] Using English language
[INFO] Fetching all chapters...
[INFO] Downloading cover manga A Mediocre Senior Brother
file_sizes: 100%|████████████████████████████| 998k/998k [00:00<00:00, 3.84MB/s]
[INFO] Download directory is set to "D:\Manga\test_manga\A Mediocre Senior Brother"
[INFO] Using cbz-volume format
[INFO] Preparing to download
[INFO] Getting volume cover for "Volume None"
[WARNING] Failed to find volume cover for volume None. Falling back to manga cover...
file_sizes: 100%|████████████████████████████| 998k/998k [00:00<00:00, 8.05MB/s]
[INFO] Getting images from chapter 1
[INFO] Downloading [INKR Comics] Chapter. 1 - Sacred Land of Daluo page 1
file_sizes: 100%|████████████████████████████| 504k/504k [00:00<00:00, 12.7MB/s]
...

You can try it by installing patched version

pip install git+https://github.com/mansuf/mangadex-downloader.git@d708cd2318fe8c54295ca971872c581f48c515ee