Skip to content

Commit

Permalink
Fix manganelo grabber downloading (undesired) multiple chapters (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
elboletaire authored Jan 20, 2023
1 parent ea81974 commit 7578297
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions grabber/manganelo.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ func (m Manganelo) FetchTitle() (string, error) {
// FetchChapters returns a slice of chapters
func (m Manganelo) FetchChapters() (chapters Filterables, errs []error) {
m.rows.Each(func(i int, s *goquery.Selection) {
re := regexp.MustCompile(`(\d+\.?\d*)`)
num := re.FindString(s.Find("a").Text())
re := regexp.MustCompile(`Chapter\s*(\d+\.?\d*)`)
chap := re.FindStringSubmatch(s.Find("a").Text())
// if the chapter has no number, we skip it (usually it's an announcement from the site)
if num == "" {
if len(chap) == 0 {
return
}

num := chap[1]
number, err := strconv.ParseFloat(num, 64)
if err != nil {
errs = append(errs, err)
Expand Down
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ grabber/manganelo:
go run . https://mangakakalot.com/manga/vd921334 7
go run . https://ww5.manganelo.tv/manga/manga-aa951409 3
go run . http://manganelos.com/manga/dont-pick-up-what-youve-thrown-away 10-12 --bundle
go run . https://readmangabat.com/read-ov357862 23
go run . https://chapmanganato.com/manga-aa951409 50
go run . https://h.mangabat.com/read-tc397521 5
go run . https://mangajar.com/manga/chainsaw-man-absTop-abs3bof 23
Expand Down

0 comments on commit 7578297

Please sign in to comment.