diff --git a/main.go b/main.go index 1828869..4c39e7e 100644 --- a/main.go +++ b/main.go @@ -96,6 +96,9 @@ func (ani *Anime) InfoFromTitle(title string) error { epInfo := strings.Split(titleSplit[len(titleSplit)-1], "v") ep, err := strconv.Atoi(epInfo[0]) + if err != nil { + err = fmt.Errorf("%w. Full string: %v", err, title) + } return e.If(err).ThenIf(func() error { ani.Episode = ep if len(epInfo) > 1 { @@ -229,7 +232,17 @@ func GetAllAvailable(name string, onlyHEVC bool) ([]Anime, error) { } else if strings.Contains(title, "(Repack)") { title = strings.Split(title, " (Repack)")[0] } else { - title = strings.Split(title, " [1080p]")[0] + is720 := strings.Contains(title, "[720p]") + is1080 := strings.Contains(title, "[1080p]") + + if is720 { + title = strings.Split(title, " [720p]")[0] + } else if is1080 { + title = strings.Split(title, " [1080p]")[0] + } else { + e.Log(fmt.Sprintf("Episode not found, or processed incorrectly. Got: %s.", title), LogNTFY()) + } + } cols = cols.Next() // Download link