diff --git a/channels/cinemalibero.py b/channels/cinemalibero.py index a237bab1..c3329868 100644 --- a/channels/cinemalibero.py +++ b/channels/cinemalibero.py @@ -14,7 +14,11 @@ list_quality = ['default'] def findhost(): permUrl = httptools.downloadpage('https://www.cinemalibero.online/', follow_redirects=False).headers - return 'https://www.' + permUrl['location'].replace('https://www.google.com/search?q=site:', '') + import urlparse + p = list(urlparse.urlparse(permUrl['location'].replace('https://www.google.com/search?q=site:', ''))) + if not p[0]: + p[0] = 'https' + return urlparse.urlunparse(p) host = config.get_channel_url(findhost) headers = [['Referer', host]] diff --git a/lib/unshortenit.py b/lib/unshortenit.py index 224e5adf..f6509c2b 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -515,7 +515,8 @@ class UnshortenIt(object): return uri, r.code if r else 200 except Exception as e: - return uri, str(e) + logger.error(e) + return uri, 0 def _unshorten_linkup(self, uri):