From 133f220674cf4a1e6e24c38f06b436cd17941bb2 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 18 Nov 2020 12:50:31 +0100 Subject: [PATCH] Fix Streamtape --- servers/streamtape.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/servers/streamtape.py b/servers/streamtape.py index d4fcf845..a2b4b4a2 100644 --- a/servers/streamtape.py +++ b/servers/streamtape.py @@ -1,19 +1,15 @@ - # -*- coding: utf-8 -*- # -------------------------------------------------------- # Conector streamtape By Alfa development Group # -------------------------------------------------------- -import re -from core import httptools -from core import scrapertools -from platformcode import logger +from core import httptools, scrapertools +from platformcode import logger, config import sys PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int - def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) global data @@ -23,7 +19,7 @@ def test_video_exists(page_url): data = httptools.downloadpage(page_url, headers=referer).data if "Video not found" in data: - return False, "[streamtape] El archivo no existe o ha sido borrado" + return False, config.get_localized_string(70449) % 'Streamtape' return True, "" @@ -32,7 +28,10 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= logger.info("url=" + page_url) video_urls = [] - url = "https:" + scrapertools.find_single_match(data, 'innerHTML = "([^"]+)') + possible_url = scrapertools.find_single_match(data, 'innerHTML = "([^"]+)') + if not '\\' in possible_url: + possible_url = scrapertools.find_single_match(data, "innerHTML\\'\]=\\'([^']+)") + url = "https:" + possible_url url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") - video_urls.append(['MP4 [streamtape]', url]) + video_urls.append(['MP4 [Streamtape]', url]) return video_urls \ No newline at end of file