Alcuni Fix
This commit is contained in:
+47
-66
@@ -23,25 +23,28 @@ def get_data(item, head=[]):
|
||||
for h in head:
|
||||
headers[h[0]] = h[1]
|
||||
if not item.count: item.count = 0
|
||||
if not config.get_setting('key', item.channel):
|
||||
# resolve js for key
|
||||
jstr = support.match(item.url, patron=r'<script>(.*?)</').match
|
||||
if jstr:
|
||||
jshe = 'var document = {}, location = {}'
|
||||
aesjs = str(support.match(host + '/aes.min.js').data)
|
||||
js_fix = 'window.toHex = window.toHex || function(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}'
|
||||
jsret = 'return document.cookie'
|
||||
key_data = js2py.eval_js( 'function (){ ' + jshe + '\n' + aesjs + '\n' + js_fix + '\n' + jstr + '\n' + jsret + '}' )
|
||||
key = key_data().split(';')[0]
|
||||
jstr, location = support.match(item, patron=r'<script>(.*?location.href="([^"]+)";)</').match
|
||||
item.url=location.replace('http://','https://')
|
||||
if not config.get_setting('key', item.channel) and jstr:
|
||||
jshe = 'var document = {}, location = {}'
|
||||
aesjs = str(support.match(host + '/aes.min.js').data)
|
||||
js_fix = 'window.toHex = window.toHex || function(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}'
|
||||
jsret = 'return document.cookie'
|
||||
key_data = js2py.eval_js( 'function (){ ' + jshe + '\n' + aesjs + '\n' + js_fix + '\n' + jstr + '\n' + jsret + '}' )()
|
||||
key = key_data.split(';')[0]
|
||||
|
||||
# save Key in settings
|
||||
config.set_setting('key', key, item.channel)
|
||||
# save Key in settings
|
||||
config.set_setting('key', key, item.channel)
|
||||
|
||||
# set cookie
|
||||
headers['cookie'] = config.get_setting('key', item.channel)
|
||||
res = support.match(item, headers=headers, patron=r'location.href="([^"]+)')
|
||||
if res.match: data = support.match(res.match.replace('http://','https://'), headers=headers).data
|
||||
else: data = res.data
|
||||
res = support.match(item, headers=headers, patron=r';\s*location.href="([^"]+)"')
|
||||
if res.match:
|
||||
item.url= res.match.replace('http://','https://')
|
||||
data = support.match(item, headers=headers).data
|
||||
else:
|
||||
data = res.data
|
||||
|
||||
|
||||
#check that the key is still valid
|
||||
if 'document.cookie=' in data and item.count < 3:
|
||||
@@ -54,8 +57,8 @@ def get_data(item, head=[]):
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
anime=['/filter?sort=',
|
||||
('ITA',['/filter?language[]=1&sort=', 'menu', '1']),
|
||||
('SUB-ITA',['/filter?language[]=0&sort=', 'menu', '0']),
|
||||
('ITA',['/filter?dub=1&sort=', 'menu', '1']),
|
||||
('SUB-ITA',['/filter?dub=0&sort=', 'menu', '0']),
|
||||
('In Corso', ['/ongoing', 'peliculas','noorder']),
|
||||
('Ultimi Episodi', ['/updated', 'peliculas', 'updated']),
|
||||
('Nuove Aggiunte',['/newest', 'peliculas','noorder' ]),
|
||||
@@ -80,8 +83,7 @@ def genres(item):
|
||||
def menu(item):
|
||||
action = 'submenu'
|
||||
data = get_data(item)
|
||||
patronBlock=r'<form class="filters.*?>(?P<block>.*?)</form>'
|
||||
patronMenu=r'<button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"> (?P<title>.*?) <span.[^>]+>(?P<other>.*?)</ul>'
|
||||
patronMenu=r'<button[^>]+>\s*(?P<title>[A-Za-z0-9]+)\s*<span.[^>]+>(?P<other>.*?)</ul>'
|
||||
|
||||
def itemlistHook(itemlist):
|
||||
item.title = support.typo('Tutti','bold')
|
||||
@@ -97,7 +99,7 @@ def submenu(item):
|
||||
data = item.other
|
||||
patronMenu = r'<input.*?name="(?P<name>[^"]+)" value="(?P<value>[^"]+)"\s*>[^>]+>(?P<title>[^<]+)<\/label>'
|
||||
def itemHook(item):
|
||||
item.url = host + '/filter?' + item.name + '=' + item.value + '&language[]=' + item.args + '&sort='
|
||||
item.url = host + '/filter?' + item.name + '=' + item.value + '&dub=' + item.args + '&sort='
|
||||
return item
|
||||
return locals()
|
||||
|
||||
@@ -139,21 +141,20 @@ def peliculas(item):
|
||||
anime=True
|
||||
if item.args == 'updated':
|
||||
item.contentType='episode'
|
||||
patron=r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<lang>[^\)]+)\))?"[^>]+>[^>]+>\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?[^>]+>[^>]+>\s*<div class="ep">[^\d]+(?P<episode>\d+)[^<]*</div>'
|
||||
patron=r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img.*?src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<lang>[^\)]+)\))?"[^>]+>[^>]+>\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?[^>]+>[^>]+>\s*<div class="ep">[^\d]+(?P<episode>\d+)[^<]*</div>'
|
||||
action='findvideos'
|
||||
else:
|
||||
if item.args != 'noorder' and not item.url[-1].isdigit(): item.url += order() # usa l'ordinamento di configura canale
|
||||
patron= r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<year>\d+)\) )?(?:\((?P<lang>[^\)]+)\))?"[^>]+>[^>]+>(?:\s*<div class="dub">[^>]+>)?\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?'
|
||||
patron= r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img.*?src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<year>\d+)\) )?(?:\((?P<lang>[^\)]+)\))?"[^>]+>[^>]+>(?:\s*<div class="(?P<l>[^"]+)">[^>]+>)?\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?'
|
||||
action='episodios'
|
||||
|
||||
# Controlla la lingua se assente
|
||||
patronNext=r'href="([^"]+)" rel="next"'
|
||||
type_content_dict={'movie':['movie', 'special']}
|
||||
type_action_dict={'findvideos':['movie', 'special']}
|
||||
check_lang = item.url.replace('%5B0%5D','[]')
|
||||
typeContentDict={'movie':['movie', 'special']}
|
||||
typeActionDict={'findvideos':['movie', 'special']}
|
||||
def itemHook(item):
|
||||
if not item.contentLanguage:
|
||||
if 'language[]=1' in check_lang:
|
||||
if 'dub=1' in item.url or item.l == 'dub':
|
||||
item.contentLanguage = 'ITA'
|
||||
item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
||||
else:
|
||||
@@ -167,12 +168,10 @@ def peliculas(item):
|
||||
def episodios(item):
|
||||
anime=True
|
||||
pagination = 50
|
||||
item.url += '?d=1'
|
||||
data = get_data(item)
|
||||
support.log(data)
|
||||
if 'VVVVID' in data: patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)</ul>'
|
||||
else: patronBlock= r'server active(?P<block>.*?)server hidden '
|
||||
patron = r'<li><a [^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+" href="(?P<url>[^"]+)"[^>]+>(?P<episode>[^<]+)<'
|
||||
patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)<div class="server'
|
||||
patron = r'<li[^>]*>\s*<a.*?href="(?P<url>[^"]+)"[^>]*>(?P<episode>[^<]+)<'
|
||||
def itemHook(item):
|
||||
item.number = support.re.sub(r'\[[^\]]+\]', '', item.title)
|
||||
item.title += support.typo(item.fulltitle,'-- bold')
|
||||
@@ -185,39 +184,21 @@ def findvideos(item):
|
||||
import time
|
||||
support.log(item)
|
||||
itemlist = []
|
||||
# support.dbg()
|
||||
matches = support.match(get_data(item), patron=r'data-name="([0-9]+)">', headers=headers)
|
||||
data = matches.data
|
||||
matches = matches.matches
|
||||
videoData = []
|
||||
for serverid in matches:
|
||||
if not item.number: item.number = support.match(item.title, patron=r'(\d+) -').match
|
||||
block = support.match(data, patron=r'data-name="' + serverid + r'"[^>]+>(.*?)<div class="server').match
|
||||
match = support.match(block, patron=r'<a data-id="([^"]+)" data-base="' + (item.number if item.number else '1') + '"' + r'.*?href="([^"]+)"').match
|
||||
if match:
|
||||
ID, url = match
|
||||
|
||||
if serverid in ['18', '15']:
|
||||
url = support.match('%s/ajax/episode/serverPlayer?id=%s' % (host, ID), patron=r'source src="([^"]+)"', headers=headers).match
|
||||
itemlist.append(item.clone(action="play", title='Diretto', url=url, server='directo'))
|
||||
|
||||
elif serverid == '26':
|
||||
matches = support.match('%s/ajax/episode/serverPlayer?id=%s' % (host, item.url.split('/')[-1]), patron=r'<a href="([^"]+)"', ).matches
|
||||
for url in matches:
|
||||
videoData.append(url)
|
||||
elif serverid == '39':
|
||||
videoData.append(support.match(get_data(item.clone(url=host + url)), patron=r'href="([^"]+)" id="downloadLink"').match)
|
||||
else:
|
||||
try:
|
||||
dataJson=get_data(item.clone(url='%s/ajax/episode/info?id=%s&server=%s&ts=%s' % (host, ID, serverid, int(time.time()))), head=[['x-requested-with', 'XMLHttpRequest']])
|
||||
json = jsontools.load(dataJson)
|
||||
support.log(json)
|
||||
url = json['grabber']
|
||||
if 'server2' in url:
|
||||
itemlist.append(item.clone(action="play", title='AnimeWorld 2', url=url.split('=')[-1], server='directo'))
|
||||
else:
|
||||
videoData.append(url)
|
||||
except:
|
||||
pass
|
||||
return support.server(item, videoData, itemlist)
|
||||
|
||||
urls = []
|
||||
resp = support.match(get_data(item), headers=headers, patron=r'data-name="(\d+)">([^<]+)<')
|
||||
data = resp.data
|
||||
for ID, name in resp.matches:
|
||||
if 'vvvvid' in name.lower():
|
||||
urls.append(support.match(host + '/api/episode/serverPlayer?id=' + item.url.split('/')[-1].split('?')[0], headers=headers, patron=r'<a.*?href="([^"]+)"').match)
|
||||
elif 'streamtape' in name.lower():
|
||||
urls.append(support.match(data, patron=r'<a href="(https://streamtape[^"]+)"').match)
|
||||
elif 'beta' in name.lower():
|
||||
urls.append(support.match(data, patron=r'<a href="(https://animeworld[^"]+)"').match)
|
||||
elif 'server 2' in name.lower():
|
||||
dataJson = support.match(host + '/api/episode/info?id=' + item.url.split('/')[-1].split('?')[0] +'&alt=0', headers=headers).data
|
||||
json = jsontools.load(dataJson)
|
||||
itemlist.append(item.clone(action="play", title=name, url=json['grabber'], server='directo'))
|
||||
elif 'animeworld' in name.lower():
|
||||
url = support.match(resp.data, patron=r'href="([^"]+)"\s*id="alternativeDownloadLink"', headers=headers).match
|
||||
itemlist.append(item.clone(action="play", title=name, url=url, server='directo'))
|
||||
return support.server(item, urls, itemlist)
|
||||
|
||||
Reference in New Issue
Block a user