metafates / mangal

📖 The most advanced (yet simple) cli manga downloader in the entire universe! Lua scrapers, export formats, anilist integration, fancy TUI and more!
MIT License
1.35k stars 51 forks source link

Mangadex download bug (delimiter) #150

Open C9Glax opened 1 year ago

C9Glax commented 1 year ago

Describe the bug

runtime error: index out of range [99] with length 99 The index is always the length. Only occurs with Mangadex Titles with occurrences (also some weird ones) and index:

Also one full line:

{"level":50,
"time":1675028575839,
"pid":307,
"hostname":"fecb3815dfa6",
"msg":
  "Failed to download the chapter #110 for Ijiranaide, Nagatoro-san. Err:
  Error: Command failed with exit code 2: mangal inline --source Mangadex --query Ijiranaide, Nagatoro-san --manga exact --chapters 110 -d
  panic: runtime error: index out of range [95] with length 95

  goroutine 1 [running]:
  github.com/metafates/mangal/inline.ParseChaptersFilter.func1({0xc000276480?, 0x5f, 0x8d})
    github.com/metafates/mangal/inline/options.go:114 +0x378
  github.com/metafates/mangal/inline.Run(0xc000567c88)
    github.com/metafates/mangal/inline/inline.go:99 +0x474
  github.com/metafates/mangal/cmd.glob..func11(0x1d26c80?, {0x101d881?, 0x9?, 0x9?})
    github.com/metafates/mangal/cmd/inline.go:149 +0x567
  github.com/spf13/cobra.(*Command).execute(0x1d26c80, {0xc0002307e0, 0x9, 0x9})
    github.com/spf13/cobra@v1.6.1/command.go:920 +0x847
  github.com/spf13/cobra.(*Command).ExecuteC(0x1d2a040)
    github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
  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 +0x7a
  main.main()
    github.com/metafates/mangal/main.go:13 +0x4d"
}

Reproduction steps

No response

Expected behavior

No response

Additional context

Docker container

Operating System

Linux

timbroder commented 1 year ago

Adding a few more samples

C9Glax commented 1 year ago

Okay I have no idea on what is actually happening, because I only read this one function, but what I think is the error: https://github.com/metafates/mangal/blob/main/inline/options.go Line 110: from = util.Min(from, uint64(len(chapters))) should actually subtract 1 ? Just a shot in the dark really...

metafates commented 1 year ago

https://github.com/metafates/mangal/blob/main/inline/options.go

Line 110:

from = util.Min(from, uint64(len(chapters))) should actually subtract 1 ?

Actually, that might be the case, lol

Ellwindrae commented 1 year ago

Wanted to add a few more samples: Helck_chapter#405 Helck_chapter#395 Helck_chapter#440 [Oshi_no_Ko]_chapter#142 [Oshi_no_Ko]_chapter#238

Have a decent number more if there is a way to export my Bull Dashboard.