From 10cd0f26f27026ea431dd176ec13e86c8bbdba5b Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Thu, 21 Nov 2019 19:49:49 +0100 Subject: [PATCH] Fix Turbovid --- lib/unshortenit.py | 13 ++++++++++++- servers/decrypters/zcrypt.py | 9 +++++---- servers/turbovid.json | 4 ++-- servers/turbovid.py | 10 +++++----- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lib/unshortenit.py b/lib/unshortenit.py index 854ea15b..f87e4297 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -37,6 +37,7 @@ class UnshortenIt(object): _rapidcrypt_regex = r'rapidcrypt\.net' _cryptmango_regex = r'cryptmango|xshield\.net' _vcrypt_regex = r'vcrypt\.net' + _linkup_regex = r'linkup\.pro' _maxretries = 5 @@ -78,6 +79,8 @@ class UnshortenIt(object): return self._unshorten_cryptmango(uri) if re.search(self._vcrypt_regex, uri, re.IGNORECASE): return self._unshorten_vcrypt(uri) + if re.search(self._linkup_regex, uri, re.IGNORECASE): + return self._unshorten_linkup(uri) return uri, 0 @@ -513,7 +516,15 @@ class UnshortenIt(object): return uri, r.code if r else 200 except Exception as e: return uri, str(e) - + + + def _unshorten_linkup(self, uri): + try: + r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False) + return r.url, r.code + + except Exception as e: + return uri, str(e) def unwrap_30x_only(uri, timeout=10): unshortener = UnshortenIt() diff --git a/servers/decrypters/zcrypt.py b/servers/decrypters/zcrypt.py index 5372ea4a..8eedbbd8 100644 --- a/servers/decrypters/zcrypt.py +++ b/servers/decrypters/zcrypt.py @@ -49,7 +49,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= elif 'vcrypt.net' in url: if 'myfoldersakstream.php' in url or '/verys/' in url: continue - else: + else: from lib import unshortenit data, status = unshortenit.unshorten(url) logger.info("Data - Status zcrypt vcrypt.net: [%s] [%s] " %(data, status)) @@ -63,9 +63,10 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= data = scrapertoolsV2.find_single_match(idata, 'action="(?:[^/]+.*?/[^/]+/([a-zA-Z0-9_]+))">') from lib import unshortenit data, status = unshortenit.unshorten(url) - logger.info("Data - Status zcrypt linkup : [%s] [%s] " %(data, status)) + # logger.info("Data - Status zcrypt linkup : [%s] [%s] " %(data, status)) + data = httptools.downloadpage(data, follow_redirect=True).url if '/speedx/' in data: # aggiunto per server speedvideo - data = data.replace('http://linkup.pro/speedx', 'http://speedvideo.net') + data = data.replace('http://linkup.pro/speedx', 'http://speedvideo.net') # fix by greko fine else: data = "" @@ -90,7 +91,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= for url in matches: if url not in encontrados: if 'https://rapidcrypt.net/open/' in url or 'https://rapidcrypt.net/verys/' in url: - continue + continue logger.info(" url=" + url) encontrados.add(url) diff --git a/servers/turbovid.json b/servers/turbovid.json index b5c53581..0871ca45 100644 --- a/servers/turbovid.json +++ b/servers/turbovid.json @@ -11,7 +11,7 @@ }, "free": true, "id": "turbovid", - "name": "turbovid", + "name": "Turbovid", "settings": [ { "default": false, @@ -38,5 +38,5 @@ "visible": false } ], - "thumbnail": "http://turbovid.me/img/logo.png" + "thumbnail": "server_turbovid.png" } diff --git a/servers/turbovid.py b/servers/turbovid.py index 9235834e..77931d3b 100644 --- a/servers/turbovid.py +++ b/servers/turbovid.py @@ -11,12 +11,12 @@ def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) data = httptools.downloadpage(page_url).data if "Not Found" in data or "File Does not Exist" in data: - return False, "[turbovid.me] El fichero no existe o ha sido borrado" + return False, config.get_localized_string(70449) % "Turbovid" return True, "" -def get_video_url(page_url, premium=False, user="", password="", video_password="", server='turbovid'): - +def get_video_url(page_url, premium=False, user="", password="", video_password="", server='Turbovid'): + logger.info("(turbovid page_url='%s')" % page_url) video_urls = [] data = httptools.downloadpage(page_url).data @@ -28,8 +28,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= time.sleep(6) data = httptools.downloadpage(page_url_post, post=post).data logger.info("(data page_url='%s')" % data) - sources = scrapertools.find_single_match(data, 'sources: \[([^\]]+)\]') - + sources = scrapertools.find_single_match(data, r'sources: \[([^\]]+)\]') + for media_url in scrapertools.find_multiple_matches(sources, '"([^"]+)"'): media_url = media_url.replace('https:', 'http:') ext = scrapertools.get_filename_from_url(media_url)[-4:]