From 3557b8aa5e983d74ba52132e81468a3effdb055b Mon Sep 17 00:00:00 2001 From: crwxaj <52156245+crwxaj@users.noreply.github.com> Date: Sun, 5 Nov 2023 14:08:44 +0100 Subject: [PATCH] scraper: Fix VRBangers crash (#1466) Co-authored-by: crwxaj --- pkg/scrape/vrbangers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/scrape/vrbangers.go b/pkg/scrape/vrbangers.go index 2702adc54..7bb556b82 100755 --- a/pkg/scrape/vrbangers.go +++ b/pkg/scrape/vrbangers.go @@ -32,7 +32,11 @@ func VRBangersSite(wg *sync.WaitGroup, updateSite bool, knownScenes []string, ou sc.Site = siteID sc.HomepageURL = strings.Split(e.Request.URL.String(), "?")[0] - content_id := strings.Split(strings.Replace(sc.HomepageURL, "//", "/", -1), "/")[3] + parts := strings.Split(strings.Replace(sc.HomepageURL, "//", "/", -1), "/") + if len(parts) < 4 { + return + } + content_id := parts[3] //https://content.vrbangers.com contentURL := strings.Replace(URL, "//", "//content.", 1)