Skip to content

Commit

Permalink
Merge pull request #3 from alexnsfw/wankzvr-milfvr-gallery
Browse files Browse the repository at this point in the history
scraper: gallery for WankzVR and MilfVR scenes
  • Loading branch information
vt-idiot authored Apr 29, 2023
2 parents ae719a8 + 350d68a commit 787a9c1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/scrape/povr.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package scrape

import (
"fmt"
"path"
"regexp"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -62,10 +64,19 @@ func POVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out chan<-
sc.Filenames = append(sc.Filenames, base+"gearvr-180_180x180_3dh_LR.mp4")
sc.Filenames = append(sc.Filenames, base+"smartphone-180_180x180_3dh_LR.mp4")

// Cover URLs
// Cover URLs, and gallery for MilfVR & WankzVR
e.ForEach(`meta[property="og:image"]`, func(id int, e *colly.HTMLElement) {
if id == 0 {
sc.Covers = append(sc.Covers, strings.Split(e.Request.AbsoluteURL(e.Attr("content")), "?")[0])
thumbSizes := map[string]int{"MilfVR": 1280, "WankzVR": 1024}
if thumbSize, found := thumbSizes[siteID]; found {
re := regexp.MustCompile(`/[^/]*/[^/]*$`)
galleryBaseUrl := re.ReplaceAllString(sc.Covers[0], "/thumbs")
sc.Gallery = make([]string, 6)
for i := 0; i < 6; i++ {
sc.Gallery[i] = fmt.Sprintf("%s/%d_%d.jpg", galleryBaseUrl, thumbSize, i+1)
}
}
}
})

Expand Down

0 comments on commit 787a9c1

Please sign in to comment.