Skip to content

Commit

Permalink
Spin off kinkvr completely
Browse files Browse the repository at this point in the history
After some digging it appears kinkvr was sold and not a website redesign by badoink. Now completly separates kinkvr from badoink
  • Loading branch information
pops64 committed Nov 12, 2024
1 parent 48b8aea commit 04531a3
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions pkg/scrape/badoinkv2.go → pkg/scrape/kinkvr.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import (
"github.com/xbapps/xbvr/pkg/models"
)

func BadoinkSitev2(wg *models.ScrapeWG, updateSite bool, knownScenes []string, out chan<- models.ScrapedScene, singleSceneURL string, scraperID string, siteID string, domain string, singeScrapeAdditionalInfo string, limitScraping bool) error {
func KinkVR(wg *models.ScrapeWG, updateSite bool, knownScenes []string, out chan<- models.ScrapedScene, singleSceneURL string, singeScrapeAdditionalInfo string, limitScraping bool) error {
defer wg.Done()
scraperID := "kinkvr"
siteID := "KinkVR"
logScrapeStart(scraperID, siteID)

sceneCollector := createCollector(domain)
siteCollector := createCollector(domain)
sceneCollector := createCollector("kinkvr.com")
siteCollector := createCollector("kinkvr.com")

// These cookies are needed for age verification.
siteCollector.OnRequest(func(r *colly.Request) {
Expand All @@ -33,7 +35,7 @@ func BadoinkSitev2(wg *models.ScrapeWG, updateSite bool, knownScenes []string, o
sc.Studio = "Badoink"
sc.Site = siteID
sc.SiteID = ""
sc.HomepageURL, _ = strings.CutSuffix(e.Request.URL.String(), "/")
sc.HomepageURL = e.Request.URL.String()

// Cover Url
coverURL := e.ChildAttr("div#povVideoContainer dl8-video", "poster")
Expand Down Expand Up @@ -78,7 +80,8 @@ func BadoinkSitev2(wg *models.ScrapeWG, updateSite bool, knownScenes []string, o
sc.Title = e.ChildText("h1.page-title")

// Scene ID -- Uses the ending number of the video url instead of the ID used for the directory that the video link is stored in(Maintains backwards compatibility with old scenes)
tmp := strings.Split(sc.HomepageURL, "/")
tmpUrlStr, _ := strings.CutSuffix(e.Request.URL.String(), "/")
tmp := strings.Split(tmpUrlStr, "/")
siteIDstr := strings.Split(tmp[len(tmp)-1], "-")
sc.SiteID = siteIDstr[len(siteIDstr)-1]

Expand All @@ -98,7 +101,7 @@ func BadoinkSitev2(wg *models.ScrapeWG, updateSite bool, knownScenes []string, o
})

siteCollector.OnHTML(`div.video-grid-view a`, func(e *colly.HTMLElement) {
sceneURL, _ := strings.CutSuffix(e.Request.AbsoluteURL(e.Attr("href")), "/")
sceneURL := e.Request.AbsoluteURL(e.Attr("href"))
// If scene exist in database, there's no need to scrape
if !funk.ContainsString(knownScenes, sceneURL) {
sceneCollector.Visit(sceneURL)
Expand All @@ -108,7 +111,7 @@ func BadoinkSitev2(wg *models.ScrapeWG, updateSite bool, knownScenes []string, o
if singleSceneURL != "" {
sceneCollector.Visit(singleSceneURL)
} else {
siteCollector.Visit("https://" + domain + "/videos/page1")
siteCollector.Visit("https://kinkvr.com/videos/page1")
}

if updateSite {
Expand All @@ -118,10 +121,6 @@ func BadoinkSitev2(wg *models.ScrapeWG, updateSite bool, knownScenes []string, o
return nil
}

func KinkVR(wg *models.ScrapeWG, updateSite bool, knownScenes []string, out chan<- models.ScrapedScene, singleSceneURL string, singeScrapeAdditionalInfo string, limitScraping bool) error {
return BadoinkSitev2(wg, updateSite, knownScenes, out, singleSceneURL, "kinkvr", "KinkVR", "kinkvr.com", singeScrapeAdditionalInfo, limitScraping)
}

func init() {
registerScraper("kinkvr", "KinkVR", "https://kinkvr.com/icons/kinkvr/apple-touch-icon.png", "kinkvr.com", KinkVR)
}

0 comments on commit 04531a3

Please sign in to comment.