Skip to content

Commit

Permalink
scraper: add 8K filenames for BaDoinkVR sites
Browse files Browse the repository at this point in the history
add 8K naming
  • Loading branch information
theRealKLH authored Mar 26, 2024
1 parent 9914f7f commit 7519307
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions pkg/scrape/badoink.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func BadoinkSite(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out

commonDb, _ := models.GetCommonDB()

var Has6K7K bool = false
var UHD = "NO"

sceneCollector.OnHTML(`html`, func(e *colly.HTMLElement) {
sc := models.ScrapedScene{}
Expand Down Expand Up @@ -82,8 +82,12 @@ func BadoinkSite(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
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
UHD = "7K"
}
if strings.Contains(strings.TrimSpace(e.Text), "8K") {
UHD = "8K"
}

})
if scraperID == "vrcosplayx" {
sc.Tags = append(sc.Tags, "Cosplay", "Parody")
Expand Down Expand Up @@ -151,14 +155,20 @@ func BadoinkSite(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
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
UHD = "7K"
}
if strings.Contains(strings.TrimSpace(e.Text), "8K") {
UHD = "8K"
}
})

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 {
var filenames []string
switch UHD {
case "8K":
filenames = []string{"8k_180_180x180_3dh", "6k_180_180x180_3dh", "5k_180_180x180_3dh", "4k_HEVC_180_180x180_3dh", "8k_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"}
case "7K":
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"}
default:
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"}
}

for i := range filenames {
Expand Down

0 comments on commit 7519307

Please sign in to comment.