Girbons / comics-downloader

tool to download comics and manga in pdf/epub/cbr/cbz from a website
MIT License
453 stars 48 forks source link

One failed issue creates strange subfolders #112

Closed MattiasStorm closed 2 years ago

MattiasStorm commented 2 years ago

Describe the bug I downloaded Sonic the Hedgehog from comicextra. I tried to download all issues and when it hit issue 258 it threw the "image: unknown format" error. Looking at that specific issue shows that the images are broken, so it is not due to Comics Downloader. However, after it failed that issue, Comics Downloader started making a subfolder inside the failed issue to download the rest of the comics.

The first downloads went to C:\Users\USER\Desktop\CBDL\comics\www.comicextra.com\sonic-the-hedgehog-1993\ the following downloads went to C:\Users\USER\Desktop\CBDL\comics\www.comicextra.com\sonic-the-hedgehog-1993\images-chapter-258\comics\www.comicextra.com\sonic-the-hedgehog-1993

To Reproduce Steps to reproduce the behavior: Run the command: comics-downloader.exe -format=cbz -url=https://www.comicextra.com/comic/sonic-the-hedgehog-1993

Expected behavior Once issue 258 failed, it should keep downloading to the same folder, not create a new subfolder from within the failed issue.

Desktop (please complete the following information):

Additional context To clarify: the download failed not because of Comics Downloader, that is a fault of comicextra, but the problem is that extra subfolders are created in case one of many downloads fail.

MattiasStorm commented 2 years ago

Had the same problem again, this time with a comic where 4 issues had problems with the image format:

Output from the CMD-window

comics-downloader.exe -all -format=cbz -url=https://www.comicextra.com/comic/kim-reaper-vampire-island
time="2022-05-17T19:32:47+02:00" level=info msg=Downloading...
   0% |                                        |  [0s:0s]time="2022-05-17T19:32:50+02:00" level=error msg="image: unknown format"
   0% |                                        |  [0s:0s]time="2022-05-17T19:32:50+02:00" level=error msg="image: unknown format"
   0% |                                        |  [0s:0s]time="2022-05-17T19:32:51+02:00" level=error msg="image: unknown format"
   0% |                                        |  [0s:0s]time="2022-05-17T19:32:52+02:00" level=error msg="image: unknown format"

The folder structure image

This time it created a 15 level deep folder structure, so there doesn't seem to be any limit to how many times in a row it can happen.

Girbons commented 2 years ago

Hi @MattiasStorm!

Thanks for reporting this issue, indeed it is really weird that it creates this nesting when an image download fail, I'm going to provide a fix for this weekend!