From bb08d3a9a04f61ac34bf8354535bb455cacd3734 Mon Sep 17 00:00:00 2001 From: theRealKLH <65736720+theRealKLH@users.noreply.github.com> Date: Sun, 8 Oct 2023 13:52:31 -0400 Subject: [PATCH] slr changes videotype - fisheye options --- pkg/scrape/slrstudios.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkg/scrape/slrstudios.go b/pkg/scrape/slrstudios.go index 4c0b2f353..fbd413d68 100644 --- a/pkg/scrape/slrstudios.go +++ b/pkg/scrape/slrstudios.go @@ -97,7 +97,7 @@ 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) { @@ -105,10 +105,6 @@ func SexLikeReal(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out 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" } @@ -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) @@ -358,7 +365,7 @@ 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__SceneID__<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 @@ -366,7 +373,7 @@ func appendFilenames(sc *models.ScrapedScene, siteID string, filenameRegEx *rege 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")