Girbons / comics-downloader

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

runtime error on -all argument with a supported website #56

Closed TranKovak closed 3 years ago

TranKovak commented 4 years ago

Describe the bug Hello, I got a panic: runtime error: index out of range [4] with length 4 when I try to download all the issue of a manga on mangareader.net I can download specific issue but not all. I tried with 2 different manga. maybe I use it wrongly.

To Reproduce On widows 10 with the command comics-downloader.exe -all -format=cbz -url=http://www.mangareader.net/akira or comics-downloader.exe -all -format=cbz -url=http://www.mangareader.net/mahou-sensei-negima

Expected behavior The program should create a cbz file of the manga with all issue.

Screenshots

>comics-downloader.exe -url=http://www.mangareader.net/akira -images-only -format=cbz -all
time="2020-04-14T17:58:19+02:00" level=info msg=Downloading... url="http://www.mangareader.net/akira"
panic: runtime error: index out of range [4] with length 4

goroutine 1 [running]:
github.com/Girbons/comics-downloader/pkg/sites.(*Mangareader).GetInfo(0xb96030, 0xc00000e335, 0x20, 0x8, 0xc000107808, 0x74bdd5, 0x0)
        /Users/girbons/go/src/github.com/Girbons/comics-downloader/pkg/sites/mangareader.go:104 +0x8a
github.com/Girbons/comics-downloader/pkg/sites.initializeCollection(0xc00010a200, 0x6, 0x8, 0xc000107f08, 0x8dc660, 0xb96030, 0x8, 0x0, 0x0, 0x0, ...)
        /Users/girbons/go/src/github.com/Girbons/comics-downloader/pkg/sites/loader.go:21 +0xe8
github.com/Girbons/comics-downloader/pkg/sites.LoadComicFromSource(0xc000107f08, 0x4, 0xc0001079e8, 0x1, 0x1, 0x0)
        /Users/girbons/go/src/github.com/Girbons/comics-downloader/pkg/sites/loader.go:75 +0x15c
github.com/Girbons/comics-downloader/cmd/app.download(0xc000107f08, 0x0)
        /Users/girbons/go/src/github.com/Girbons/comics-downloader/cmd/app/downloader.go:79 +0x593
github.com/Girbons/comics-downloader/cmd/app.Run(0xc000107f08)
        /Users/girbons/go/src/github.com/Girbons/comics-downloader/cmd/app/downloader.go:125 +0x90
main.main()
        /Users/girbons/go/src/github.com/Girbons/comics-downloader/cmd/downloader/main.go:83 +0x24c

Desktop (please complete the following information):

Thank you for your time.

Girbons commented 4 years ago

Hey @TranKovak thanks for the report.

I will take a look asap

TranKovak commented 4 years ago

in the read me you say Provide the comic url and use the -all flag. The url provided can be any issue of the comic, or the main comic page url.

so I retried with this command comics-downloader.exe -url=http://www.mangareader.net/akira/1 -timeout 180 -format=cbz -all and its downloading all the issue, so it's juste the case where we provide only the main comic/manga page url that doesn't work.

and my excpected behavior is wrong, it make sense to have separte cbz, I think a new feature with cbc format could be great, but I will create a feature request for that to keep things clear here

in resume, this issue is this doesn't work comics-downloader.exe -url=http://www.mangareader.net/akira -timeout 180 -format=cbz -all

but this does comics-downloader.exe -url=http://www.mangareader.net/akira/1 -timeout 180 -format=cbz -all

thank you again this program is awesome :)

Girbons commented 4 years ago

comics-downloader.exe -url=http://www.mangareader.net/akira -timeout 180 -format=cbz -all

It should even work by providing the main comic page url, that's a thing to fix. Also timeout parameter works only if daemon is set otherwise it does nothing, I should improve the readme.

thank you again this program is awesome :)

I really appreciate that, thank you! :)

Girbons commented 3 years ago

Hey @TranKovak

sorry for the delay 🙏, solved in 0.22.5!

TranKovak commented 3 years ago

Nice, thank you.

jRimbault commented 3 years ago

This is still happening for me on version 0.23.1, sorry :/

Edit: on linux arm and windows x64 and on linux x64

Output, almost same as above ``` $ comics-downloader -all -format=cbz -output=. -url=https://www.mangatown.com/manga/jojo_s_bizarre_adventure_part_6_stone_ocean/ INFO[0000] Downloading... url="https://www.mangatown.com/manga/jojo_s_bizarre_adventure_part_6_stone_ocean/" panic: runtime error: index out of range [4] with length 4 goroutine 1 [running]: github.com/Girbons/comics-downloader/pkg/sites.(*Mangatown).GetInfo(0xb24318, 0xc0002c1b80, 0x40, 0xc000099cb0, 0xac, 0xab, 0xc0003f2640) /Users/girbons/go/src/github.com/Girbons/comics-downloader/pkg/sites/mangatown.go:113 +0x86 github.com/Girbons/comics-downloader/pkg/sites.initializeCollection(0xc00014b000, 0xac, 0x100, 0xc00058ff08, 0x8da360, 0xb24318, 0x100, 0x0, 0x0, 0x0, ...) /Users/girbons/go/src/github.com/Girbons/comics-downloader/pkg/sites/loader.go:21 +0xd4 github.com/Girbons/comics-downloader/pkg/sites.LoadComicFromSource(0xc00058ff08, 0x4, 0xc000811a18, 0x1, 0x1, 0x1) /Users/girbons/go/src/github.com/Girbons/comics-downloader/pkg/sites/loader.go:75 +0x15d github.com/Girbons/comics-downloader/cmd/app.download(0xc00058ff08, 0xc000093e00) /Users/girbons/go/src/github.com/Girbons/comics-downloader/cmd/app/downloader.go:93 +0x619 github.com/Girbons/comics-downloader/cmd/app.Run(0xc000093f08) /Users/girbons/go/src/github.com/Girbons/comics-downloader/cmd/app/downloader.go:139 +0x89 main.main() /Users/girbons/go/src/github.com/Girbons/comics-downloader/cmd/downloader/main.go:83 +0x245 $ comics-downloader -version comics-downloader version v0.23.1 ```

Edit: this seems like the culprit, but can't reproduce here, I guess there is some manipulation of the url before it evens come here? It seems whatever the fix you found for 20485b1 should also be applied to mangatown? I'm not a go user so I can't help much :/

Girbons commented 3 years ago

Hi @jRimbault thanks for reporting, I will take a look asap!