diff --git a/core/httptools.py b/core/httptools.py index f4a08d28..01bc33f7 100755 --- a/core/httptools.py +++ b/core/httptools.py @@ -43,7 +43,7 @@ HTTPTOOLS_DEFAULT_RANDOM_HEADERS = False domainCF = list() channelsCF = ['guardaserieclick', 'casacinema', 'dreamsub', 'ilgeniodellostreaming', 'piratestreaming', 'altadefinizioneclick', 'altadefinizione01_link'] -otherCF = ['altadefinizione-nuovo.link', 'wstream.video', 'akvideo.stream', 'backin.net'] +otherCF = ['altadefinizione-nuovo.link', 'wstream.video', 'akvideo.stream', 'backin.net', 'vcrypt.net'] for ch in channelsCF: domainCF.append(urlparse.urlparse(config.get_channel_url(name=ch)).hostname) domainCF.extend(otherCF) @@ -259,7 +259,7 @@ def downloadpage(url, **opt): domain = urlparse.urlparse(url).netloc global domainCF CF = False - if domain in domainCF: + if domain in domainCF or opt.get('cf', False): from lib import cloudscraper session = cloudscraper.create_scraper() CF = True diff --git a/lib/unshortenit.py b/lib/unshortenit.py index 9b272f6e..ccd9d725 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -519,12 +519,18 @@ class UnshortenIt(object): uri = '' logger.info('IP bannato da vcrypt, aspetta un ora') else: + prev_uri = uri uri = r.headers['location'] + if uri == prev_uri: + uri = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False, cf=True).headers['location'] + if "4snip" in uri: + logger.info('4SNIP: ' + uri) if 'out_generator' in uri: uri = re.findall('url=(.*)$', uri)[0] elif '/decode/' in uri: - uri = decrypt(uri.split('/')[-1]) + uri = httptools.downloadpage(uri, follow_redirects=True).url + # uri = decrypt(uri.split('/')[-1]) return uri, r.code if r else 200 except Exception as e: