Skip to content

Commit

Permalink
Merge branch 'slr_changes_1001' into RFTW
Browse files Browse the repository at this point in the history
  • Loading branch information
theRealKLH committed Oct 8, 2023
2 parents 5f98c56 + bb08d3a commit eeda6ad
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions pkg/scrape/slrstudios.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,14 @@ func SexLikeReal(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
// Note: known issue with SLR, they use a lot of combined tags like "cheerleader / college / school"
// ...a lot of these are shared with RealJamVR which uses the same tags though.
// Could split by / but would run into issues with "f/f/m" and "shorts / skirts"
var videotype string

var FB360 string
alphA := "false"
e.ForEach(`ul.c-meta--scene-tags li a`, func(id int, e *colly.HTMLElement) {
if !skiptags[e.Attr("title")] {
sc.Tags = append(sc.Tags, e.Attr("title"))
}

// To determine filenames
if e.Attr("title") == "Fisheye" || e.Attr("title") == "360°" {
videotype = e.Attr("title")
}
if e.Attr("title") == "Spatial audio" {
FB360 = "_FB360.MKV"
}
Expand All @@ -120,6 +116,17 @@ func SexLikeReal(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out

})

// To determine filenames
var videotype string
e.ForEach(`ul.c-meta--scene-specs li a`, func(id int, e *colly.HTMLElement) {
if e.Attr("title") == "190°" || e.Attr("title") == "200°" || e.Attr("title") == "220°" || e.Attr("title") == "360°" || e.Attr("title") == "fisheye" {
videotype = e.Attr("title")
if !skiptags[e.Attr("title")] {
sc.Tags = append(sc.Tags, e.Attr("title"))
}
}
})

// Duration
sc.Duration = e.Request.Ctx.GetAny("duration").(int)

Expand Down Expand Up @@ -358,15 +365,15 @@ func SexLikeReal(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
func appendFilenames(sc *models.ScrapedScene, siteID string, filenameRegEx *regexp.Regexp, videotype string, FB360 string, AlphA string) {
// Only shown for logged in users so need to generate them
// Format: SLR_siteID_Title_<Resolutions>_SceneID_<LR/TB>_<180/360>.mp4
resolutions := []string{"_6400p_", "_4096p_", "_4000p_", "_3840p_", "_3360p_", "_3160p_", "_3072p_", "_3000p_", "_2900p_", "_2880p_", "_2700p_", "_2650p_", "_2160p_", "_1920p_", "_1440p_", "_1080p_", "_original_"}
resolutions := []string{"_6400p_", "_4096p_", "_4000p_", "_3840p_", "_3360p_", "_3160p_", "_3072p_", "_3000p_", "_2900p_", "_2880p_", "_2700p_", "_2650p_", "_2160p_", "_1920p_", "_1620p_", "_1440p_", "_1080p_", "_original_"}
baseName := "SLR_" + strings.TrimSuffix(siteID, " (SLR)") + "_" + filenameRegEx.ReplaceAllString(sc.Title, "_")
switch videotype {
case "360°": // Sadly can't determine if TB or MONO so have to add both
for i := range resolutions {
sc.Filenames = append(sc.Filenames, baseName+resolutions[i]+sc.SiteID+"_MONO_360.mp4")
sc.Filenames = append(sc.Filenames, baseName+resolutions[i]+sc.SiteID+"_TB_360.mp4")
}
case "Fisheye": // 200° videos named with MKX200
case "190°", "200°", "220°", "fisheye": // 200° videos named with MKX200
for i := range resolutions {
if AlphA == "true" {
sc.Filenames = append(sc.Filenames, baseName+resolutions[i]+sc.SiteID+"_MKX200_alpha.mp4")
Expand Down

0 comments on commit eeda6ad

Please sign in to comment.