From e42056ddc367eeaa6134e60d3b0984529d79b963 Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 27 Jun 2026 16:17:33 +0200 Subject: bugfix --- helper.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/helper.go b/helper.go index 52fb003..693972f 100644 --- a/helper.go +++ b/helper.go @@ -125,7 +125,7 @@ func normalizeUrl(url string) string { url = r.ReplaceAllString(url, "/www.youtube.com/") } - /** + /**] * Redirect m.imdb.com to desktop version */ match, err = regexp.MatchString("/m.imdb.com/", url) @@ -136,7 +136,21 @@ func normalizeUrl(url string) string { log.Debug("normalize: ", "m.imdb.com ", url) r := regexp.MustCompile("/m.imdb.com/") - url = r.ReplaceAllString(url, "/www.imdb.com") + url = r.ReplaceAllString(url, "/www.imdb.com/") + } + + /** + * Redirect other versions of imdb to desktop version + */ + match, err = regexp.MatchString("/www.[a-z]+.imdb.com/", url) + if err != nil { + log.Fatal(err) + } + if match { + log.Debug("normalize: ", "www.[a-z]+.imdb.com ", url) + + r := regexp.MustCompile("/www.[a-z]+.imdb.com/") + url = r.ReplaceAllString(url, "/www.imdb.com/") } /** -- cgit v1.2.3