anyflip-downloader
anyflip-downloader copied to clipboard
panic: runtime error: index out of range [193] with length 193
When trying to dowload a specific file I get this runtime error:
panic: runtime error: index out of range [193] with length 193
goroutine 1 [running]:
main.prepareDownload(0xc00018e900)
/home/runner/work/anyflip-downloader/anyflip-downloader/main.go:106 +0x43c
main.main()
/home/runner/work/anyflip-downloader/anyflip-downloader/main.go:52 +0x1c
Tried both on Linux and Windows, tried compiling from source and using the release. Does not happen with any other file I tried downloading, only with this specific one.
The file I am trying to download has 258 pages, but weirdly there are only 193 jpgs names listed in the config.js on the website. Infact, if I try to load the thumbnails of the pages on AnyFlip, the thumbnails only load up to page 193. The "pageFilesNames" array has therefore only 193 jpgs names, but the function prepareDownload in main gets called 258 times, because that's the lenght of the document in theory.
I managed to download the file by appending a slice with the names of the other pages starting from 194.jpg to "pageFilesNames". Apparently, the missing page names were replaced by the standard page number names after page 193. So this Issue is just to let people know that there are documents on AnyFlip that have both pages with random names and number names.
Sorry for replying so late. Interesting. If you by any chance still have the config.js file for this book, I would be happy to have a look at it and see if I can find a solution for this issue.
I got the same problem, but this way
panic: runtime error: index out of range [1] with length 1 goroutine 1 [running]: main.sanitizeURL(0xc00013ea20) /home/runner/work/anyflip-downloader/anyflip-downloader/main.go:116 +0xf4 main.prepareDownload(0xc00013ea20) /home/runner/work/anyflip-downloader/anyflip-downloader/main.go:78 +0x46 main.main() /home/runner/work/anyflip-downloader/anyflip-downloader/main.go:52 +0x1c5 I don’t know which command to put but my file has 121 pages. If anyone can help me.