metafates / mangal

📖 The most advanced (yet simple) cli manga downloader in the entire universe! Lua scrapers, export formats, anilist integration, fancy TUI and more!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panic: runtime error: index out of range

glottisfaun0000 opened this issue · comments

Describe the bug

With Mangadex, I'm getting a ton of failed downloads (originally encountered in Kaizoku but the same when running mangal directly) with errors like this:

 mangal inline --source Mangadex --query Tengoku Daimakyou --manga exact --chapters 135 -d
panic: runtime error: index out of range [16] with length 16

goroutine 1 [running]:
github.com/metafates/mangal/inline.ParseChaptersFilter.func1({0x14000276480?, 0x10, 0x10})
	github.com/metafates/mangal/inline/options.go:114 +0x390
github.com/metafates/mangal/inline.Run(0x1400001bc68)
	github.com/metafates/mangal/inline/inline.go:99 +0x400
github.com/metafates/mangal/cmd.glob..func11(0x104078b60?, {0x1032239e3?, 0xa?, 0xa?})
	github.com/metafates/mangal/cmd/inline.go:149 +0x4a4
github.com/spf13/cobra.(*Command).execute(0x104078b60, {0x14000481e00, 0xa, 0xa})
	github.com/spf13/cobra@v1.6.1/command.go:920 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x10407bf20)
	github.com/spf13/cobra@v1.6.1/command.go:1044 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.6.1/command.go:968
github.com/metafates/mangal/cmd.Execute()
	github.com/metafates/mangal/cmd/root.go:112 +0x94
main.main()
	github.com/metafates/mangal/main.go:13 +0x54

Curious if this is a problem with Mangadex (I've confirmed X chapter does exist on the site), or a mangal known bug.

Reproduction steps

mangal inline --source Mangadex --query Tengoku Daimakyou --manga exact --chapters 135 -d

Expected behavior

Chapter is downloaded

Additional context

Running via homebrew on macOS, same behavior in Kaizoku via docker

Operating System

macOS