- Fix AltadefinizioneCommunity
- Fix HDmario e Streamtape
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@
|
||||
},
|
||||
"findhost": {
|
||||
"altadefinizioneclick": "https://altadefinizione-nuovo.click",
|
||||
"altadefinizionecommunity": "https://altaregistrazione.com",
|
||||
"altadefinizionecommunity": "https://altaregistrazione.net",
|
||||
"filmpertutti": "https://filmpertuttiii.nuovo.live",
|
||||
"streamingcommunity": "https://streamingcommunity-nuovo.link"
|
||||
}
|
||||
|
||||
@@ -9,11 +9,13 @@ from core import scrapertools, httptools
|
||||
|
||||
|
||||
def findhost(url):
|
||||
global register_url
|
||||
register_url = url
|
||||
return support.match(url, patron=r'<a href="([^"]+)/\w+">Accedi').match
|
||||
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
register_url = 'https://altaregistrazione.com'
|
||||
# register_url = 'https://altaregistrazione.com'
|
||||
headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'}
|
||||
|
||||
|
||||
@@ -44,7 +46,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')
|
||||
@@ -54,11 +56,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():
|
||||
@@ -139,17 +141,20 @@ def movies(item):
|
||||
action = 'findvideos'
|
||||
else:
|
||||
action = 'episodes'
|
||||
try:
|
||||
if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto
|
||||
import ast
|
||||
ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)', cloudscraper=True).match
|
||||
item.url = host + '/load-more-film?' + support.urlencode(ast.literal_eval(ajax)) + '&page=1'
|
||||
if not '/search' in item.url:
|
||||
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
|
||||
data = "\n".join(json['data'])
|
||||
else:
|
||||
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
|
||||
data = "\n".join(json['data'])
|
||||
except:
|
||||
data = ' '
|
||||
|
||||
if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto
|
||||
import ast
|
||||
ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)', cloudscraper=True).match
|
||||
item.url = host + '/load-more-film?' + support.urlencode(ast.literal_eval(ajax)) + '&page=1'
|
||||
if not '/search' in item.url:
|
||||
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
|
||||
data = "\n".join(json['data'])
|
||||
else:
|
||||
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
|
||||
data = "\n".join(json['data'])
|
||||
patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>(?P<rating>[^<]+)</span>\s*<span class="qual">(?P<quality>[^<]+)(?:[^>]+>){2}\s*<img src="(?P<thumbnail>[^"]+)(?:[^>]+>){1,6}\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?'
|
||||
|
||||
# paginazione
|
||||
@@ -233,6 +238,7 @@ def check(item):
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = []
|
||||
# logger.dbg()
|
||||
resolve_url(item)
|
||||
|
||||
itemlist.append(item.clone(action='play', url=support.match(item.url, patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality=''))
|
||||
@@ -252,8 +258,11 @@ 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="([^"]+)')
|
||||
data = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).data
|
||||
logger.debug()
|
||||
playWindow = support.match(data, patron='playWindow" href="([^"]+)')
|
||||
video_url = playWindow.match
|
||||
item.data = playWindow.data
|
||||
item.url = video_url.replace('/watch-unsubscribed', '/watch-external')
|
||||
|
||||
+2
-1
@@ -106,6 +106,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
global page, data
|
||||
page_url = page_url.replace('?', '')
|
||||
logger.debug("url=" + page_url)
|
||||
logger.dbg()
|
||||
|
||||
if 'unconfirmed' in page.url:
|
||||
id = page_url.split('/')[-1]
|
||||
@@ -132,7 +133,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
|
||||
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)
|
||||
|
||||
@@ -20,7 +20,7 @@ def test_video_exists(page_url):
|
||||
|
||||
data = httptools.downloadpage(page_url, headers=referer).data
|
||||
|
||||
if "Video not found" in data:
|
||||
if "Video not found" in data or 'Streamtape - Error' in data:
|
||||
return False, config.get_localized_string(70449) % 'Streamtape'
|
||||
|
||||
return True, ""
|
||||
|
||||
Reference in New Issue
Block a user