- Fix Altadefinizione Community

- Fix HDMario
 - Fix Streamtape
This commit is contained in:
Alhaziel01
2021-10-01 09:52:17 +02:00
parent 8afa165501
commit a5ba79d176
3 changed files with 7 additions and 6 deletions

View File

@@ -49,7 +49,7 @@ def mainlist(item):
def login():
r = support.httptools.downloadpage(host, cloudscraper=True)
Token = support.match(r.data, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)', cloudscraper=True).match
if 'id="logged"' in r.text:
if 'id="logged"' in r.data:
logger.info('Già loggato')
else:
logger.info('Login in corso')
@@ -59,11 +59,11 @@ def login():
'password':config.get_setting('password', channel='altadefinizionecommunity')}
r = support.httptools.downloadpage(host + '/login', post=post, headers={'referer': host}, cloudscraper=True)
if not r.status_code in [200, 302] or 'Email o Password non validi' in r.text:
if not r.status_code in [200, 302] or 'Email o Password non validi' in r.data:
platformtools.dialog_ok('AltadefinizioneCommunity', 'Username/password non validi')
return False
return 'id="logged"' in r.text
return 'id="logged"' in r.data
def registerOrLogin():
@@ -259,6 +259,7 @@ def play(item):
def resolve_url(item):
registerOrLogin()
if '/watch-unsubscribed' not in item.url and '/watch-external' not in item.url:
playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)')
video_url = playWindow.match

View File

@@ -130,9 +130,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
page = httptools.downloadpage(page_url)
data = page.data
logger.debug(data)
# logger.debug(data)
from lib import jsunpack_js2py
unpacked = jsunpack_js2py.unpack(scrapertools.find_single_match(data, '<script type="text/javascript">\n*\s*\n*(eval.*)'))
unpacked = jsunpack_js2py.unpack(scrapertools.find_single_match(data, '(eval.*?)</'))
# p,a,c,k,e,d data -> xhr.setRequestHeader
secureProof = scrapertools.find_single_match(unpacked, """X-Secure-Proof['"]\s*,\s*['"]([^"']+)""")
logger.debug('X-Secure-Proof=' + secureProof)

View File

@@ -21,7 +21,7 @@ def test_video_exists(page_url):
page = httptools.downloadpage(page_url, headers=referer)
data = page.data
if "Video not found" in data or page.code >= 400:
if "Video not found" in data or page.code >= 400 or 'Streamtape - Error' in data:
return False, config.get_localized_string(70449) % 'Streamtape'
return True, ""