diff --git a/servers/streamtape.py b/servers/streamtape.py index 6656d0aa..0aaba9c1 100644 --- a/servers/streamtape.py +++ b/servers/streamtape.py @@ -2,10 +2,11 @@ # -------------------------------------------------------- # Conector streamtape By Alfa development Group # -------------------------------------------------------- -from core import httptools, scrapertools +from core import httptools from platformcode import logger, config from core.support import match import sys +from lib import js2py PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int @@ -27,14 +28,9 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.debug("url=" + page_url) - video_urls = [] - find_url = match(data, patron=r'''innerHTML = ["']([^"]+)["'](?:\s*\+\s*['"(]+([^"']+))?''').match - possible_url = find_url[0] - possible_url += find_url[1][2:] - - if not possible_url: - possible_url = match(data, patron=r"innerHTML\\'\]=\\'([^']+)").match + find_url = match(data, patron=r'innerHTML = ([^;]+)').match + possible_url = js2py.eval_js(find_url) url = "https:" + possible_url url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") video_urls.append(['MP4 [Streamtape]', url])