From 76c763dff0da6c64702cd8c79b5c9d59658565cc Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 18 Oct 2019 21:09:07 +0200 Subject: [PATCH] fix cineblog --- channels/cineblog01.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/channels/cineblog01.py b/channels/cineblog01.py index 7da7c680..19358108 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -19,12 +19,13 @@ headers = "" def findhost(): global host, headers permUrl = httptools.downloadpage('https://www.cb01.uno/', follow_redirects=False).headers - support.log('HOST= ',permUrl) - host = permUrl['location'].replace('https://www.google.it/search?q=site:', '').replace('https://www.google.it/search?&q=', '') - support.log('HOST ',host, ' ', host[:4]) - if host[:4] != 'http': - host = 'https://' + host - support.log('HOST= ',host) + if 'google' in permUrl['location']: + if host[:4] != 'http': + host = 'https://'+permUrl['location'].replace('https://www.google.it/search?q=site:', '') + else: + host = permUrl['location'].replace('https://www.google.it/search?q=site:', '') + else: + host = permUrl['location'] headers = [['Referer', host]] IDIOMAS = {'Italiano': 'IT'}