mirror of
https://github.com/skidoodle/ncore-stats.git
synced 2026-04-27 23:37:36 +02:00
fix seedingcount in scraper
This commit is contained in:
+2
-2
@@ -130,8 +130,8 @@ func (s *State) fetchProfile(ctx context.Context, user User) (*ProfileData, erro
|
|||||||
})
|
})
|
||||||
|
|
||||||
doc.Find(".lista_mini_fej").Each(func(i int, sel *goquery.Selection) {
|
doc.Find(".lista_mini_fej").Each(func(i int, sel *goquery.Selection) {
|
||||||
text := sel.Text()
|
text := strings.ToLower(sel.Text())
|
||||||
if strings.Contains(text, "seeding") || strings.Contains(text, "futó") {
|
if strings.Contains(text, "fel:") || strings.Contains(text, "le:") || strings.Contains(text, "seeding") || strings.Contains(text, "futó") {
|
||||||
if m := regexp.MustCompile(`\((\d+)\)`).FindStringSubmatch(text); len(m) > 1 {
|
if m := regexp.MustCompile(`\((\d+)\)`).FindStringSubmatch(text); len(m) > 1 {
|
||||||
p.SeedingCount, _ = strconv.Atoi(m[1])
|
p.SeedingCount, _ = strconv.Atoi(m[1])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user