Fix vcrypt

This commit is contained in:
Alhaziel01
2020-04-05 10:43:19 +02:00
parent a19a1cdec1
commit 1e004a7b2f
2 changed files with 9 additions and 3 deletions

View File

@@ -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

View File

@@ -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: