Fix support e autorenumber, Aggiunto Animeworld
This commit is contained in:
@@ -23,57 +23,42 @@ list_servers = ['animeworld', 'verystream', 'streamango', 'openload', 'directo']
|
||||
list_quality = ['default', '480p', '720p', '1080p']
|
||||
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
log()
|
||||
|
||||
itemlist =[]
|
||||
|
||||
support.menu(itemlist, 'ITA submenu bold', 'build_menu', host + '/filter?', args=["anime", 'language[]=1'])
|
||||
support.menu(itemlist, 'Sub-ITA submenu bold', 'build_menu', host + '/filter?', args=["anime", 'language[]=0'])
|
||||
('Archivio A-Z ', ['/az-list', 'alfabetico', ]), args=["tvshow","a-z"])
|
||||
('In corso ', ['/', 'video', ]), args=["in sala"])
|
||||
('Generi ', ['/')
|
||||
support.menu(itemlist, 'generi', ]), 'Ultimi Aggiunti bold', 'video', host+'/newest', args=["anime"])
|
||||
support.menu(itemlist, 'Ultimi Episodi bold', 'video', host+'/updated', args=["novita'"])
|
||||
support.menu(itemlist, 'Cerca...', 'search')
|
||||
support.aplay(item, itemlist, list_servers, list_quality)
|
||||
support.channel_config(item, itemlist)
|
||||
return itemlist
|
||||
anime=['/filter',
|
||||
('ITA',['/filter?language%5B%5D=1&sort=2', 'build_menu', 'language[]=1']),
|
||||
('SUB-ITA',['/filter?language%5B%5D=1&sort=2', 'build_menu', 'language[]=0']),
|
||||
('In Corso', ['/ongoing', 'peliculas']),
|
||||
('Ultimi Episodi', ['/updated', 'peliculas', 'updated']),
|
||||
('Nuove Aggiunte',['/newest', 'peliculas' ]),
|
||||
('Generi',['','genres', '</i> Generi</a>'])]
|
||||
return locals()
|
||||
|
||||
# Crea menu dei generi =================================================
|
||||
# Crea menu ===================================================
|
||||
|
||||
def generi(item):
|
||||
log()
|
||||
patron_block = r'</i>\sGeneri</a>\s*<ul class="sub">(.*?)</ul>'
|
||||
patron = r'<a href="([^"]+)"\stitle="([^"]+)">'
|
||||
|
||||
return support.scrape(item, patron, ['url','title'], patron_block=patron_block, action='video')
|
||||
|
||||
|
||||
# Crea Menu Filtro ======================================================
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
patronBlock = r'</i> Generi</a>(?P<block>.*?)</ul>'
|
||||
patronMenu = r'<a href="(?P<url>[^"]+)"\stitle="(?P<title>[^"]+)">'
|
||||
action = 'peliculas'
|
||||
return locals()
|
||||
|
||||
def build_menu(item):
|
||||
log()
|
||||
itemlist = []
|
||||
support.menu(itemlist, 'Tutti bold submenu', 'video', item.url+item.args[1])
|
||||
matches, data = support.match(item,r'<button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"> (.*?) <span.*?>(.*?)<\/ul>',r'<form class="filters.*?>(.*?)<\/form>')
|
||||
log('ANIME DATA =' ,data)
|
||||
support.menuItem(itemlist, __channel__, 'Tutti bold', 'peliculas', item.url, 'tvshow' , args=item.args)
|
||||
matches = support.match(item,r'<button class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown"> (.*?) <span.[^>]+>(.*?)</ul>',r'<form class="filters.*?>(.*?)</form>')[0]
|
||||
for title, html in matches:
|
||||
if title not in 'Lingua Ordine':
|
||||
support.menu(itemlist, title + ' submenu bold', 'build_sub_menu', html, args=item.args)
|
||||
log('ARGS= ', item.args[0])
|
||||
log('ARGS= ', html)
|
||||
support.menuItem(itemlist, __channel__, title + ' submenu bold', 'build_sub_menu', html, 'tvshow', args=item.args)
|
||||
return itemlist
|
||||
|
||||
# Crea SottoMenu Filtro ======================================================
|
||||
|
||||
def build_sub_menu(item):
|
||||
log()
|
||||
itemlist = []
|
||||
matches = re.compile(r'<input.*?name="([^"]+)" value="([^"]+)"\s*>[^>]+>([^<]+)<\/label>', re.DOTALL).findall(item.url)
|
||||
matches = support.re.compile(r'<input.*?name="([^"]+)" value="([^"]+)"\s*>[^>]+>([^<]+)<\/label>', re.DOTALL).findall(item.url)
|
||||
for name, value, title in matches:
|
||||
support.menu(itemlist, support.typo(title, 'bold'), 'video', host + '/filter?' + '&' + name + '=' + value + '&' + item.args[1])
|
||||
support.menuItem(itemlist, __channel__, support.typo(title, 'bold'), 'peliculas', host + '/filter?&' + name + '=' + value + '&' + item.args + '&sort=2', 'tvshow', args='sub')
|
||||
return itemlist
|
||||
|
||||
# Novità ======================================================
|
||||
@@ -84,12 +69,9 @@ def newest(categoria):
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
item.url = host + '/newest'
|
||||
item.action = "video"
|
||||
itemlist = video(item)
|
||||
|
||||
if itemlist[-1].action == "video":
|
||||
itemlist.pop()
|
||||
item.url = host + '/updated'
|
||||
item.args = "updated"
|
||||
return peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
@@ -106,7 +88,7 @@ def search(item, texto):
|
||||
log(texto)
|
||||
item.url = host + '/search?keyword=' + texto
|
||||
try:
|
||||
return video(item)
|
||||
return peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
@@ -114,188 +96,50 @@ def search(item, texto):
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
# Scrapers ========================================================
|
||||
|
||||
# Lista A-Z ====================================================
|
||||
|
||||
def alfabetico(item):
|
||||
return support.scrape(item, '<a href="([^"]+)" title="([^"]+)">', ['url', 'title'], patron_block=r'<span>.*?A alla Z.<\/span>.*?<ul>(.*?)<\/ul>', action='lista_anime')
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
anime=True
|
||||
if item.args == 'updated':
|
||||
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:
|
||||
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>)?'
|
||||
action='episodios'
|
||||
|
||||
|
||||
def lista_anime(item):
|
||||
log()
|
||||
itemlist = []
|
||||
matches ,data = support.match(item, r'<div class="item"><a href="([^"]+)".*?src="([^"]+)".*?data-jtitle="([^"]+)".*?>([^<]+)<\/a><p>(.*?)<\/p>')
|
||||
for scrapedurl, scrapedthumb, scrapedoriginal, scrapedtitle, scrapedplot in matches:
|
||||
|
||||
if scrapedoriginal == scrapedtitle:
|
||||
scrapedoriginal=''
|
||||
else:
|
||||
scrapedoriginal = support.typo(scrapedoriginal,' -- []')
|
||||
|
||||
year = ''
|
||||
lang = ''
|
||||
infoLabels = {}
|
||||
if '(' in scrapedtitle:
|
||||
year = scrapertoolsV2.find_single_match(scrapedtitle, r'(\([0-9]+\))')
|
||||
lang = scrapertoolsV2.find_single_match(scrapedtitle, r'(\([a-zA-Z]+\))')
|
||||
|
||||
infoLabels['year'] = year
|
||||
title = scrapedtitle.replace(year,'').replace(lang,'').strip()
|
||||
original = scrapedoriginal.replace(year,'').replace(lang,'').strip()
|
||||
if lang: lang = support.typo(lang,'_ color kod')
|
||||
longtitle = '[B]' + title + '[/B]' + lang + original
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
extra=item.extra,
|
||||
contentType="episode",
|
||||
action="episodios",
|
||||
title=longtitle,
|
||||
url=scrapedurl,
|
||||
thumbnail=scrapedthumb,
|
||||
fulltitle=title,
|
||||
show=title,
|
||||
infoLabels=infoLabels,
|
||||
plot=scrapedplot,
|
||||
folder=True))
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
autorenumber.renumber(itemlist)
|
||||
|
||||
# Next page
|
||||
support.nextPage(itemlist, item, data, r'<a class="page-link" href="([^"]+)" rel="next"')
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def video(item):
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
matches, data = support.match(item, r'<a href="([^"]+)" class[^>]+><img src="([^"]+)"(.*?)data-jtitle="([^"]+)" .*?>(.*?)<\/a>', '<div class="widget-body">(.*?)<div id="sidebar"', headers=headers)
|
||||
|
||||
for scrapedurl, scrapedthumb ,scrapedinfo, scrapedoriginal, scrapedtitle in matches:
|
||||
# Cerca Info come anno o lingua nel Titolo
|
||||
year = ''
|
||||
lang = ''
|
||||
if '(' in scrapedtitle:
|
||||
year = scrapertoolsV2.find_single_match(scrapedtitle, r'( \([0-9]+\))')
|
||||
lang = scrapertoolsV2.find_single_match(scrapedtitle, r'( \([a-zA-Z]+\))')
|
||||
|
||||
# Rimuove Anno e Lingua nel Titolo
|
||||
title = scrapedtitle.replace(year,'').replace(lang,'').strip()
|
||||
original = scrapedoriginal.replace(year,'').replace(lang,'').strip()
|
||||
|
||||
# Compara Il Titolo con quello originale
|
||||
if original == title:
|
||||
original=''
|
||||
else:
|
||||
original = support.typo(scrapedoriginal,'-- []')
|
||||
|
||||
# cerca info supplementari
|
||||
ep = ''
|
||||
ep = scrapertoolsV2.find_single_match(scrapedinfo, '<div class="ep">(.*?)<')
|
||||
if ep != '':
|
||||
ep = ' - ' + ep
|
||||
|
||||
ova = ''
|
||||
ova = scrapertoolsV2.find_single_match(scrapedinfo, '<div class="ova">(.*?)<')
|
||||
if ova != '':
|
||||
ova = ' - (' + ova + ')'
|
||||
|
||||
ona = ''
|
||||
ona = scrapertoolsV2.find_single_match(scrapedinfo, '<div class="ona">(.*?)<')
|
||||
if ona != '':
|
||||
ona = ' - (' + ona + ')'
|
||||
|
||||
movie = ''
|
||||
movie = scrapertoolsV2.find_single_match(scrapedinfo, '<div class="movie">(.*?)<')
|
||||
if movie != '':
|
||||
movie = ' - (' + movie + ')'
|
||||
|
||||
special = ''
|
||||
special = scrapertoolsV2.find_single_match(scrapedinfo, '<div class="special">(.*?)<')
|
||||
if special != '':
|
||||
special = ' - (' + special + ')'
|
||||
|
||||
|
||||
# Concatena le informazioni
|
||||
|
||||
lang = support.typo('Sub-ITA', '_ [] color kod') if '(ita)' not in lang.lower() else ''
|
||||
|
||||
info = ep + lang + year + ova + ona + movie + special
|
||||
|
||||
# Crea il title da visualizzare
|
||||
long_title = '[B]' + title + '[/B]' + info + original
|
||||
|
||||
# Controlla se sono Episodi o Film
|
||||
if movie == '':
|
||||
contentType = 'tvshow'
|
||||
action = 'episodios'
|
||||
else:
|
||||
contentType = 'movie'
|
||||
action = 'findvideos'
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
contentType=contentType,
|
||||
action=action,
|
||||
title=long_title,
|
||||
url=scrapedurl,
|
||||
fulltitle=title,
|
||||
show=title,
|
||||
thumbnail=scrapedthumb,
|
||||
context = autoplay.context,
|
||||
number= '1'))
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
autorenumber.renumber(itemlist)
|
||||
|
||||
# Next page
|
||||
support.nextPage(itemlist, item, data, r'href="([^"]+)" rel="next"', resub=['&','&'])
|
||||
return itemlist
|
||||
patronNext=r'href="([^"]+)" rel="next"'
|
||||
type_content_dict={'movie':['movie']}
|
||||
type_action_dict={'findvideos':['movie']}
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
log()
|
||||
itemlist = []
|
||||
patron_block = r'server active(.*?)server hidden '
|
||||
patron = r'<li><a [^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+" href="([^"]+)"[^>]+>([^<]+)<'
|
||||
matches = support.match(item, patron, patron_block)[0]
|
||||
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
itemlist.append(
|
||||
Item(
|
||||
channel=item.channel,
|
||||
action="findvideos",
|
||||
contentType="episode",
|
||||
title='[B] Episodio ' + scrapedtitle + '[/B]',
|
||||
url=urlparse.urljoin(host, scrapedurl),
|
||||
fulltitle=scrapedtitle,
|
||||
show=scrapedtitle,
|
||||
plot=item.plot,
|
||||
fanart=item.thumbnail,
|
||||
thumbnail=item.thumbnail,
|
||||
number=scrapedtitle))
|
||||
|
||||
autorenumber.renumber(itemlist, item, 'bold')
|
||||
support.videolibrary(itemlist, item)
|
||||
return itemlist
|
||||
anime=True
|
||||
patronBlock= r'server active(?P<block>.*?)server hidden '
|
||||
patron = r'<li><a [^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+"[^=]+="[^"]+" href="(?P<url>[^"]+)"[^>]+>(?P<episode>[^<]+)<'
|
||||
def itemHook(item):
|
||||
log('FULLTITLE= ',item)
|
||||
item.title += support.typo(item.fulltitle,'-- bold')
|
||||
return item
|
||||
action='findvideos'
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
matches, data = support.match(item, r'class="tab.*?data-name="([0-9]+)">([^<]+)</span', headers=headers)
|
||||
log(item)
|
||||
itemlist = []
|
||||
matches, data = support.match(item, r'class="tab.*?data-name="([0-9]+)">', headers=headers)
|
||||
videoData = ''
|
||||
|
||||
for serverid, servername in matches:
|
||||
block = scrapertoolsV2.find_multiple_matches(data,'data-id="'+serverid+'">(.*?)<div class="server')
|
||||
log('ITEM= ',item)
|
||||
id = scrapertoolsV2.find_single_match(str(block),r'<a data-id="([^"]+)" data-base="'+item.number+'"')
|
||||
for serverid in matches:
|
||||
number = scrapertoolsV2.find_single_match(item.title,r'(\d+) -')
|
||||
block = scrapertoolsV2.find_multiple_matches(data,'data-id="' + serverid + '">(.*?)<div class="server')
|
||||
ID = scrapertoolsV2.find_single_match(str(block),r'<a data-id="([^"]+)" data-base="' + (number if number else '1') + '"')
|
||||
log('ID= ',ID)
|
||||
if id:
|
||||
dataJson = httptools.downloadpage('%s/ajax/episode/info?id=%s&server=%s&ts=%s' % (host, id, serverid, int(time.time())), headers=[['x-requested-with', 'XMLHttpRequest']]).data
|
||||
dataJson = httptools.downloadpage('%s/ajax/episode/info?id=%s&server=%s&ts=%s' % (host, ID, serverid, int(time.time())), headers=[['x-requested-with', 'XMLHttpRequest']]).data
|
||||
json = jsontools.load(dataJson)
|
||||
videoData +='\n'+json['grabber']
|
||||
|
||||
@@ -308,6 +152,7 @@ def findvideos(item):
|
||||
quality='',
|
||||
url=json['grabber'],
|
||||
server='directo',
|
||||
fulltitle=item.fulltitle,
|
||||
show=item.show,
|
||||
contentType=item.contentType,
|
||||
folder=False))
|
||||
|
||||
119
core/support.py
119
core/support.py
@@ -163,6 +163,9 @@ def scrapeLang(scraped, lang, longtitle):
|
||||
|
||||
return lang, longtitle
|
||||
|
||||
def cleantitle(title):
|
||||
cleantitle = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(title).replace('"', "'").replace('×', 'x').replace('–', '-')).strip()
|
||||
return cleantitle
|
||||
|
||||
def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, typeContentDict, typeActionDict, blacklist, search, pag, function):
|
||||
itemlist = []
|
||||
@@ -173,13 +176,12 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
if debug:
|
||||
regexDbg(item, patron, headers, block)
|
||||
|
||||
known_keys = ['url', 'title', 'title2', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere',
|
||||
'rating', 'type', 'lang'] # by greko aggiunto episode
|
||||
known_keys = ['url', 'title', 'title2', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang']
|
||||
lang = '' # aggiunto per gestire i siti con pagine di serietv dove si hanno i video in ita e in subita
|
||||
|
||||
for i, match in enumerate(matches):
|
||||
if pagination and (pag - 1) * pagination > i: continue # pagination
|
||||
if pagination and i >= pag * pagination: break # pagination
|
||||
if pagination and i >= pag * pagination: break # pagination
|
||||
listGroups = match.keys()
|
||||
match = match.values()
|
||||
|
||||
@@ -194,25 +196,20 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
val = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + val
|
||||
scraped[kk] = val
|
||||
|
||||
if scraped['title']:
|
||||
title = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped['title'])
|
||||
.replace('"', "'").replace('×', 'x').replace('–',
|
||||
'-')).strip() # fix by greko da " a '
|
||||
else:
|
||||
title = ''
|
||||
|
||||
plot = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped["plot"]))
|
||||
|
||||
longtitle = typo(title, 'bold')
|
||||
if scraped['quality']: longtitle = longtitle + typo(scraped['quality'], '_ [] color kod')
|
||||
if scraped['episode']:
|
||||
scraped['episode'] = re.sub(r'\s-\s|-|x|–|×', 'x', scraped['episode'])
|
||||
longtitle = typo(scraped['episode'] + ' - ', 'bold') + longtitle
|
||||
if scraped['title2']:
|
||||
title2 = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped['title2'])
|
||||
.replace('"', "'").replace('×', 'x').replace('–', '-')).strip()
|
||||
longtitle = longtitle + typo(title2, 'bold _ -- _')
|
||||
|
||||
|
||||
episode = re.sub(r'\s-\s|-|x|–|×', 'x', scraped['episode']) if scraped['episode'] else ''
|
||||
title = cleantitle(scraped['title']) if scraped['title'] else ''
|
||||
title2 = cleantitle(scraped['title2']) if scraped['title2'] else ''
|
||||
quality = scraped['quality'] if scraped['quality'] else ''
|
||||
Type = scraped['type'] if scraped['type'] else ''
|
||||
plot = cleantitle(scraped["plot"]) if scraped["plot"] else ''
|
||||
|
||||
# make formatted Title [longtitle]
|
||||
s = ' - '
|
||||
title = episode + (s if episode and title else '') + title
|
||||
longtitle = episode + (s if episode and title else '') + title + (s if title and title2 else '') + title2
|
||||
longtitle = typo(longtitle, 'bold')
|
||||
longtitle += (typo(Type,'_ () bold') if Type else '') + (typo(quality, '_ [] color kod') if quality else '')
|
||||
lang, longtitle = scrapeLang(scraped, lang, longtitle)
|
||||
|
||||
# if title is set, probably this is a list of episodes or video sources
|
||||
@@ -238,31 +235,35 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
if scraped["rating"]:
|
||||
infolabels['rating'] = scrapertoolsV2.decodeHtmlentities(scraped["rating"])
|
||||
|
||||
AC = CT = ''
|
||||
if typeContentDict:
|
||||
for name, variants in typeContentDict.items():
|
||||
if scraped['type'] in variants:
|
||||
item.contentType = name
|
||||
if str(scraped['type']).lower() in variants:
|
||||
CT = name
|
||||
else: CT = item.contentType
|
||||
if typeActionDict:
|
||||
for name, variants in typeActionDict.items():
|
||||
if scraped['type'] in variants:
|
||||
action = name
|
||||
if str(scraped['type']).lower() in variants:
|
||||
AC = name
|
||||
else: AC = action
|
||||
|
||||
if (scraped["title"] not in blacklist) and (search.lower() in longtitle.lower()):
|
||||
it = Item(
|
||||
channel=item.channel,
|
||||
action=action,
|
||||
contentType='episode' if function == 'episodios' else item.contentType,
|
||||
action=AC if AC else action,
|
||||
contentType='episode' if function == 'episodios' else CT if CT else item.contentType,
|
||||
title=longtitle,
|
||||
fulltitle=item.fulltitle if function == 'episodios' else title,
|
||||
show=item.show if function == 'episodios' else title,
|
||||
quality=scraped["quality"],
|
||||
quality=quality,
|
||||
url=scraped["url"],
|
||||
infoLabels=infolabels,
|
||||
thumbnail=item.thumbnail if function == 'episodios' else scraped["thumb"] ,
|
||||
args=item.args,
|
||||
contentSerieName=title if item.contentType != 'movie' else '',
|
||||
contentTitle=title if item.contentType == 'movie' else '',
|
||||
contentLanguage=lang
|
||||
contentLanguage=lang,
|
||||
ep=episode if episode else ''
|
||||
)
|
||||
|
||||
for lg in list(set(listGroups).difference(known_keys)):
|
||||
@@ -357,14 +358,7 @@ def scrape(func):
|
||||
|
||||
checkHost(item, itemlist)
|
||||
|
||||
# if (item.contentType == "tvshow" and (action != "findvideos" and action != "play")) \
|
||||
# or (item.contentType == "episode" and action != "play") \
|
||||
# or (item.contentType == "movie" and action != "play") :
|
||||
if action != 'play' and 'patronMenu' not in args:
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
# else: # Si perde item show :(
|
||||
# for it in itemlist:
|
||||
# it.infoLabels = item.infoLabels
|
||||
|
||||
|
||||
if 'itemlistHook' in args:
|
||||
itemlist = args['itemlistHook'](itemlist)
|
||||
@@ -384,14 +378,17 @@ def scrape(func):
|
||||
page=pag + 1,
|
||||
thumbnail=thumb()))
|
||||
|
||||
if action != 'play' and function != 'episodios' and 'patronMenu' not in args:
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
|
||||
if anime:
|
||||
from specials import autorenumber
|
||||
if function == 'episodios' or item.action == 'episodios': autorenumber.renumber(itemlist, item, 'bold')
|
||||
else: autorenumber.renumber(itemlist)
|
||||
|
||||
if addVideolibrary and (item.infoLabels["title"] or item.fulltitle):
|
||||
item.fulltitle = item.infoLabels["title"]
|
||||
videolibrary(itemlist, item)
|
||||
# item.fulltitle = item.infoLabels["title"]
|
||||
videolibrary(itemlist, item, function=function)
|
||||
|
||||
if 'patronMenu' in args:
|
||||
itemlist = thumb(itemlist, genre=True)
|
||||
@@ -727,34 +724,45 @@ def match(item, patron='', patronBlock='', headers='', url=''):
|
||||
return matches, block
|
||||
|
||||
|
||||
def videolibrary(itemlist, item, typography='', function_level=1):
|
||||
def videolibrary(itemlist, item, typography='', function_level=1, function=''):
|
||||
# Simply add this function to add video library support
|
||||
# Function_level is useful if the function is called by another function.
|
||||
# If the call is direct, leave it blank
|
||||
log(item)
|
||||
|
||||
if item.contentType == 'movie':
|
||||
if item.contentType != 'episode':
|
||||
action = 'add_pelicula_to_library'
|
||||
extra = 'findvideos'
|
||||
contentType = 'movie'
|
||||
contentType = 'movie'
|
||||
else:
|
||||
action = 'add_serie_to_library'
|
||||
extra = 'episodios'
|
||||
contentType = 'tvshow'
|
||||
contentType = 'tvshow'
|
||||
|
||||
log('FUNCTION = ',function)
|
||||
|
||||
|
||||
if not typography: typography = 'color kod bold'
|
||||
|
||||
title = typo(config.get_localized_string(30161) + ' ' + typography)
|
||||
if (inspect.stack()[function_level][3] == 'findvideos' and contentType == 'movie') or (inspect.stack()[function_level][3] != 'findvideos' and contentType != 'movie'):
|
||||
title = typo(config.get_localized_string(30161), typography)
|
||||
contentSerieName=item.contentSerieName if item.contentSerieName else ''
|
||||
contentTitle=item.contentTitle if item.contentTitle else ''
|
||||
|
||||
if (inspect.stack()[function_level][3] == 'findvideos' and contentType == 'movie' \
|
||||
or inspect.stack()[function_level][3] != 'findvideos' and contentType != 'movie'):
|
||||
if config.get_videolibrary_support() and len(itemlist) > 0:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
title=title,
|
||||
contentType=contentType,
|
||||
contentSerieName=item.fulltitle if contentType == 'tvshow' else '',
|
||||
url=item.url,
|
||||
action=action,
|
||||
extra=extra,
|
||||
contentTitle=item.fulltitle))
|
||||
title=title,
|
||||
fulltitle=item.fulltitle,
|
||||
show=item.fulltitle,
|
||||
contentType=contentType,
|
||||
contentSerieName=contentSerieName,
|
||||
url=item.url,
|
||||
action=action,
|
||||
extra=extra,
|
||||
contentTitle=contentTitle
|
||||
))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -768,10 +776,10 @@ def nextPage(itemlist, item, data='', patron='', function_level=1, next_page='',
|
||||
if resub: next_page = re.sub(resub[0], resub[1], next_page)
|
||||
if 'http' not in next_page:
|
||||
next_page = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + next_page
|
||||
next_page = re.sub('&', '&',next_page)
|
||||
log('NEXT= ', next_page)
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
#action=inspect.stack()[function_level][3],
|
||||
action = item.action,
|
||||
contentType=item.contentType,
|
||||
title=typo(config.get_localized_string(30992), 'color kod bold'),
|
||||
@@ -804,6 +812,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
itemlist += itemList
|
||||
|
||||
for videoitem in itemlist:
|
||||
item.title = item.contentTitle if config.get_localized_string(30161) in item.title else item.title
|
||||
videoitem.title = "".join([item.title, ' ', typo(videoitem.title, 'color kod []'), typo(videoitem.quality, 'color kod []') if videoitem.quality else ""])
|
||||
videoitem.fulltitle = item.fulltitle
|
||||
videoitem.show = item.show
|
||||
@@ -843,7 +852,7 @@ def controls(itemlist, item, AutoPlay=True, CheckLinks=True):
|
||||
if AutoPlay == True:
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
videolibrary(itemlist, item, function_level=3)
|
||||
if item.contentChannel != 'videolibrary': videolibrary(itemlist, item, function_level=3)
|
||||
return itemlist
|
||||
|
||||
|
||||
|
||||
@@ -268,6 +268,7 @@ def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE,
|
||||
make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
|
||||
|
||||
def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE):
|
||||
from core import support
|
||||
log()
|
||||
page = 1
|
||||
EpList = []
|
||||
@@ -323,11 +324,8 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
|
||||
addiction = 0
|
||||
for item in itemlist:
|
||||
# Otiene Numerazione Episodi
|
||||
if scrapertoolsV2.find_single_match(item.title, r'\d+'):
|
||||
continue
|
||||
else:
|
||||
break
|
||||
episode = int(scrapertoolsV2.find_single_match(item.title, r'\d+'))
|
||||
log('EPISODE= ',episode)
|
||||
number = episode + FirstOfSeason - addiction
|
||||
count = number + addiction
|
||||
# find = episode + FirstOfSeason
|
||||
|
||||
@@ -28,8 +28,8 @@ perfil = [['0xFF0B7B92', '0xFF89FDFB', '0xFFACD5D4'],
|
||||
['0xFFA5DEE5', '0xFFE0F9B5', '0xFFFEFDCA'],
|
||||
['0xFFF23557', '0xFF22B2DA', '0xFFF0D43A']]
|
||||
|
||||
#color1, color2, color3 = ["white", "white", "white"]
|
||||
color1, color2, color3 = perfil[__perfil__]
|
||||
color1, color2, color3 = ["white", "white", "white"]
|
||||
# color1, color2, color3 = perfil[__perfil__]
|
||||
|
||||
list_newest = []
|
||||
list_newest_tourl = []
|
||||
|
||||
Reference in New Issue
Block a user