summaryrefslogtreecommitdiff
path: root/helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'helper.go')
-rw-r--r--helper.go18
1 files 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/")
}
/**