Fix Ricerca Globale

This commit is contained in:
Alhaziel01
2021-09-09 20:10:04 +02:00
parent b84f682461
commit dd309c307e
40 changed files with 185 additions and 211 deletions

View File

@@ -152,7 +152,7 @@ def peliculas(item):
patron = r''
patronBlock = r''
patronNext = ''
pagination = ''
pagination = True
#debug = True # True per testare le regex sul sito
return locals()
@@ -166,7 +166,7 @@ def episodios(item):
patron = r''
patronBlock = r''
patronNext = ''
pagination = ''
pagination = True
#debug = True
return locals()
@@ -182,7 +182,7 @@ def genres(item):
patron = r''
patronBlock = r''
patronNext = ''
pagination = ''
pagination = True
#debug = True
return locals()

View File

@@ -5,7 +5,7 @@
"active": true,
"thumbnail": "altadefinizionecommunity.png",
"banner": "",
"categories": ["movie", "tvshow", "vos"],
"categories": ["movie", "tvshow", "sub"],
"not_active": ["include_in_newest"],
"settings": [
{

View File

@@ -176,7 +176,7 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
logger.error("%s" % line)
logger.error('{}'.format(line))
return []

View File

@@ -1,6 +1,6 @@
{
"id": "animealtadefinizione",
"name": "AnimealtAdefinizione",
"name": "AnimealtaDefinizione",
"active": true,
"language": ["ita", "sub-ita"],
"thumbnail": "animealtadefinizione.png",

View File

@@ -98,7 +98,7 @@ def peliculas(item):
if item.search:
itemlist = [ it for it in itemlist if ' Episodio ' not in it.title ]
if len(itemlist) == int(perpage):
support.nextPage(itemlist, item, function_or_level='peliculas', page=page + 1, total_pages=int(res.match))
support.nextPage(itemlist, item, 'peliculas', page=page + 1, total_pages=int(res.match))
return itemlist
return locals()
@@ -106,7 +106,7 @@ def peliculas(item):
@support.scrape
def episodios(item):
numerationEnabled = True
pagination = int(perpage)
pagination = True
patron = epPatron
return locals()

View File

@@ -82,7 +82,7 @@ def peliculas(item):
action = 'check'
if not item.args:
pagination = ''
pagination = True
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)">'
else:
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'

View File

@@ -144,7 +144,7 @@ def peliculas(item):
return itemlist
else:
pagination = ''
pagination = True
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>[^<]+)<'
else:

View File

@@ -104,7 +104,7 @@ def peliculas(item):
@support.scrape
def episodios(item):
numerationEnabled = True
pagination = int(perpage)
pagination = True
patron = epPatron
return locals()

View File

@@ -155,7 +155,7 @@ def peliculas(item):
def episodios(item):
data = get_data(item)
numerationEnabled = True
# pagination = 50
# pagination = True
patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)(?:<div class="server|<link)'
patron = r'<li[^>]*>\s*<a.*?href="(?P<url>[^"]+)"[^>]*>(?P<episode>[^-<]+)(?:-(?P<episode2>[^<]+))?'
# def itemHook(item):

View File

@@ -5,7 +5,7 @@
"language": ["ita", "sub-ita"],
"thumbnail": "aniplay.png",
"banner": "aniplay.png",
"categories": ["anime", "vos"],
"categories": ["anime", "sub"],
"settings": [
{
"id": "sort",

View File

@@ -100,7 +100,7 @@ def peliculas(item):
action = 'findvideos'
elif item.contentType == 'tvshow':
action = 'episodios'
pagination = ''
pagination = True
else:
action = 'select'

View File

@@ -103,7 +103,7 @@ def peliculas(item):
# 'Auguri di Buon Natale e Felice Anno Nuovo! &#8211; ' + str(curYear) + '!']
if 'newest' in item.args:
pagination = ''
pagination = True
patronBlock = r'sequex-page-left(?P<block>.*?)sequex-page-right'
if '/serietv/' not in item.url:
patron = r'src="?(?P<thumb>[^ "]+)"? alt="?(?P<title>.*?)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z/]+)\]\s*)?\((?P<year>\d{4})[^\)]*\)[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>\w+) [^ ]+ DURATA (?P<duration>[0-9]+)[^ ]+ [^ ]+ [A-Z ]+ (?P<plot>[^<]+)<'

View File

@@ -51,7 +51,7 @@ def peliculas(item):
patronBlock = r'<div class="container">.*?class="col-md-12[^"]*?">(?P<block>.*?)<div class=(?:"container"|"bg-dark ")>'
if item.args == 'newest':
patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>.+?(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?'
pagination = 25
pagination = True
elif item.contentType == 'movie':
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>.+?)(?:[ ]\[(?P<lang>[sSuUbB\-iItTaA]+)\])?(?:[ ]\((?P<year>\d{4})\))?"\s*alt="[^"]+"\s*class="[^"]+"(?: style="background-image: url\((?P<thumb>.+?)\)">)?\s*<div class="voto">[^>]+>[^>]+>.(?P<rating>[\d\.a-zA-Z\/]+)?[^>]+>[^>]+>[^>]+>(?:<div class="genere">(?P<quality>[^<]+)</div>)?'
if item.args == 'update':
@@ -60,7 +60,7 @@ def peliculas(item):
elif item.contentType == 'tvshow':
if item.args == 'update':
patron = r'<a href="(?P<url>[^"]+)"[^<]+?url\((?P<thumb>.+?)\)">\s*?<div class="titolo">(?P<title>.+?)(?: &#8211; Serie TV)?(?:\([sSuUbBiItTaA\-]+\))?[ ]?(?P<year>\d{4})?</div>\s*?(?:<div class="genere">)?(?:[\w]+?\.?\s?[\s|S]?[\dx\-S]+?\s\(?(?P<lang>[iItTaA]+|[sSuUbBiItTaA\-]+)\)?\s?(?P<quality>[HD]+)?|.+?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?</div>)'
pagination = 25
pagination = True
else:
patron = r'<a href="(?P<url>[^"]+)"\s*title="(?P<title>[^"\(]+)(?:"|\()(?:(?P<year>\d+)[^"]+)?.*?url\((?P<thumb>[^\)]+)\)(?:.*?<div class="voto">[^>]+>[^>]+>\s*(?P<rating>[^<]+))?.*?<div class="titolo">[^>]+>(?:<div class="genere">[^ ]*(?:\s\d+)?\s*(?:\()?(?P<lang>[^\)< ]+))?'
else:

View File

@@ -104,7 +104,7 @@ def peliculas(item):
@support.scrape
def episodios(item):
numerationEnabled = True
pagination = 100
pagination = True
if item.data:
data = item.data

View File

@@ -35,7 +35,7 @@ def peliculas(item):
if item.args == 'newest':
item.contentType = 'episode'
patron = r'<span class="serieTitle" style="font-size:20px">(?P<title>[^<]+) \s*<a href="(?P<url>[^"]+)"[^>]*>\s+?(?P<episode>\d+[×x]\d+-\d+|\d+[×x]\d+) (?P<title2>[^<\(]+)\s?\(?(?P<lang>SUB ITA)?\)?</a>'
pagination = ''
pagination = True
else:
patron = r'<div class="post-thumb">.*?<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)\s?(?: Serie Tv)?\s?\(?(?P<year>\d{4})?\)?<\/a><\/h2>'
patronNext=r'a class="next page-numbers" href="?([^>"]+)">Avanti &raquo;</a>'

View File

@@ -61,7 +61,7 @@ def peliculas(item):
data = re.sub('\n|\t', ' ', data)
patron = r'<div class="cnt">\s.*?src="([^"]+)".+?title="((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)"\s*[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s+<a href="(?P<url>[^"]+)"'
patronBlock = r'<div class="container">(?P<block>.*?)</main>'
pagination = ''
pagination = True
patronNext = '<a class="page-link" href="([^"]+)">>>'
else:

View File

@@ -46,7 +46,7 @@ def mainlist(item):
## deflang = 'SUB-ITA'
## patronBlock = r'<span\s+class="label label-default label-title-typology">'+block
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
## pagination = 25
## pagination = True
## elif item.args == 'update':
## patronBlock = r'<div\s+class="container-fluid greybg title-serie-lastep title-last-ep fixed-title-wrapper containerBottomBarTitle">'+block
## patron = r'<a(?: rel="[^"]+")? href="(?P<url>[^"]+)"(?: class="[^"]+")?>[ ]<img class="[^"]+"[ ]title="[^"]+"[ ]alt="[^"]+"[ ]src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<episode>\d+.\d+)[ ]\((?P<lang>[a-zA-Z\-]+)[^<]+<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<'
@@ -58,15 +58,15 @@ def mainlist(item):
## elif item.args == 'nolost':
## patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">'+block
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
## pagination = 25
## pagination = True
## elif item.args == 'classic':
## patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-classiche">'+block
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
## pagination = 25
## pagination = True
## else:
## patronBlock = r'<div\s+class="container container-title-serie-new container-scheda" meta-slug="new">'+block
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
## pagination = 25
## pagination = True
##
## debug = True
## return locals()
@@ -90,28 +90,28 @@ def peliculas(item):
else:
end_block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">'
patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
pagination = 25
pagination = True
if item.args == 'ined':
deflang = 'SUB-ITA'
patronBlock = r'<span\s+class="label label-default label-title-typology">' + end_block
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
## pagination = 25
## pagination = True
elif item.args == 'update':
patronBlock = r'<div\s+class="container-fluid greybg title-serie-lastep title-last-ep fixed-title-wrapper containerBottomBarTitle">' + end_block
patron = r'href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>.+?class="strongText">(?P<title>.+?)<'
# elif item.args == 'nolost':
# patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">' + end_block
# pagination = 25
# pagination = True
# elif item.args == 'classic':
# patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-classiche">' + end_block
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
## pagination = 25
## pagination = True
## elif item.args == 'anime':
##
else:
patronBlock = r'<div\s+class="container container-title-serie-new container-scheda" meta-slug="new">' + end_block
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
## pagination = 25
## pagination = True
# support.regexDbg(item, patronBlock, headers)
# debug = True
return locals()
@@ -146,7 +146,7 @@ def genres(item):
def search(item, text):
logger.debug(text)
item.url = host + "/?s=" + text
item.url = host + "/search/" + text
item.contentType = 'tvshow'
item.args = 'search'
try:

View File

@@ -23,7 +23,7 @@ def mainlist(item):
def peliculas(item):
# debug = True
if item.args == 'alternative':
pagination = ''
pagination = True
patron = r'<a title="(?P<title>[^\(]+)\(\s*(?P<year>\d+)\)\s\D+(?P<quality>\d+p).{3}(?P<lang>[^ ]+).*?[^"]+"\s*href="(?P<url>[^"]+)'
else:
patron = r'<a href="(?P<url>[^"]+)" (?:rel="?[0-9]+"?)? title="(?P<title>[^\(]+)(?!\()\s*\((?P<year>\d+)\)\s(?:[^\]]+\])?\D+(?P<quality>\d+p).{3}(?P<lang>[^ ]+).*?<img id="?cov"?.*?src="(?P<thumb>[^"]+)'

View File

@@ -59,7 +59,7 @@ def peliculas(item):
def itemlistHook(itemlist):
args = item.args
args[0] += 1
support.nextPage(itemlist, item, next_page=item.url, function_or_level="peliculas")
support.nextPage(itemlist, item, next_page=item.url, "peliculas")
# itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), args=args, thumbnail=support.thumb()))
return itemlist
return locals()

View File

@@ -79,7 +79,7 @@ def peliculas(item):
if item.args == 'update':
action = 'findvideos'
patron = r'<div class="poster"><img src="(?P<thumb>[^"]+)"(?:[^>]+>){2}<a href="(?P<url>[^"]+)">[^>]+>(?P<episode>[\d\-x]+)(?:[^>]+>){4}(?P<title>.+?)(?:\[(?P<lang>[SsuUbBiItTaA-]{7})\])?<(?:[^>]+>){4}(?P<quality>[HDWEBRIP-]+)?(?:.+?)?/span><p class="serie"'
pagination = 25
pagination = True
def itemHook(item):
item.contentType = 'episode'
return item

View File

@@ -31,14 +31,14 @@ def peliculas(item):
patron = r'<div class="post-thumb">\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"\[]+)[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>'
if item.args == 'update':
pagination = ''
pagination = True
#patron = r'br />(?:[^>]+>)?(?P<title>[^]+)[^<]+<a href="(?P<url>[^"]+)">(?P<episode>[^ ]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))?'
patron = r'br[\s/]*>(?:\s*<[^>]+>)*(?P<title>[^<]+)[^<]+<a href="(?P<url>[^"]+)"[^>]*>(?:[^,]{0,80}[, ]{2})*(?P<episode>[\S]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))?'
action = 'episodios'
if item.args == 'top':
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>(?:[^>]+>){3}<img.*?src="(?P<thumb>[^"]+)"[^>]+>(?:[^>]+>){5}:\s*(?P<rating>[^/]+)'
if item.args =='a-z':
pagination = ''
pagination = True
patron = r'<li ><a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
patronNext = r'<a class="next page-numbers" href="(.*?)">'

View File

@@ -91,6 +91,7 @@ def peliculas(item):
action = 'episodios'
patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<'
def itemHook(item):
logger.debug(item)
item.thumbnail = 'http:' + item.t if item.t.startswith('//') else item.t if item.t else item.thumbnail
item.fanart = item.thumb
return item

View File

@@ -71,7 +71,7 @@ def newest(categoria):
@support.scrape
def peliculas(item):
pagination = ''
pagination = True
numerationEnabled = True
patronNext = r'href="([^"]+)" title="[^"]+" class="lcp_nextlink"'
action = 'findvideos'
@@ -105,7 +105,7 @@ def peliculas(item):
@support.scrape
def episodios(item):
numerationEnabled = True
pagination = 50
pagination = True
patronBlock = r'<table>(?P<block>.*?)</table>'
patron = r'<tr><td><b>(?P<title>(?:\d+)?.*?)\s*(?:(?P<episode>(?:\d+x\d+|\d+)))\s*(?P<title2>[^<]+)(?P<data>.*?)<tr>'
def itemHook(item):

View File

@@ -25,7 +25,7 @@ def mainlist(item):
def search(item, texto):
logger.debug(texto)
item.url = host + "/?s=" + texto
item.url = host + "/search/" + texto
try:
return peliculas(item)
# Continua la ricerca in caso di errore

View File

@@ -68,13 +68,13 @@ def peliculas(item):
patronBlock = r'>Lista Serie Tv</a></li></ul></div><div id="box_movies">(?P<block>.*?)<div id="paginador">'
patron = r'<div class="movie">[^>]+[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.+?)(?:(?P<year>\d{4})|")[^>]*>\s*<a href="(?P<url>[^"]+)'
elif item.contentType == 'episode':
pagination = 35
pagination = True
action = 'findvideos'
patron = r'<td><a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>.*?)(?P<episode>\d+x\d+)[ ]?(?P<title2>[^<]+)?<'
elif item.contentType == 'tvshow':
# SEZIONE Serie TV- Anime - Documentari
pagination = 35
pagination = True
if not item.args and 'anime' not in item.url:
patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+? href="(?P<url>[^"]+)">.*?<h2>(?P<title>[^"]+)</h2>\s?(?:<span class="year">(?P<year>\d+|\-\d+))?<'
@@ -83,7 +83,7 @@ def peliculas(item):
patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
else:
# SEZIONE FILM
pagination = 25
pagination = True
if item.args == 'lista':
patron = r'href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)(?:\s(?P<year>\d{4})|<)'

View File

@@ -253,7 +253,7 @@ def peliculas_tv(item):
# Paginazione
patron = r'<strong class="on">\d+</strong>\s?<a href="([^<]+)">\d+</a>'
support.nextPage(itemlist, item, data, patron)
support.nextPage(itemlist, item, data=data, patron=patron)
return itemlist

View File

@@ -41,7 +41,7 @@ def peliculas(item):
else:
action = 'findvideos'
patron = r'<div class="item">\s*?<a href="(?P<url>[^"]+)"\s*?data-original="(?P<thumb>[^"]+)"(?:[^>]+>){5}(?P<title>.+?)<[^>]+>\((?P<episode>[\dx\-]+)\s+?(?P<lang>Sub-Ita|[iITtAa]+)\)<'
pagination = 25
pagination = True
patronNext = r'<li><a href="([^"]+)"\s+?>Pagina successiva'
return locals()

View File

@@ -66,7 +66,7 @@ def peliculas(item):
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
if item.action == 'search':
pagination = ''
pagination = True
#patronBlock = '"lcp_catlist"[^>]+>(?P<block>.*)</ul>'
patronBlock = '<main[^>]+>(?P<block>.*?)</ma'
#patron = r'href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'

View File

@@ -67,7 +67,7 @@ def radio(item):
thumbnail = item.thumbnail,
url = url,
action = 'radio'))
support.nextPage(itemlist, item, data.data, r'(?P<url>[^"]+)" key="nextStations')
support.nextPage(itemlist, item, data=data.data, patron=r'(?P<url>[^"]+)" key="nextStations')
return itemlist

View File

@@ -107,7 +107,7 @@ def peliculas(item):
json_file =loadjs(item.url + 'channel/10005/last/')
logger.debug(json_file)
make_itemlist(itemlist, item, json_file)
itemlist = support.pagination(itemlist, item, item.page if item.page else 1, 20)
itemlist = support.pagination(itemlist, item, 'peliculas')
if item.contentType != 'movie': autorenumber.start(itemlist)
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)

View File

@@ -108,7 +108,7 @@ def get_channel_json(channel_name):
except Exception as ex:
template = "An exception of type %s occured. Arguments:\n%r"
message = template % (type(ex).__name__, ex.args)
logger.error(" %s" % message)
logger.error("{} | {}".format(channel_name,message))
return channel_json

View File

@@ -24,7 +24,7 @@ def load(*args, **kwargs):
except:
logger.error("**NOT** able to load the JSON")
logger.error(traceback.format_exc())
logger.error('ERROR STACK ' + str(stack()[1][3]))
logger.error('ERROR STACK:', stack()[1])
value = {}
return value

View File

@@ -243,7 +243,7 @@ class scrape:
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']:
if len(self.seasons) > 1 and self.seasonPagination:
self.itemlist = season_pagination(self.itemlist, self.item, self.seasons, self.function)
elif self.pagination or self.seasonPagination:
elif self.pagination:
self.itemlist = pagination(self.itemlist, self.item, self.function)
if self.action != 'play' and 'patronMenu' not in self.args and 'patronGenreMenu' not in self.args and self.tmdbEnabled and inspect.stack()[1][3] not in ['add_tvshow'] and self.function not in ['episodios', 'mainlist'] or (self.function in ['episodios'] and config.get_setting('episode_info')): # and function != 'episodios' and item.contentType in ['movie', 'tvshow', 'episode', 'undefined']
@@ -291,72 +291,72 @@ class scrape:
for match in matches:
self.scraped = {}
for kk in self.known_keys:
val = match[kk] if kk in match else ''
if val and (kk == "url" or kk == 'thumb') and 'http' not in val:
for k, v in match.items():
if v and k in ['url', 'thumb'] and 'http' not in v:
domain = ''
if val.startswith('//'):
if v.startswith('//'):
domain = scrapertools.find_single_match(self.item.url, 'https?:')
elif val.startswith('/'):
elif v.startswith('/'):
domain = scrapertools.find_single_match(self.item.url, 'https?://[a-z0-9.-]+')
val = domain + val
self.scraped[kk] = val.strip() if type(val) == str else val
v = domain + v
self.itemParams.__setattr__(k, v.strip() if type(v) == str else v)
self.itemParams.title = cleantitle(self.scraped.get('title', ''))
if self.group and self.scraped.get('title', '') in contents and not self.item.grouped: # same title and grouping enabled
self.itemParams.title = cleantitle(self.itemParams.title)
if self.group and self.itemParams.title in contents and not self.item.grouped: # same title and grouping enabled
continue
if self.item.grouped and self.scraped.get('title', '') != self.item.fulltitle: # inside a group different tvshow should not be included
if self.item.grouped and self.itemParams.title != self.item.fulltitle: # inside a group different tvshow should not be included
continue
contents.append(self.itemParams.title)
self.itemParams.title2 = cleantitle(self.scraped.get('title2', '')) if not self.group or self.item.grouped else ''
self.itemParams.quality = self.scraped.get('quality')
self.itemParams.plot = cleantitle(self.scraped.get("plot", ''))
self.itemParams.title2 = cleantitle(self.itemParams.title2) if not self.group or self.item.grouped else ''
self.itemParams.quality = self.itemParams.quality
self.itemParams.plot = cleantitle(self.itemParams.plot)
self.itemParams.language = scrapeLang(self.scraped, self.lang)
self.set_infolabels()
if self.sceneTitle: self.set_sceneTitle()
if not self.group or self.item.grouped:
self.set_episodes()
if self.scraped['episode2']: self.itemParams.second_episode = scrapertools.find_single_match(self.scraped['episode2'], r'(\d+)').split('x')
if self.itemParams.episode2: self.itemParams.second_episode = scrapertools.find_single_match(self.itemParams.episode2, r'(\d+)').split('x')
if self.itemParams.season: self.itemParams.infoLabels['season'] = int(self.itemParams.season)
if self.itemParams.episode: self.itemParams.infoLabels['episode'] = int(self.itemParams.episode)
itemlist.append(self.set_item(match))
it = self.set_item(match)
if it: itemlist.append(it)
self.itemlist.extend(itemlist)
self.matches.extend(matches)
def set_infolabels(self):
if self.item.infoLabels["title"] == self.scraped["title"]:
if self.item.infoLabels["title"] == self.itemParams.title:
infolabels = self.item.infoLabels
else:
if self.function == 'episodios':
infolabels = self.item.infoLabels
else:
infolabels = {}
if self.scraped['year']:
infolabels['year'] = self.scraped['year']
if self.scraped["plot"]:
if self.itemParams.year:
infolabels['year'] = self.itemParams.year
if self.itemParams.plot:
infolabels['plot'] = self.itemParams.plot
if self.scraped['duration']:
dur = scrapertools.find_multiple_matches(self.scraped['duration'], r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
if self.itemParams.duration:
dur = scrapertools.find_multiple_matches(self.itemParams.duration, r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
for h, m in dur:
self.scraped['duration'] = int(h) * 60 + int(m)
self.itemParams.duration = int(h) * 60 + int(m)
if not dur:
self.scraped['duration'] = scrapertools.find_single_match(self.scraped['duration'], r'(\d+)')
self.itemParams.duration = scrapertools.find_single_match(self.itemParams.duration, r'(\d+)')
try:
infolabels['duration'] = int(self.scraped['duration']) * 60
infolabels['duration'] = int(self.itemParams.duration) * 60
except:
self.scraped['duration'] = ''
if self.scraped['genere']:
genres = scrapertools.find_multiple_matches(self.scraped['genere'], '[A-Za-z]+')
self.itemParams.duration = ''
if self.itemParams.genre:
genres = scrapertools.find_multiple_matches(self.itemParams.genre, '[A-Za-z]+')
infolabels['genere'] = ", ".join(genres)
if self.scraped["rating"]:
infolabels['rating'] = scrapertools.decodeHtmlentities(self.scraped["rating"])
if self.itemParams.rating:
infolabels['rating'] = scrapertools.decodeHtmlentities(self.itemParams.rating)
self.itemParams.infoLabels = infolabels
@@ -370,7 +370,7 @@ class scrape:
self.itemParams.quality = str(parsedTitle.get('source'))
if parsedTitle.get('screen_size'):
self.itemParams.quality += ' ' + str(parsedTitle.get('screen_size', ''))
if not self.scraped['year']:
if not self.itemParams.year:
if type(parsedTitle.get('year', '')) == list:
self.itemParams.infoLabels['year'] = parsedTitle.get('year', '')[0]
else:
@@ -398,8 +398,8 @@ class scrape:
logger.error(traceback.format_exc())
def set_episodes(self):
ep = unifyEp(self.scraped['episode']) if self.scraped['episode'] else ''
se = self.scraped['season'] if self.scraped['season'].isdigit() else ''
ep = unifyEp(self.itemParams.episode) if self.itemParams.episode else ''
se = self.itemParams.season if self.itemParams.season.isdigit() else ''
if ep and se:
self.itemParams.season = int(se)
if 'x' in ep:
@@ -411,9 +411,9 @@ class scrape:
elif self.item.season:
self.itemParams.season = int(self.item.season)
if ep: self.itemParams.episode = int(scrapertools.find_single_match(self.scraped['episode'], r'(\d+)'))
if ep: self.itemParams.episode = int(scrapertools.find_single_match(self.itemParams.episode, r'(\d+)'))
elif self.item.contentType == 'tvshow' and (self.scraped['episode'] == '' and self.scraped['season'] == '' and self.itemParams.season == ''):
elif self.item.contentType == 'tvshow' and (self.itemParams.episode == '' and self.itemParams.season == '' and self.itemParams.season == ''):
self.item.news = 'season_completed'
else:
@@ -435,17 +435,17 @@ class scrape:
CT = ''
if self.typeContentDict:
for name, variants in self.typeContentDict.items():
if str(self.scraped['type']).lower() in variants:
if str(self.itemParams.type).lower() in variants:
CT = name
break
else: CT = self.item.contentType
if self.typeActionDict:
for name, variants in self.typeActionDict.items():
if str(self.scraped['type']).lower() in variants:
if str(self.itemParams.type).lower() in variants:
AC = name
break
else: AC = self.action
if (not self.scraped['title'] or self.scraped["title"] not in self.blacklist) and (self.search.lower() in self.itemParams.title.lower()):
if (not self.itemParams.title or self.itemParams.title not in self.blacklist) and (self.search.lower() in self.itemParams.title.lower()):
it = self.item.clone(title=self.itemParams.title,
fulltitle=self.itemParams.title,
@@ -457,15 +457,15 @@ class scrape:
episode2 = self.itemParams.second_episode,
extraInfo = self.itemParams.extraInfo,
disable_videolibrary = not self.args.get('addVideolibrary', True),
size = self.scraped['size'],
seed = self.scraped['seed'])
size = self.itemParams.size,
seed = self.itemParams.seed)
if self.scraped["url"]: it.url = self.scraped["url"]
if self.itemParams.url: it.url = self.itemParams.url
if self.function == 'episodios': it.fulltitle = it.show = self.itemParams.title
if self.itemParams.quality: it.quality = self.itemParams.quality
if self.itemParams.language: it.contentLanguage = self.itemParams.language
if self.item.prevthumb: it.thumbnail = self.item.prevthumb
elif self.scraped["thumb"]: it.thumbnail = self.scraped["thumb"]
elif self.itemParams.thumb: it.thumbnail = self.itemParams.thumb
it.contentType = 'episode' if self.function == 'episodios' else CT if CT else self.item.contentType
if it.contentType not in ['movie'] and self.function != 'episodios' or it.contentType in ['undefined']: it.contentSerieName = self.itemParams.title
if self.function == 'peliculas': it.contentTitle= self.itemParams.title
@@ -473,7 +473,7 @@ class scrape:
it.contentEpisodeNumber= self.itemParams.infoLabels.get('episode', ''),
if self.itemParams.title2: it.title2 = self.itemParams.title2
if self.scraped['episode'] and self.group and not self.item.grouped:
if self.itemParams.episode and self.group and not self.item.grouped:
it.action = self.function
elif AC:
it.action = AC
@@ -848,6 +848,8 @@ def nextPage(itemlist, item, function_or_level=1, **kwargs):
total_pages = integer, the number of total pages
'''
logger.debug()
if 'channel_search' in [s[3] for s in inspect.stack()]:
return itemlist
# get optional args
data = kwargs.get('data', '')
@@ -858,14 +860,6 @@ def nextPage(itemlist, item, function_or_level=1, **kwargs):
page = kwargs.get('page', None)
total_pages = kwargs.get('total_pages', None)
# create Item
if patron or page or next_page:
nextItem = item.clone(action = inspect.stack()[function_or_level][3] if type(function_or_level) == int else function_or_level,
title=typo(config.get_localized_string(30992), 'color kod bold'),
nextPage=True,
page=page if page else item.page + 1 if item.page else 2,
thumbnail=thumb())
# get next_page from data
if data and patron:
next_page = scrapertools.find_single_match(data, patron)
@@ -891,6 +885,7 @@ def nextPage(itemlist, item, function_or_level=1, **kwargs):
if total_pages:
item.total_pages = total_pages
# create Item
if next_page or page:
itemlist.append(item.clone(action = inspect.stack()[function_or_level][3] if type(function_or_level) == int else function_or_level,
title=typo(config.get_localized_string(30992), 'color kod bold'),
@@ -902,6 +897,8 @@ def nextPage(itemlist, item, function_or_level=1, **kwargs):
def pagination(itemlist, item, function_level=1):
if 'channel_search' in [s[3] for s in inspect.stack()]:
return itemlist
itemlistdb(itemlist)
page = item.page if item.page else 1
perpage = config.get_setting('pagination', default=20)
@@ -927,6 +924,8 @@ def pagination(itemlist, item, function_level=1):
def season_pagination(itemlist, item, seasons, function_level=1):
if 'channel_search' in [s[3] for s in inspect.stack()]:
return itemlist
itemlistdb(itemlist)
action = function_level if type(function_level) == str else inspect.stack()[function_level][3]
itlist = []

View File

@@ -182,7 +182,7 @@ def set_infoLabels(source, seekTmdb=True, search_language=def_lang, forced=False
return ret
def set_infoLabels_itemlist(item_list, seekTmdb=False, search_language=def_lang, forced=False):
def set_infoLabels_itemlist(itemlist, seekTmdb=False, search_language=def_lang, forced=False):
"""
Concurrently, it gets the data of the items included in the item_list.
@@ -215,15 +215,15 @@ def set_infoLabels_itemlist(item_list, seekTmdb=False, search_language=def_lang,
return (_i, _item, ret)
# for i, item in enumerate(item_list):
# for i, item in enumerate(itemlist):
# r_list.append(sub_thread(item, i, seekTmdb))
with futures.ThreadPoolExecutor() as executor:
searchList = [executor.submit(sub_thread, item, i, seekTmdb) for i, item in enumerate(item_list)]
searchList = [executor.submit(sub_thread, item, i, seekTmdb) for i, item in enumerate(itemlist)]
for res in futures.as_completed(searchList):
r_list.append(res.result())
# Sort results list by call order to keep the same order q item_list
# Sort results list by call order to keep the same order q itemlist
r_list.sort(key=lambda i: i[0])
# Rebuild and return list only with results of individual calls

View File

@@ -298,7 +298,7 @@ def get_localized_string(code):
def get_localized_category(categ):
categories = {'movie': get_localized_string(30122), 'tvshow': get_localized_string(30123),
'anime': get_localized_string(30124), 'documentary': get_localized_string(30125),
'vos': get_localized_string(30136), 'sub-ita': get_localized_string(70566),
'vos': get_localized_string(30136), 'sub': get_localized_string(30136),
'direct': get_localized_string(30137), 'torrent': get_localized_string(70015),
'live': get_localized_string(30138), 'music': get_localized_string(30139)
}

View File

@@ -1783,6 +1783,7 @@ def get_platform():
def get_played_time(item):
logger.debug()
from core import db
# from core.support import dbg;dbg()
played_time = 0
if not item.infoLabels:
@@ -1791,18 +1792,15 @@ def get_played_time(item):
if not ID:
return 0
S = item.infoLabels.get('season', 0)
E = item.infoLabels.get('episode')
s = item.infoLabels.get('season',0)
e = item.infoLabels.get('episode')
result = None
try:
if S and E:
result = db['viewed'].get(ID, {}).get(str(S)+'x'+str(E))
else:
result = db['viewed'].get(ID)
if result:
played_time = result
result = db['viewed'].get(ID)
if type(result) == dict:
result = db['viewed'].get(ID, {}).get('{}x{}'.format(s, e), 0)
played_time = result
except:
import traceback
logger.error(traceback.format_exc())
@@ -1814,6 +1812,7 @@ def get_played_time(item):
def set_played_time(item):
logger.debug()
from core import db
# from core.support import dbg;dbg()
played_time = item.played_time
if not item.infoLabels:
@@ -1823,15 +1822,15 @@ def set_played_time(item):
if not ID:
return
S = item.infoLabels.get('season', 0)
E = item.infoLabels.get('episode')
s = item.infoLabels.get('season',0)
e = item.infoLabels.get('episode')
try:
if item.contentType == 'movie':
db['viewed'][ID] = played_time
elif E:
elif e:
newDict = db['viewed'].get(ID, {})
newDict[str(S) + 'x' + str(E)] = played_time
newDict['{}x{}'.format(s, e)] = played_time
db['viewed'][ID] = newDict
except:
import traceback

View File

@@ -266,18 +266,6 @@
<itemlayout height="570" width="180">
<control type="group">
<top>300</top>
<visible>String.IsEmpty(ListItem.Property(channelthumb))</visible>
<control type="image">
<description>Item Poster</description>
<top>0</top>
<left>0</left>
<width>180</width>
<height>270</height>
<texture colordiffuse="FF999999">$INFO[ListItem.Art(poster)]</texture>
<visible>!Control.HasFocus(102)</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Item Poster</description>
<top>0</top>
@@ -285,33 +273,27 @@
<width>180</width>
<height>270</height>
<texture>$INFO[ListItem.Art(poster)]</texture>
<visible>Control.HasFocus(102)</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
</control>
<control type="group">
<top>390</top>
<visible>!String.IsEmpty(ListItem.Property(channelthumb))</visible>
<control type="image">
<description>Item Poster</description>
<top>0</top>
<left>0</left>
<width>180</width>
<height>180</height>
<texture colordiffuse="FF999999">$INFO[ListItem.Property(channelthumb)]</texture>
<visible>!Control.HasFocus(102)</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Item Poster</description>
<top>0</top>
<bottom>0</bottom>
<left>0</left>
<width>180</width>
<height>180</height>
<width>80</width>
<height>80</height>
<texture>$INFO[ListItem.Property(channelthumb)]</texture>
<visible>Control.HasFocus(102)</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Item Poster</description>
<top>0</top>
<right>0</right>
<width>80</width>
<height>80</height>
<texture>sub.png</texture>
<visible>!String.IsEmpty(ListItem.Property(sub))</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
@@ -319,17 +301,6 @@
</itemlayout>
<focusedlayout height="570" width="380">
<control type="group">
<control type="image">
<description>Item Poster</description>
<top>0</top>
<left>0</left>
<width>380</width>
<height>570</height>
<texture colordiffuse="FF999999">$INFO[ListItem.Art(poster)]</texture>
<visible>!Control.HasFocus(102)</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Item Poster</description>
<top>0</top>
@@ -337,34 +308,27 @@
<width>380</width>
<height>570</height>
<texture>$INFO[ListItem.Art(poster)]</texture>
<visible>Control.HasFocus(102)</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
</control>
<control type="group">
<top>420</top>
<left>230</left>
<visible>!String.IsEmpty(ListItem.Property(channelthumb))</visible>
<control type="image">
<description>Item Poster</description>
<top>0</top>
<left>0</left>
<width>150</width>
<height>150</height>
<texture colordiffuse="FF999999">$INFO[ListItem.Property(channelthumb)]</texture>
<visible>!Control.HasFocus(102)</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Item Poster</description>
<top>0</top>
<bottom>0</bottom>
<left>0</left>
<width>150</width>
<height>150</height>
<texture>$INFO[ListItem.Property(channelthumb)]</texture>
<visible>Control.HasFocus(102)</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
<control type="image">
<description>Item Poster</description>
<top>0</top>
<right>0</right>
<width>150</width>
<height>150</height>
<texture>sub.png</texture>
<visible>!String.IsEmpty(ListItem.Property(sub))</visible>
<bordersize>10</bordersize>
<aspectratio>scale</aspectratio>
</control>
@@ -372,7 +336,12 @@
</focusedlayout>
</control>
</control> <!-- END Search Result Group -->
<control type='image'>
<width>100%</width>
<height>100%</height>
<texture colordiffuse='88000000'>white.png</texture>
<visible>!Control.HasFocus(102)</visible>
</control>
<control type='button'>
<description>Result Overflow</description>
<top>0</top>
@@ -436,7 +405,7 @@
<left>0</left>
<width>150</width>
<height>150</height>
<texture>$INFO[ListItem.Property(thumb)]</texture>
<texture>$INFO[ListItem.Art(poster)]</texture>
<bordersize>2</bordersize>
<aspectratio>scale</aspectratio>
</control>
@@ -470,7 +439,7 @@
<left>0</left>
<width>150</width>
<height>150</height>
<texture>$INFO[ListItem.Property(thumb)]</texture>
<texture>$INFO[ListItem.Art(poster)]</texture>
<bordersize>2</bordersize>
<bordertexture colordiffuse='FF0082C2'>white.png</bordertexture>
<aspectratio>scale</aspectratio>
@@ -513,7 +482,7 @@
<left>0</left>
<width>480</width>
<height>720</height>
<texture>$INFO[Container(102).ListItem.Property(thumb)]</texture>
<texture>$INFO[Container(102).ListItem.Art(poster)]</texture>
</control>
<control type="textbox">
@@ -551,7 +520,7 @@
<shadowcolor>00000000</shadowcolor>
<align>left</align>
<aligny>center</aligny>
<label>[COLOR FFAAAAAA]$INFO[ListItem.Label()][/COLOR]</label>
<label>$INFO[ListItem.Label()]</label>
</control>
</itemlayout>
<focusedlayout height="60" width="700">
@@ -561,7 +530,7 @@
<left>0</left>
<width>700</width>
<height>60</height>
<texture colordiffuse="88000000">white.png</texture>
<texture colordiffuse="CC000000">white.png</texture>
<aspectratio>scale</aspectratio>
</control>
<control type="textbox">
@@ -575,7 +544,7 @@
<shadowcolor>00000000</shadowcolor>
<align>left</align>
<aligny>center</aligny>
<label>$INFO[ListItem.Label]</label>
<label>[B]$INFO[ListItem.Label][/B]</label>
</control>
</focusedlayout>
</control> <!-- END Episodes List -->
@@ -591,7 +560,7 @@
<left>0</left>
<width>480</width>
<height>720</height>
<texture>$INFO[Container(102).ListItem.Property(thumb)]</texture>
<texture>$INFO[Container(102).ListItem.Art(poster)]</texture>
</control>
<control type="textbox">
@@ -624,7 +593,7 @@
<left>5</left>
<width>120</width>
<height>120</height>
<texture>$INFO[ListItem.Property(thumb)]</texture>
<texture>$INFO[ListItem.Art(poster)]</texture>
<aspectratio>scale</aspectratio>
</control>
<control type="group">
@@ -706,7 +675,7 @@
<left>5</left>
<width>120</width>
<height>120</height>
<texture>$INFO[ListItem.Property(thumb)]</texture>
<texture>$INFO[ListItem.Art(poster)]</texture>
<aspectratio>scale</aspectratio>
</control>
<control type="group">

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -356,7 +356,8 @@ class SearchWindow(xbmcgui.WindowXML):
self.count = len(self.searchActions)
def get_channel_results(self, searchAction):
def search(text):
def channel_search(text):
logger.debug('Search on channel:', channel)
valid = []
other = []
results = self.moduleDict[channel].search(searchAction, text)
@@ -381,19 +382,19 @@ class SearchWindow(xbmcgui.WindowXML):
other = []
try:
results, valid, other = search(self.item.text)
results, valid, other = channel_search(self.item.text)
# if we are on movie search but no valid results is found, and there's a lot of results (more pages), try
# to add year to search text for better filtering
if self.item.contentType == 'movie' and not valid and other and other[-1].nextPage \
and self.item.infoLabels['year']:
logger.debug('retring adding year on channel ' + channel)
dummy, valid, dummy = search(self.item.text + " " + str(self.item.infoLabels['year']))
dummy, valid, dummy = channel_search(self.item.text + " " + str(self.item.infoLabels['year']))
# some channels may use original title
if self.item.mode != 'all' and not valid and self.item.infoLabels.get('originaltitle'):
logger.debug('retring with original title on channel ' + channel)
dummy, valid, dummy = search(self.item.infoLabels.get('originaltitle'))
dummy, valid, dummy = channel_search(self.item.infoLabels.get('originaltitle'))
except:
import traceback
logger.error(traceback.format_exc())
@@ -402,15 +403,19 @@ class SearchWindow(xbmcgui.WindowXML):
return
update_lock.acquire()
self.count += 1
logger.debug('Results:', channel, results, valid, other)
self.update(channel, valid, other if other else results)
update_lock.release()
def makeItem(self, url):
item = Item().fromurl(url)
def makeItem(self, item):
if type(item) == str: item = Item().fromurl(item)
channelParams = channeltools.get_channel_parameters(item.channel)
info = item.infoLabels
tagline = info.get('tagline')
title = '[B]{}[/B]'.format(item.fulltitle) + ('\n[I]{}[/I]'.format(tagline) if tagline else '')
if 'download' in item.action or 'videolibrary' in item.action:
title = '{}{}'.format(item.title, item.contentTitle)
else:
title = '[B]{}[/B]'.format(item.contentTitle) + ('\n[I]{}[/I]'.format(tagline) if tagline else '')
thumb = item.thumbnail if item.thumbnail else 'Infoplus/' + item.contentType.replace('show', '') + '.png'
it = xbmcgui.ListItem(title)
@@ -422,11 +427,11 @@ class SearchWindow(xbmcgui.WindowXML):
color = 'FFFFFFFF' if not rating else 'FFDB2360' if rating < 4 else 'FFD2D531' if rating < 7 else 'FF21D07A'
it.setProperties({'rating': str(int(info.get('rating',10) * 10)), 'color': color,
'item': url, 'verified': item.verified, 'channel':channelParams['title'], 'channelthumb': channelParams['thumbnail'] if item.verified else ''})
'item': item.tourl(), 'verified': item.verified, 'channel':channelParams['title'], 'channelthumb': channelParams['thumbnail'], 'sub':'true' if 'sub' in item.contentLanguage.lower() else ''})
if item.server:
color = scrapertools.find_single_match(item.alive, r'(FF[^\]]+)')
it.setArt({'poster': config.get_online_server_thumb(item.server)})
it.setProperties({'channel': channeltools.get_channel_parameters(item.channel).get('title', ''),
'thumb': config.get_online_server_thumb(item.server),
'servername': servertools.get_server_parameters(item.server.lower()).get('name', item.server),
'color': color if color else 'FF0082C2'})
@@ -436,12 +441,12 @@ class SearchWindow(xbmcgui.WindowXML):
self.LOADING.setVisible(False)
if self.exit:
return
logger.debug('Search on channel', channel)
if self.item.mode != 'all' and 'valid' not in self.results:
self.results['valid'] = 0
item = xbmcgui.ListItem('valid')
item.setProperties({'thumb': 'valid.png',
'position': '0',
item.setArt({'poster':'valid.png'})
item.setProperties({'position': '0',
'results': '0'})
self.channels.append(item)
pos = self.CHANNELS.getSelectedPosition()
@@ -460,7 +465,7 @@ class SearchWindow(xbmcgui.WindowXML):
if self.CHANNELS.getSelectedPosition() == 0:
items = []
for result in valid:
if result: items.append(self.makeItem(result.tourl()))
if result: items.append(self.makeItem(result))
pos = self.RESULTS.getSelectedPosition()
self.RESULTS.addItems(items)
if pos < 0:
@@ -474,8 +479,8 @@ class SearchWindow(xbmcgui.WindowXML):
name = channelParams['title']
if name not in self.results:
item = xbmcgui.ListItem(name)
item.setProperties({'thumb': channelParams['thumbnail'],
'position': '0',
item.setArt({'poster':channelParams['thumbnail']})
item.setProperties({'position': '0',
'results': str(len(results))
})
for result in results:
@@ -700,7 +705,7 @@ class SearchWindow(xbmcgui.WindowXML):
other = []
for i, item in enumerate(servers):
if item.server:
it = self.makeItem(item.tourl())
it = self.makeItem(item)
it.setProperty('index', str(i))
if item.quality.lower() in ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k']:
it.setProperty('quality', 'uhd.png')
@@ -720,8 +725,9 @@ class SearchWindow(xbmcgui.WindowXML):
elif not item.action:
self.getControl(QUALITYTAG).setText(item.fulltitle)
else:
it = self.makeItem(item.tourl())
it = self.makeItem(item)
other.append(it)
logger.debug(it)
uhd.sort(key=lambda it: it.getProperty('index'))
fhd.sort(key=lambda it: it.getProperty('index'))
@@ -732,7 +738,7 @@ class SearchWindow(xbmcgui.WindowXML):
serverlist = uhd + fhd + hd + sd + unknown + other
if not serverlist:
serverlist = [xbmcgui.ListItem(config.get_localized_string(60347))]
serverlist[0].setProperty('thumb', support.thumb('nofolder'))
serverlist[0].setArt({'poster': support.thumb('nofolder')})
self.Focus(SERVERS)
self.SERVERLIST.reset()
@@ -747,7 +753,7 @@ class SearchWindow(xbmcgui.WindowXML):
self.itemsResult = []
ep = []
for item in self.episodes:
title = item.title
title = item.contentTitle
if item.contentEpisodeNumber: title = '{:02d}. {}'.format(item.contentEpisodeNumber, title)
if item.contentSeason: title = '{}x{}'.format(item.contentSeason, title)
@@ -757,7 +763,7 @@ class SearchWindow(xbmcgui.WindowXML):
if not ep:
ep = [xbmcgui.ListItem(config.get_localized_string(60347))]
ep[0].setProperty('thumb', support.thumb('nofolder'))
ep[0].setArt({'poster', support.thumb('nofolder')})
self.Focus(EPISODES)
self.EPISODESLIST.reset()

View File

@@ -488,7 +488,7 @@ def setting_channel_new(item):
# presel_values = ['skip', 'actual', 'recom', 'freq', 'all', 'none', 'cast', 'lat']
presel_values = ['skip', 'actual', 'all', 'none']
categs = ['movie', 'tvshow', 'documentary', 'anime', 'vos', 'direct', 'torrent']
categs = ['movie', 'tvshow', 'documentary', 'anime', 'sub', 'live', 'torrent']
for c in categs:
preselecciones.append(config.get_localized_string(70577) + config.get_localized_category(c))
presel_values.append(c)