alcuni fix
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
||||||
"animeforce": "https://ww1.animeforce.org",
|
"animeforce": "https://ww1.animeforce.org",
|
||||||
"animeleggendari": "https://animeora.com",
|
"animeleggendari": "https://animeora.com",
|
||||||
"animesaturn": "https://www.animesaturn.com",
|
"animesaturn": "https://www.animesaturn.it",
|
||||||
"animestream": "https://www.animeworld.it",
|
"animestream": "https://www.animeworld.it",
|
||||||
"animesubita": "http://www.animesubita.org",
|
"animesubita": "http://www.animesubita.org",
|
||||||
"animetubeita": "http://www.animetubeita.com",
|
"animetubeita": "http://www.animetubeita.com",
|
||||||
|
|||||||
+39
-50
@@ -10,50 +10,12 @@ from platformcode import config
|
|||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers={'X-Requested-With': 'XMLHttpRequest'}
|
headers={'X-Requested-With': 'XMLHttpRequest'}
|
||||||
|
|
||||||
def get_data(item, head=[]):
|
|
||||||
global headers
|
|
||||||
jstr = ''
|
|
||||||
for h in head:
|
|
||||||
headers[h[0]] = h[1]
|
|
||||||
if not item.count: item.count = 0
|
|
||||||
if not config.get_setting('key', item.channel):
|
|
||||||
matches = support.match(item, patron=r'<script>(.*?location.href=".*?(http[^"]+)";)</').match
|
|
||||||
if matches:
|
|
||||||
jstr, location = matches
|
|
||||||
item.url=support.re.sub(r':\d+', '', location).replace('http://','https://')
|
|
||||||
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]
|
|
||||||
|
|
||||||
# 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';\s*location.href=".*?(http[^"]+)"')
|
|
||||||
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:
|
|
||||||
item.count += 1
|
|
||||||
config.set_setting('key', '', item.channel)
|
|
||||||
return get_data(item)
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
anime = ['/animelist?load_all=1&d=1',
|
anime = ['/animelist?load_all=1&d=1',
|
||||||
|
('ITA',['', 'submenu', '/filter?language%5B0%5D=1']),
|
||||||
|
('SUB-ITA',['', 'submenu', '/filter?language%5B0%5D=0']),
|
||||||
('Più Votati',['/toplist','menu', 'top']),
|
('Più Votati',['/toplist','menu', 'top']),
|
||||||
('In Corso',['/animeincorso','peliculas','incorso']),
|
('In Corso',['/animeincorso','peliculas','incorso']),
|
||||||
('Ultimi Episodi',['/fetch_pages.php?request=episodes&d=1','peliculas','updated'])]
|
('Ultimi Episodi',['/fetch_pages.php?request=episodes&d=1','peliculas','updated'])]
|
||||||
@@ -71,7 +33,7 @@ def search(item, texto):
|
|||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.infoger.error("%s" % line)
|
support.logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@@ -88,15 +50,34 @@ def newest(categoria):
|
|||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.infoger.error("{0}".format(line))
|
support.logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
@support.scrape
|
||||||
|
def submenu(item):
|
||||||
|
data = support.match(item.url + item.args).data
|
||||||
|
action = 'filter'
|
||||||
|
patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+><select id="(?P<parameter>[^"]+)"[^>]+>(?P<url>.*?)</select>'
|
||||||
|
def itemlistHook(itemlist):
|
||||||
|
itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), url=item.url + item.args, action='peliculas'))
|
||||||
|
return itemlist[:-1]
|
||||||
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
|
def filter(item):
|
||||||
|
itemlist = []
|
||||||
|
matches = support.match(item.url, patron=r'<option value="(?P<value>[^"]+)"[^>]*>(?P<title>[^<]+)').matches
|
||||||
|
for value, title in matches:
|
||||||
|
itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='peliculas', args='filter'))
|
||||||
|
support.thumb(itemlist, genre=True)
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
data=get_data(item)
|
|
||||||
patronMenu = r'<div class="col-md-13 bg-dark-as-box-shadow p-2 text-white text-center">(?P<title>[^"<]+)<(?P<other>.*?)(?:"lista-top"|"clearfix")'
|
patronMenu = r'<div class="col-md-13 bg-dark-as-box-shadow p-2 text-white text-center">(?P<title>[^"<]+)<(?P<other>.*?)(?:"lista-top"|"clearfix")'
|
||||||
action = 'peliculas'
|
action = 'peliculas'
|
||||||
item.args = 'top'
|
item.args = 'top'
|
||||||
@@ -109,12 +90,10 @@ def menu(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
data = get_data(item)
|
|
||||||
anime = True
|
anime = True
|
||||||
|
|
||||||
deflang= 'Sub-ITA'
|
deflang= 'Sub-ITA'
|
||||||
action = 'check'
|
action = 'check'
|
||||||
|
|
||||||
page = None
|
page = None
|
||||||
post = "page=" + str(item.page if item.page else 1) if item.page > 1 else None
|
post = "page=" + str(item.page if item.page else 1) if item.page > 1 else None
|
||||||
|
|
||||||
@@ -124,26 +103,37 @@ def peliculas(item):
|
|||||||
else:
|
else:
|
||||||
data = support.match(item, post=post, headers=headers).data
|
data = support.match(item, post=post, headers=headers).data
|
||||||
if item.args == 'updated':
|
if item.args == 'updated':
|
||||||
page= support.match(data, patron=r'data-page="(\d+)" title="Next">').match
|
page = support.match(data, patron=r'data-page="(\d+)" title="Next">').match
|
||||||
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-Za-z-]+)\))?"><img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s\s*(?P<type>[^\s]+)\s*(?P<episode>\d+)'
|
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-Za-z-]+)\))?"><img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s\s*(?P<type>[^\s]+)\s*(?P<episode>\d+)'
|
||||||
typeContentDict = {'Movie':'movie', 'Episodio':'episode'} #item.contentType='episode'
|
typeContentDict = {'Movie':'movie', 'Episodio':'episode'} #item.contentType='episode'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
if page:
|
if page:
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'),page= page, thumbnail=support.thumb()))
|
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'),page= page, thumbnail=support.thumb()))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
elif 'filter' in item.args:
|
||||||
|
page = support.match(data, patron=r'totalPages:\s*(\d+)').match
|
||||||
|
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-Za-z-]+)\))?"><img src="(?P<thumb>[^"]+)"'
|
||||||
|
def itemlistHook(itemlist):
|
||||||
|
if item.nextpage: item.nextpage += 1
|
||||||
|
else: item.nextpage = 2
|
||||||
|
if page and item.nextpage < int(page):
|
||||||
|
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), url= '{}&page={}'.format(item.url, item.nextpage), infoLabels={}, thumbnail=support.thumb()))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
else:
|
else:
|
||||||
pagination = ''
|
pagination = ''
|
||||||
if item.args == 'incorso':
|
if item.args == 'incorso':
|
||||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-za-z-]+)\))?</a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<'
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-za-z-]+)\))?</a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<'
|
||||||
else:
|
else:
|
||||||
|
debug=True
|
||||||
patron = r'<img src="(?P<thumb>[^"]+)" alt="(?P<title>[^"\(]+)(?:\((?P<lang>[Ii][Tt][Aa])\))?(?:\s*\((?P<year>\d+)\))?[^"]*"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a class="[^"]+" href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+><p[^>]+>(?:(?P<plot>[^<]+))?<'
|
patron = r'<img src="(?P<thumb>[^"]+)" alt="(?P<title>[^"\(]+)(?:\((?P<lang>[Ii][Tt][Aa])\))?(?:\s*\((?P<year>\d+)\))?[^"]*"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a class="[^"]+" href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+><p[^>]+>(?:(?P<plot>[^<]+))?<'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def check(item):
|
def check(item):
|
||||||
movie = support.match(get_data(item), patron=r'Episodi:</b> (\d*) Movie')
|
movie = support.match(item, patron=r'Episodi:</b> (\d*) Movie')
|
||||||
if movie.match:
|
if movie.match:
|
||||||
episodes = episodios(item)
|
episodes = episodios(item)
|
||||||
if len(episodes) > 0:
|
if len(episodes) > 0:
|
||||||
@@ -156,7 +146,6 @@ def check(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
data = get_data(item)
|
|
||||||
if item.contentType != 'movie': anime = True
|
if item.contentType != 'movie': anime = True
|
||||||
patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>'
|
patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>'
|
||||||
return locals()
|
return locals()
|
||||||
@@ -167,7 +156,7 @@ def findvideos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
page_data = ''
|
page_data = ''
|
||||||
titles =['Primario', 'Secondario', 'Alternativo Primario', 'Alternativo Secondario']
|
titles =['Primario', 'Secondario', 'Alternativo Primario', 'Alternativo Secondario']
|
||||||
url = support.match(get_data(item), patron=r'<a href="([^"]+)">[^>]+>[^>]+>G', headers=headers).match
|
url = support.match(item, patron=r'<a href="([^"]+)">[^>]+>[^>]+>G', headers=headers).match
|
||||||
urls = [url, url+'&extra=1', url+'&s=alt', url+'&s=alt&extra=1']
|
urls = [url, url+'&extra=1', url+'&s=alt', url+'&s=alt&extra=1']
|
||||||
links = []
|
links = []
|
||||||
for i, url in enumerate(urls):
|
for i, url in enumerate(urls):
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ def extract():
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
support.info('Non sono riuscito ad estrarre il file zip')
|
support.info('Non sono riuscito ad estrarre il file zip')
|
||||||
support.infoger.error(e)
|
support.logger.error(e)
|
||||||
import traceback
|
import traceback
|
||||||
support.infoger.error(traceback.print_exc())
|
support.logger.error(traceback.print_exc())
|
||||||
|
|
||||||
|
|
||||||
def setting():
|
def setting():
|
||||||
|
|||||||
@@ -77,8 +77,10 @@ class MainWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.getControl(RECOMANDED).addItems(self.items)
|
self.getControl(RECOMANDED).addItems(self.items)
|
||||||
self.getControl(FANART).setImage(Info.getProperty('fanart'))
|
self.getControl(FANART).setImage(Info.getProperty('fanart'))
|
||||||
self.getControl(ACTORS).addItems(self.actors)
|
self.getControl(ACTORS).addItems(self.actors)
|
||||||
self.getControl(CAST).addItems(self.cast)
|
if self.cast:
|
||||||
if Info.getProperty('mediainfo') != 'movie':
|
self.getControl(CAST).setVisible(True)
|
||||||
|
self.getControl(CAST).addItems(self.cast)
|
||||||
|
else:
|
||||||
self.getControl(CAST).setVisible(False)
|
self.getControl(CAST).setVisible(False)
|
||||||
if Info.getProperty('rating'):
|
if Info.getProperty('rating'):
|
||||||
self.getControl(RATING).setText(str(Info.getProperty('rating')))
|
self.getControl(RATING).setText(str(Info.getProperty('rating')))
|
||||||
|
|||||||
Reference in New Issue
Block a user