Skip to content

Commit

Permalink
scraper: add 6K filenames for BaDoinkVR sites (xbapps#1617)
Browse files Browse the repository at this point in the history
* Update badoink.go

Adding 6K filenames to BaDoink network scraper. They should always been included when 7K filenames are present.

* Update badoink.go

* Fix

* Gofmt
  • Loading branch information
vt-idiot authored Feb 12, 2024
1 parent d5967c0 commit bc15228
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pkg/scrape/badoink.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func BadoinkSite(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out

commonDb, _ := models.GetCommonDB()

var Has6K7K bool = false

sceneCollector.OnHTML(`html`, func(e *colly.HTMLElement) {
sc := models.ScrapedScene{}
sc.ScraperID = scraperID
Expand Down Expand Up @@ -79,6 +81,9 @@ func BadoinkSite(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
// Tags
e.ForEach(`a.video-tag`, func(id int, e *colly.HTMLElement) {
sc.Tags = append(sc.Tags, strings.TrimSpace(e.Text))
if strings.Contains(strings.TrimSpace(e.Text), "7K") {
Has6K7K = true
}
})
if scraperID == "vrcosplayx" {
sc.Tags = append(sc.Tags, "Cosplay", "Parody")
Expand Down Expand Up @@ -143,7 +148,18 @@ func BadoinkSite(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
fragmentName := strings.Split(fpName, "/")
baseName := fragmentName[len(fragmentName)-1]

filenames := []string{"samsung_180_180x180_3dh", "oculus_180_180x180_3dh", "mobile_180_180x180_3dh", "7k_180_180x180_3dh", "5k_180_180x180_3dh", "4k_HEVC_180_180x180_3dh", "samsung_180_180x180_3dh_LR", "oculus_180_180x180_3dh_LR", "mobile_180_180x180_3dh_LR", "7k_180_180x180_3dh_LR", "5k_180_180x180_3dh_LR", "4k_HEVC_180_180x180_3dh_LR", "ps4_180_sbs", "ps4_pro_180_sbs"}
e.ForEach(`a.video-tag`, func(id int, e *colly.HTMLElement) {
sc.Tags = append(sc.Tags, strings.TrimSpace(e.Text))
if strings.Contains(strings.TrimSpace(e.Text), "7K") {
Has6K7K = true
}
})

filenames := []string{"samsung_180_180x180_3dh", "oculus_180_180x180_3dh", "mobile_180_180x180_3dh", "5k_180_180x180_3dh", "4k_HEVC_180_180x180_3dh", "samsung_180_180x180_3dh_LR", "oculus_180_180x180_3dh_LR", "mobile_180_180x180_3dh_LR", "5k_180_180x180_3dh_LR", "4k_HEVC_180_180x180_3dh_LR", "ps4_180_sbs", "ps4_pro_180_sbs"}

if Has6K7K {
filenames = []string{"7k_180_180x180_3dh", "6k_180_180x180_3dh", "5k_180_180x180_3dh", "4k_HEVC_180_180x180_3dh", "7k_180_180x180_3dh_LR", "6k_180_180x180_3dh_LR", "5k_180_180x180_3dh_LR", "4k_HEVC_180_180x180_3dh_LR", "samsung_180_180x180_3dh", "oculus_180_180x180_3dh", "mobile_180_180x180_3dh", "samsung_180_180x180_3dh_LR", "oculus_180_180x180_3dh_LR", "mobile_180_180x180_3dh_LR", "ps4_180_sbs", "ps4_pro_180_sbs"}
}

for i := range filenames {
filenames[i] = baseName + "_" + filenames[i] + ".mp4"
Expand Down

0 comments on commit bc15228

Please sign in to comment.