From 497c75efd4e9ce5f07ea197857cdb94a2e19eb10 Mon Sep 17 00:00:00 2001 From: vt-idiot <81622808+vt-idiot@users.noreply.github.com> Date: Sun, 3 Sep 2023 21:05:37 -0400 Subject: [PATCH] Javdatabase cast again (#7) * Update javdatabase.go --- pkg/scrape/javdatabase.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkg/scrape/javdatabase.go b/pkg/scrape/javdatabase.go index 440ee4239..c30b79d41 100644 --- a/pkg/scrape/javdatabase.go +++ b/pkg/scrape/javdatabase.go @@ -26,16 +26,12 @@ func ScrapeJavDB(out *[]models.ScrapedScene, queryString string) { // Cast html.ForEach("h2.subhead", func(id int, h2 *colly.HTMLElement) { if strings.HasSuffix(h2.Text, "Actress/Idols") { - dom := h2.DOM - parent := dom.Parent() - if parent != nil { - parent.Find("a").Each(func(i int, anchor *goquery.Selection) { - href, exists := anchor.Attr("href") - if exists && strings.Contains(href, "javdatabase.com/idols/") && anchor.Text() != "" { - sc.Cast = append(sc.Cast, strings.TrimSpace(anchor.Text())) - } - }) - } + h2.DOM.Parent().Find("div.card-body a.cut-text").Each(func(i int, anchor *goquery.Selection) { + href, exists := anchor.Attr("href") + if exists && strings.Contains(href, "javdatabase.com/idols/") && anchor.Text() != "" { + sc.Cast = append(sc.Cast, strings.TrimSpace(anchor.Text())) + } + }) } })