Skip to content

Commit

Permalink
scraper: fix CzechVR scrapers (xbapps#1672)
Browse files Browse the repository at this point in the history
* scraper: fix CzechVR scrapers

* fix script detection

---------

Co-authored-by: crwxaj <crwxaj>
  • Loading branch information
crwxaj authored Apr 2, 2024
1 parent 219f19a commit f4c9c85
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/scrape/czechvr.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,23 @@ func CzechVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out chan
})

// Tags
e.ForEach(`div.post div.tagyall div.tag`, func(id int, e *colly.HTMLElement) {
e.ForEach(`div.post div#info div#Tagy.tagy div.tag`, func(id int, e *colly.HTMLElement) {
sc.Tags = append(sc.Tags, strings.TrimSpace(e.Text))
})

// Cast
e.ForEach(`div.post div.featuring > a`, func(id int, e *colly.HTMLElement) {
e.ForEach(`div.post div#info div.modelky a span`, func(id int, e *colly.HTMLElement) {
sc.Cast = append(sc.Cast, strings.TrimSpace(e.Text))
})

// Date
e.ForEach(`div.post div.nazev div.datumDetail`, func(id int, e *colly.HTMLElement) {
e.ForEach(`div.post div#info div.datum`, func(id int, e *colly.HTMLElement) {
tmpDate, _ := goment.New(e.Text, "MMM DD, YYYY")
sc.Released = tmpDate.Format("YYYY-MM-DD")
})

// Duration
e.ForEach(`div.post div.nazev div.casDetail span.desktop`, func(id int, e *colly.HTMLElement) {
e.ForEach(`div.post div#info div.cas`, func(id int, e *colly.HTMLElement) {
tmpDuration, err := strconv.Atoi(strings.Split(e.Text, ":")[0])

if err == nil {
Expand All @@ -98,8 +98,10 @@ func CzechVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out chan
})

if config.Config.Funscripts.ScrapeFunscripts {
e.ForEach(`div.interactive`, func(id int, e *colly.HTMLElement) {
sc.HasScriptDownload = true
e.ForEach(`div.post div#info div#VideoTagy.tagy div.tag`, func(id int, e *colly.HTMLElement) {
if strings.TrimSpace(e.Text) == "Interactive" {
sc.HasScriptDownload = true
}
})
}

Expand All @@ -113,7 +115,7 @@ func CzechVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out chan
}

// Filenames
e.ForEach(`div.post div.download a.trailer`, func(id int, e *colly.HTMLElement) {
e.ForEach(`div.post div#download div.dlnew a`, func(id int, e *colly.HTMLElement) {
if id == 0 {
tmp := strings.Split(e.Attr("href"), "/")
parts := strings.Split(tmp[len(tmp)-1], "-")
Expand Down

0 comments on commit f4c9c85

Please sign in to comment.