Skip to content

Commit

Permalink
Update vrphub.go video duration
Browse files Browse the repository at this point in the history
  • Loading branch information
gaarder authored Jan 20, 2025
1 parent b3a3f49 commit 306c779
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions pkg/scrape/vrphub.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,13 @@ func VRPHub(wg *models.ScrapeWG, updateSite bool, knownScenes []string, out chan

// Duration
sc.Duration = 0
reDuration := regexp.MustCompile(`^WATCH FULL VIDEO ([0-9}+:*[0-9}*) MIN$`)
e.ForEach(`maxbutton-7 maxbutton maxbutton-get-the-full-video-now`, func(id int, e *colly.HTMLElement) {
tmpDuration, err := reDuration.FindStringSubmatch(e.Text)
if err != nil {
return
}
if tmpDuration != null {
reDuration := regexp.MustCompile(`^WATCH FULL VIDEO ([0-9]+:*[0-9]*) MIN$`)
e.ForEach(`a.maxbutton-get-the-full-video-now`, func(id int, e *colly.HTMLElement) {
tmpDuration := reDuration.FindStringSubmatch(e.Text)
if tmpDuration != nil {
intDuration, err := strconv.Atoi(strings.Split(tmpDuration[1],":")[0])
if err != nil {
if err == nil {
sc.Duration = intDuration
return
}
}
})
Expand Down

0 comments on commit 306c779

Please sign in to comment.