diff options
Diffstat (limited to 'helper.go')
| -rw-r--r-- | helper.go | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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/") } /** |
