Skip to content

Commit

Permalink
Javdatabase cast again (#7)
Browse files Browse the repository at this point in the history
* Update javdatabase.go
  • Loading branch information
vt-idiot authored Sep 4, 2023
1 parent 496a151 commit 497c75e
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions pkg/scrape/javdatabase.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
})
}
})

Expand Down

0 comments on commit 497c75e

Please sign in to comment.