- Vai a pagina come lista se presente numero massimo di pagine

- Fix vai a primo episodio non visto in videoteca
 - Migliorata grafica Ricerca Globale
 - Altri piccoli cambiamenti
This commit is contained in:
Alhaziel01
2021-09-03 20:22:51 +02:00
parent dc93170fd5
commit 905e1ad6ee
37 changed files with 434 additions and 195 deletions
+8 -10
View File
@@ -4,7 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
import random import random
from core import httptools, support from core import httptools, support, config
from platformcode import logger from platformcode import logger
host = 'https://www.accuradio.com' host = 'https://www.accuradio.com'
@@ -12,29 +12,27 @@ api_url = host + '/c/m/json/{}/'
headers = [['Referer', host]] headers = [['Referer', host]]
def mainlist(item): def mainlist(item):
js = httptools.downloadpage(api_url.format('brands')).json
itemlist = [] itemlist = []
item.action = 'peliculas' item.action = 'peliculas'
js = httptools.downloadpage(api_url.format('brands')).json js = httptools.downloadpage(api_url.format('brands')).json
for it in js.get('features',[]): for it in js.get('features',[]) + js.get('brands',[]):
itemlist.append( itemlist.append(
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')), item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
title=support.typo(it['name'],'italic') + support.typo(it.get('channels',''),'_ [] color kod') extraInfo = it.get('channels',''),
)) title=it['name'],
for it in js.get('brands',[]): thumbnail = support.thumb('music')
itemlist.append(
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
title=support.typo(it['name'],'bullet bold') + support.typo(it.get('channels',''),'_ [] color kod')
)) ))
itemlist.append(item.clone(title=support.typo('Cerca...', 'bold color kod'), action='search', thumbnail=support.thumb('search'))) itemlist.append(item.clone(title=support.typo(config.get_localized_string(70741) % 'Musica… ', 'bold'), action='search', thumbnail=support.thumb('music_search')))
support.channel_config(item, itemlist) support.channel_config(item, itemlist)
return itemlist return itemlist
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
disabletmdb = True
action = 'playradio' action = 'playradio'
patron = r'data-id="(?P<id>[^"]+)"\s*data-oldid="(?P<oldid>[^"]+)".*?data-name="(?P<title>[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)' patron = r'data-id="(?P<id>[^"]+)"\s*data-oldid="(?P<oldid>[^"]+)".*?data-name="(?P<title>[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)'
return locals() return locals()
+3 -3
View File
@@ -65,8 +65,9 @@ def peliculas(item):
else: else:
patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">' patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">'
patronNext = '<span>\d</span> <a href="([^"]+)">' patronNext = '<a href="([^"]+)">&raquo;'
# debug = True patronTotalPages = r'>(\d+)(?:[^>]+>){3}&raquo;'
# debugBlock = True
return locals() return locals()
@@ -97,7 +98,6 @@ def orderalf(item):
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\ patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<'\ '.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<'\
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>' '[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
patronNext = r'<span>[^<]+</span>[^<]+<a href="(.*?)">'
return locals() return locals()
-6
View File
@@ -32,12 +32,8 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
# debug = True
support.info('peliculas',item)
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)(?:[^>]+>){5}\s*<div class="[^"]+" style="background-image:url\((?P<thumb>[^\)]+)(?:[^>]+>){6}\s*(?P<year>\d{4})[^>]+>[^>]+>(?:\s*(?P<duration>\d+))?(?:[^>]+>){0,2}\s+(?P<quality>[a-zA-Z]+)\s+(?:[^>]+>){2}\s*(?P<lang>[^>]+)\s+[^>]+>' patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)(?:[^>]+>){5}\s*<div class="[^"]+" style="background-image:url\((?P<thumb>[^\)]+)(?:[^>]+>){6}\s*(?P<year>\d{4})[^>]+>[^>]+>(?:\s*(?P<duration>\d+))?(?:[^>]+>){0,2}\s+(?P<quality>[a-zA-Z]+)\s+(?:[^>]+>){2}\s*(?P<lang>[^>]+)\s+[^>]+>'
patronNext = r'<span>\d</span> <a href="([^"]+)">' patronNext = r'<span>\d</span> <a href="([^"]+)">'
# debug = True
return locals() return locals()
# =========== def pagina categorie ====================================== # =========== def pagina categorie ======================================
@@ -56,8 +52,6 @@ def genres(item):
patronBlock = r'FILM RANDOM.*?class="listSubCat">(?P<block>.*)</ul>' patronBlock = r'FILM RANDOM.*?class="listSubCat">(?P<block>.*)</ul>'
action = 'findvideos' action = 'findvideos'
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
#debug = True
return locals() return locals()
# =========== def per cercare film/serietv ============= # =========== def per cercare film/serietv =============
+2 -1
View File
@@ -52,8 +52,9 @@ def peliculas(item):
if not item.args: if not item.args:
# patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section' # patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section'
patronBlock = r'({})(?P<block>.*?)</section'.format('ULTIMI INSERITI' if item.contentType == 'movie' else 'Serie TV') patronBlock = r'({})(?P<block>.*?)</section'.format('ULTIMI INSERITI' if item.contentType == 'movie' else 'Serie TV')
# debugBlock = True
patronNext = r'<a class="next page-numbers" href="([^"]+)">' patronNext = r'<a class="next page-numbers" href="([^"]+)">'
patronTotalPages = r'>(\d+)(?:[^>]+>){3}<a class="next'
return locals() return locals()
+6 -4
View File
@@ -2,7 +2,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
# Canale per Altadefinizione Community # Canale per Altadefinizione Community
from core import support from core import jsontools, support
from lib.fakeMail import Gmailnator from lib.fakeMail import Gmailnator
from platformcode import config, platformtools, logger from platformcode import config, platformtools, logger
from core import scrapertools, httptools from core import scrapertools, httptools
@@ -132,7 +132,7 @@ def peliculas(item):
json = {} json = {}
if item.contentType == 'undefined': if item.contentType == 'undefined':
disabletmdb = True # disabletmdb = True
action = 'check' action = 'check'
elif item.contentType == 'movie': elif item.contentType == 'movie':
action = 'findvideos' action = 'findvideos'
@@ -149,15 +149,17 @@ def peliculas(item):
else: else:
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
data = "\n".join(json['data']) data = "\n".join(json['data'])
patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>(?P<rating>[^<]+)</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)(?:[^>]+>){1,2}\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?'
# paginazione # paginazione
logger.debug('JSON FIND',jsontools.load(json))
if json.get('have_next'): if json.get('have_next'):
def fullItemlistHook(itemlist): def fullItemlistHook(itemlist):
spl = item.url.split('=') spl = item.url.split('=')
url = '='.join(spl[:-1]) url = '='.join(spl[:-1])
page = str(int(spl[-1])+1) page = str(int(spl[-1])+1)
support.nextPage(itemlist, item, next_page='='.join((url, page)), function_or_level='peliculas') total_pages = json.get('lastPage', 0)
support.nextPage(itemlist, item, next_page='='.join((url, page)), function_or_level='peliculas', total_pages=total_pages)
return itemlist return itemlist
return locals() return locals()
+2 -3
View File
@@ -27,12 +27,12 @@ def mainlist(item):
def submenu(item): def submenu(item):
action = 'peliculas' action = 'peliculas'
patronBlock = r'data-taxonomy="' + item.args + r'"(?P<block>.*?)</select' patronBlock = r'data-taxonomy="' + item.args + r'"(?P<block>.*?)</select'
patronMenu = r'<option class="level-\d+ (?P<u>[^"]+)"[^>]+>(?P<t>[^(]+)[^\(]+\((?P<num>\d+)' patronMenu = r'<option class="level-\d+ (?P<u>[^"]+)"[^>]+>(?P<title>[^(]+)[^\(]+\((?P<num>\d+)'
if 'genre' in item.args: if 'genre' in item.args:
patronGenreMenu = patronMenu patronGenreMenu = patronMenu
def itemHook(item): def itemHook(item):
item.url += host + '/anime/' + item.args + '/' + item.u item.url += host + '/anime/' + item.args + '/' + item.u
item.title = support.typo(item.t, 'bold') # item.title = support.typo(item.t, 'bold')
return item return item
return locals() return locals()
@@ -90,7 +90,6 @@ def peliculas(item):
def itemHook(item): def itemHook(item):
if 'sub-ita' in item.url: if 'sub-ita' in item.url:
if item.args != 'newest': item.title = item.title + support.typo('Sub-ITA','_ [] color kod')
item.contentLanguage = 'Sub-ITA' item.contentLanguage = 'Sub-ITA'
return item return item
+3 -3
View File
@@ -63,7 +63,7 @@ def peliculas(item):
def itemHook(item): def itemHook(item):
if 'movie' in item.title.lower(): if 'movie' in item.title.lower():
item.title = support.re.sub(' - [Mm][Oo][Vv][Ii][Ee]|[Mm][Oo][Vv][Ii][Ee]','',item.title) item.title = support.re.sub(' - [Mm][Oo][Vv][Ii][Ee]|[Mm][Oo][Vv][Ii][Ee]','',item.title)
item.title += support.typo('Movie','_ () bold') # item.title += support.typo('Movie','_ () bold')
item.contentType = 'movie' item.contentType = 'movie'
item.action = 'findvideos' item.action = 'findvideos'
return item return item
@@ -107,10 +107,10 @@ def episodios(item):
if not item.url: if not item.url:
item.url = url item.url = url
if 'Movie Parte' in data: if 'Movie Parte' in data:
item.title = support.typo(item.fulltitle + ' - Part ','bold') + item.title item.title = item.fulltitle + ' - Part ' + item.title
item.contentType = 'movie' item.contentType = 'movie'
else: else:
item.title = support.typo('Episodio ', 'bold') + item.title item.title = 'Episodio ' + item.title
return item return item
return locals() return locals()
+3 -1
View File
@@ -33,6 +33,7 @@ def mainlist(item):
search ='' search =''
return locals() return locals()
def menu(item): def menu(item):
item.action = 'peliculas' item.action = 'peliculas'
ITA = copy.copy(item.args) ITA = copy.copy(item.args)
@@ -200,11 +201,12 @@ def episodios(item):
title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio ' title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
for it in item.episodes: for it in item.episodes:
itemlist.append( itemlist.append(
item.clone(title=support.typo(title + it['number'], 'bold'), item.clone(title=title,
episode = it['number'], episode = it['number'],
fulltitle=item.title, fulltitle=item.title,
show=item.title, show=item.title,
contentTitle='', contentTitle='',
contentEpisodeNumber=it['number'],
contentSerieName=item.contentSerieName, contentSerieName=item.contentSerieName,
thumbnail=item.thumbnail, thumbnail=item.thumbnail,
plot=item.plot, plot=item.plot,
+5 -5
View File
@@ -110,17 +110,17 @@ def peliculas(item):
patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?P<title2>\([\D*]+\))?(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?(?:\(\D{2}\s\d{4}\))?<' patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?P<title2>\([\D*]+\))?(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?(?:\(\D{2}\s\d{4}\))?<'
patronNext = r'<a href="([^"]+)"\s*>Pagina' patronNext = r'<a href="([^"]+)"\s*>Pagina'
# debug = True patronTotalPages = r'>(\d+)(?:[^>]+>){4}Pagina'
def itemHook(item): def itemHook(item):
if item.quality1: if item.quality1:
item.quality = item.quality1 item.quality = item.quality1
item.title += support.typo(item.quality, '_ [] color kod') # item.title += support.typo(item.quality, '_ [] color kod')
if item.lang2: if item.lang2:
item.contentLanguage = item.lang2 item.contentLanguage = item.lang2
item.title += support.typo(item.lang2, '_ [] color kod') # item.title += support.typo(item.lang2, '_ [] color kod')
if item.args == 'novita': # if item.args == 'novita':
item.title = item.title # item.title = item.title
# if 'wp-content' in item.thumbnail and not item.infoLabels['year']: # if 'wp-content' in item.thumbnail and not item.infoLabels['year']:
# item.infoLabels['year'] = item.thumbnail.split('/')[5] # item.infoLabels['year'] = item.thumbnail.split('/')[5]
return item return item
+1
View File
@@ -122,6 +122,7 @@ def peliculas(item):
item.contentType = 'tvshow' item.contentType = 'tvshow'
patronNext = '<a class="?page-link"? href="?([^>"]+)"?><i class="fa fa-angle-right">' patronNext = '<a class="?page-link"? href="?([^>"]+)"?><i class="fa fa-angle-right">'
patronTotalPages = '(\d+[\.]?\d+)</option>\s*</sele'
def itemHook(item): def itemHook(item):
if item.quality2: if item.quality2:
+5 -6
View File
@@ -4,9 +4,8 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
import requests import requests
from core import support, jsontools from core import support
from platformcode import logger, config from platformcode import logger
typo = support.typo
session = requests.Session() session = requests.Session()
host = support.config.get_channel_url() host = support.config.get_channel_url()
@@ -65,7 +64,7 @@ def live(item):
logger.debug() logger.debug()
itemlist =[] itemlist =[]
for name, values in liveDict().items(): for name, values in liveDict().items():
itemlist.append(item.clone(title=typo(name,'bold'), fulltitle=name, plot=values['plot'], url=values['url'], id=values['id'], action='play', forcethumb=True, no_return=True)) itemlist.append(item.clone(title=name, fulltitle=name, plot=values['plot'], url=values['url'], id=values['id'], action='play', forcethumb=True, no_return=True))
return support.thumb(itemlist, mode='live') return support.thumb(itemlist, mode='live')
@@ -116,7 +115,7 @@ def peliculas(item):
fanarts = [image['attributes']['src'] for image in images if len(key['relationships']['images']['data']) > 1 and image['id'] == key['relationships']['images']['data'][1]['id']] fanarts = [image['attributes']['src'] for image in images if len(key['relationships']['images']['data']) > 1 and image['id'] == key['relationships']['images']['data'][1]['id']]
fanart = fanarts[0] if fanarts else item.fanart fanart = fanarts[0] if fanarts else item.fanart
itemlist.append( itemlist.append(
item.clone(title=typo(title,'bold'), item.clone(title=title,
fulltitle=title, fulltitle=title,
plot=plot, plot=plot,
url=url, url=url,
@@ -163,7 +162,7 @@ def episodios(item):
title = '{}x{:02d} - {}'.format(option['id'], episode['attributes']['episodeNumber'], episode['attributes']['name']) title = '{}x{:02d} - {}'.format(option['id'], episode['attributes']['episodeNumber'], episode['attributes']['name'])
plot = episode['attributes']['description'] plot = episode['attributes']['description']
itemlist.append( itemlist.append(
item.clone(title=typo(title,'bold'), item.clone(title=title,
fulltitle=title, fulltitle=title,
plot=plot, plot=plot,
id=episode['id'], id=episode['id'],
+2 -2
View File
@@ -49,7 +49,7 @@ def episodios(item):
if 'clicca qui per aprire' in data.lower(): data = support.match(support.match(data, patron=r'"go_to":"([^"]+)"').match.replace('\\',''), headers=headers).data if 'clicca qui per aprire' in data.lower(): data = support.match(support.match(data, patron=r'"go_to":"([^"]+)"').match.replace('\\',''), headers=headers).data
elif 'clicca qui</span>' in data.lower(): data = support.match(support.match(data, patron=r'<h2 style="text-align: center;"><a href="([^"]+)">').match, headers=headers).data elif 'clicca qui</span>' in data.lower(): data = support.match(support.match(data, patron=r'<h2 style="text-align: center;"><a href="([^"]+)">').match, headers=headers).data
patronBlock = r'</span>(?P<block>[a-zA-Z\s]+\d+(.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>' patronBlock = r'</span>(?P<block>[a-zA-Z\s]+\d+(.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>'
patron = r'(?P<season>\d+)&#\d+;(?P<episode>\d+(?:-\d+)?)\s*(?:</strong>|<em>)?\s*(?P<title>.*?)(?:–|-.+?-|–.+?–|–|em|.)?(?:/em.*?)?(?:<a (?P<other>.*?))?<br />' patron = r'(?P<season>\d+)&#\d+;(?P<episode>\d+(?:-\d+)?)\s*(?:</strong>|<em>)?\s*(?P<title>.*?)(?:–|-.+?-|–.+?–|–|em|.)?(?:/em.*?)?(?:<a (?P<data>.*?))<br />'
def itemHook(i): def itemHook(i):
i.url = item.url i.url = item.url
@@ -98,4 +98,4 @@ def newest(categoria):
def findvideos(item): def findvideos(item):
support.info() support.info()
return support.server(item, item.other) return support.server(item, item.data)
+3 -2
View File
@@ -8,7 +8,7 @@ from core.item import Item
from platformcode import config, logger from platformcode import config, logger
def findhost(url): def findhost(url):
return support.match(url, patron=r'Il nuovo indirizzo di FILMPERTUTTI è ?<a href="([^"]+)', debug=True).match return support.match(url, patron=r'Il nuovo indirizzo di FILMPERTUTTI è ?<a href="([^"]+)').match
host = config.get_channel_url(findhost) host = config.get_channel_url(findhost)
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -58,10 +58,11 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
# debug=True
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
if 'accordion-item' in data: if 'accordion-item' in data:
patronBlock = r'<span class="season[^>]*>\d+[^>]+>[^>]+>[^>]+>[^>]+>\D*(?:STAGIONE|Stagione)[ -]+(?P<lang>[a-zA-Z\- ]+)[^<]*</span>(?P<block>.*?)<div id="(?:season|disqus)' patronBlock = r'<span class="season[^>]*>\d+[^>]+>[^>]+>[^>]+>[^>]+>\D*(?:STAGIONE|Stagione)[ -]+(?P<lang>[a-zA-Z\- ]+)[^<]*</span>(?P<block>.*?)<div id="(?:season|disqus)'
patron = r'<img src="(?P<thumb>[^"]+)">.*?<li class="season-no">(?P<season>\d+)(?:&#215;|×|x)(?P<episode>\d+)[^<0-9]*<\/li>(?P<data>.*?javascript:;">(?P<title>[^<]+).*?</tbody>)' patron = r'data-src="(?P<thumb>[^"]+)"[^>]*>.*?<li class="season-no">(?P<season>\d+)(?:&#215;|×|x)(?P<episode>\d+)[^<0-9]*<\/li>(?P<data>.*?javascript:;">(?P<title>[^<]+).*?</tbody>)'
else: else:
patronBlock = r'(?:STAGIONE|Stagione)(?:<[^>]+>)?\s*(?:(?P<lang>[A-Za-z- ]+))?(?P<block>.*?)(?:&nbsp;|<strong>|<div class="addtoany)' patronBlock = r'(?:STAGIONE|Stagione)(?:<[^>]+>)?\s*(?:(?P<lang>[A-Za-z- ]+))?(?P<block>.*?)(?:&nbsp;|<strong>|<div class="addtoany)'
patron = r'(?:/>|p>)\s*(?P<season>\d+)(?:&#215;|×|x)(?P<episode>\d+)[^<]+(?P<data>.*?)(?:<br|</p)' patron = r'(?:/>|p>)\s*(?P<season>\d+)(?:&#215;|×|x)(?P<episode>\d+)[^<]+(?P<data>.*?)(?:<br|</p)'
+3 -3
View File
@@ -3,7 +3,7 @@
# Canale per altadefinizione01 # Canale per altadefinizione01
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import support, config
host = 'https://metalvideo.com' host = 'https://metalvideo.com'
headers = {'X-Requested-With': 'XMLHttpRequest'} headers = {'X-Requested-With': 'XMLHttpRequest'}
@@ -24,11 +24,11 @@ def mainlist(item):
itemlist.append( itemlist.append(
support.Item( support.Item(
channel=item.channel, channel=item.channel,
title=support.typo('Cerca...', 'bold'), title=support.typo(config.get_localized_string(70741) % 'Musica… ', 'bold'),
contentType='music', contentType='music',
url=item.url, url=item.url,
action='search', action='search',
thumbnail=support.thumb('search'))) thumbnail=support.thumb('music_search')))
support.channel_config(item, itemlist) support.channel_config(item, itemlist)
return itemlist return itemlist
+8 -6
View File
@@ -3,7 +3,7 @@
# Canale per tunein # Canale per tunein
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import scrapertools, support from core import scrapertools, support, config
from platformcode import logger from platformcode import logger
host = 'http://api.radiotime.com' host = 'http://api.radiotime.com'
@@ -21,7 +21,7 @@ def mainlist(item):
return item return item
def itemlistHook(itemlist): def itemlistHook(itemlist):
itemlist.append( itemlist.append(
item.clone(title=support.typo('Cerca...', 'bold color kod'), action='search', thumbnail=support.thumb('search'))) item.clone(title=support.typo(config.get_localized_string(70741) % 'Musica… ', 'bold'), action='search', thumbnail=support.thumb('search')))
support.channel_config(item, itemlist) support.channel_config(item, itemlist)
return itemlist return itemlist
return locals() return locals()
@@ -35,7 +35,8 @@ def radio(item):
for title, location, url, quality, song, type, thumbnail in data.matches: for title, location, url, quality, song, type, thumbnail in data.matches:
title = scrapertools.decodeHtmlentities(title) title = scrapertools.decodeHtmlentities(title)
itemlist.append( itemlist.append(
item.clone(title = support.typo(title, 'bold') + support.typo(quality + ' kbps','_ [] bold color kod'), item.clone(contentTitle = title,
quality= quality,
thumbnail = thumbnail, thumbnail = thumbnail,
url = url, url = url,
contentType = 'music', contentType = 'music',
@@ -49,7 +50,7 @@ def radio(item):
infoLabels={} infoLabels={}
infoLabels['duration'] = duration infoLabels['duration'] = duration
itemlist.append( itemlist.append(
item.clone(title = support.typo(title, 'bold'), item.clone(contentTitle = title,
thumbnail = thumbnail, thumbnail = thumbnail,
infolLbels = infoLabels, infolLbels = infoLabels,
url = url, url = url,
@@ -62,7 +63,7 @@ def radio(item):
title = scrapertools.unescape(title) title = scrapertools.unescape(title)
itemlist.append( itemlist.append(
item.clone(channel = item.channel, item.clone(channel = item.channel,
title = support.typo(title, 'bold'), contentTitle = title,
thumbnail = item.thumbnail, thumbnail = item.thumbnail,
url = url, url = url,
action = 'radio')) action = 'radio'))
@@ -76,10 +77,11 @@ def findvideos(item):
item.action = 'play' item.action = 'play'
urls = support.match(item.url).data.strip().split() urls = support.match(item.url).data.strip().split()
for url in urls: for url in urls:
item.title = 'TuneIn'
item.url= url item.url= url
item.server = 'directo' item.server = 'directo'
itemlist.append(item) itemlist.append(item)
return itemlist return support.server(item, itemlist=itemlist)
def search(item, text): def search(item, text):
+8 -4
View File
@@ -100,12 +100,16 @@ def newest(categoria):
def peliculas(item): def peliculas(item):
itemlist = [] itemlist = []
# support.dbg() # support.dbg()
if not item.args: if not item.args:
json_file =loadjs(item.url + 'channel/10005/last/') json_file =loadjs(item.url + 'channel/10005/last/')
support.logger.debug(json_file) support.logger.debug(json_file)
make_itemlist(itemlist, item, json_file) make_itemlist(itemlist, item, json_file)
itemlist = support.pagination(itemlist, item, item.page if item.page else 1, 20)
if item.contentType != 'movie': autorenumber.start(itemlist)
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
elif ('=' not in item.args) and ('=' not in item.url): elif ('=' not in item.args) and ('=' not in item.url):
json_file=loadjs(item.url + item.args) json_file=loadjs(item.url + item.args)
@@ -123,15 +127,14 @@ def peliculas(item):
action = 'peliculas', action = 'peliculas',
args = 'filters')) args = 'filters'))
else : else:
json_file=loadjs(item.url) json_file=loadjs(item.url)
item.args='' item.args=''
make_itemlist(itemlist, item, json_file) make_itemlist(itemlist, item, json_file)
if 'category' in item.args: if 'category' in item.args:
support.thumb(itemlist,mode='genre') support.thumb(itemlist,mode='genre')
elif not 'filter' in item.args:
if item.contentType != 'movie': autorenumber.start(itemlist)
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
return itemlist return itemlist
@@ -214,6 +217,7 @@ def findvideos(item):
def make_itemlist(itemlist, item, data): def make_itemlist(itemlist, item, data):
search = item.search if item.search else '' search = item.search if item.search else ''
infoLabels = {} infoLabels = {}
for key in data['data']: for key in data['data']:
if search.lower() in encode(key['title']).lower(): if search.lower() in encode(key['title']).lower():
title = encode(key['title']) title = encode(key['title'])
+29 -11
View File
@@ -232,7 +232,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
matches = scrapertools.find_multiple_matches_groups(block, patron) matches = scrapertools.find_multiple_matches_groups(block, patron)
logger.debug('MATCHES =', matches) logger.debug('MATCHES =', matches)
known_keys = ['url', 'title', 'title2', 'season', 'episode', 'episode2', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang', 'other', 'size', 'seed'] known_keys = ['url', 'title', 'title2', 'season', 'episode', 'episode2', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang', 'size', 'seed']
# Legenda known_keys per i groups nei patron # Legenda known_keys per i groups nei patron
# known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', # known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality',
# 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang'] # 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang']
@@ -440,7 +440,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
contentSeason= infolabels.get('season', ''), contentSeason= infolabels.get('season', ''),
contentEpisodeNumber=infolabels.get('episode', ''), contentEpisodeNumber=infolabels.get('episode', ''),
news = item.news if item.news else '', news = item.news if item.news else '',
other = scraped['other'] if scraped['other'] else '', # other = scraped['other'] if scraped['other'] else '',
grouped = group, grouped = group,
title2 = cleantitle(title2) if title2 else '', title2 = cleantitle(title2) if title2 else '',
episode2 = second_episode, episode2 = second_episode,
@@ -502,6 +502,7 @@ def scrape(func):
else: else:
headers = '' headers = ''
patronNext = args.get('patronNext', '') patronNext = args.get('patronNext', '')
patronTotalPages = args.get('patronTotalPages', '')
patronBlock = args.get('patronBlock', '') patronBlock = args.get('patronBlock', '')
typeActionDict = args.get('typeActionDict', {}) typeActionDict = args.get('typeActionDict', {})
typeContentDict = args.get('typeContentDict', {}) typeContentDict = args.get('typeContentDict', {})
@@ -581,7 +582,7 @@ def scrape(func):
@scrape @scrape
def newFunc(): def newFunc():
return nextArgs return nextArgs
nextArgs['item'] = nextPage(itemlist, item, data, patronNext, function) nextArgs['item'] = nextPage(itemlist, item, data, patronNext, function, patron_total_pages=patronTotalPages)
nextArgs['group'] = False nextArgs['group'] = False
if nextArgs['item']: if nextArgs['item']:
nextArgs['groupExplode'] = True nextArgs['groupExplode'] = True
@@ -603,7 +604,7 @@ def scrape(func):
if not group and not args.get('groupExplode') and ((pagination and len(matches) <= pag * pagination) or not pagination): # next page with pagination if not group and not args.get('groupExplode') and ((pagination and len(matches) <= pag * pagination) or not pagination): # next page with pagination
if patronNext and inspect.stack()[1][3] not in ['newest'] and len(inspect.stack()) > 2 and inspect.stack()[2][3] not in ['get_channel_results']: if patronNext and inspect.stack()[1][3] not in ['newest'] and len(inspect.stack()) > 2 and inspect.stack()[2][3] not in ['get_channel_results']:
nextPage(itemlist, item, data, patronNext, function) nextPage(itemlist, item, data, patronNext, function, patron_total_pages=patronTotalPages)
# next page for pagination # next page for pagination
@@ -851,7 +852,7 @@ def menu(func):
contentType= var[3] if len(var) > 3 else 'movie',) contentType= var[3] if len(var) > 3 else 'movie',)
if single_search: if single_search:
menuItem(itemlist, filename, config.get_localized_string(70741) % '{bold}', 'search', host + dictUrl['search'], style=not global_search) menuItem(itemlist, filename, config.get_localized_string(70741).replace(' %s', '{bold}'), 'search', host + dictUrl['search'], style=not global_search)
if not global_search: if not global_search:
channel_config(item, itemlist) channel_config(item, itemlist)
@@ -919,6 +920,9 @@ def typo(string, typography=''):
if 'italic' in typography: if 'italic' in typography:
string = '[I]' + string + '[/I]' string = '[I]' + string + '[/I]'
typography = typography.replace('italic', '') typography = typography.replace('italic', '')
if '__' in typography:
string = string + ' '
typography = typography.replace('__', '')
if '_' in typography: if '_' in typography:
string = ' ' + string string = ' ' + string
typography = typography.replace('_', '') typography = typography.replace('_', '')
@@ -1180,10 +1184,12 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
return itemlist return itemlist
def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page='', resub=[]): def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page='', resub=[], patron_total_pages='', total_pages=0):
# Function_level is useful if the function is called by another function. # Function_level is useful if the function is called by another function.
# If the call is direct, leave it blank # If the call is direct, leave it blank
logger.debug() logger.debug()
page=None
# page = item.page if item.page else 2
action = inspect.stack()[function_or_level][3] if type(function_or_level) == int else function_or_level action = inspect.stack()[function_or_level][3] if type(function_or_level) == int else function_or_level
if not data and not patron and not next_page: if not data and not patron and not next_page:
@@ -1197,6 +1203,11 @@ def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page=
if next_page == '': if next_page == '':
next_page = scrapertools.find_single_match(data, patron) next_page = scrapertools.find_single_match(data, patron)
if patron_total_pages:
found = scrapertools.find_single_match(data, patron_total_pages).replace('.','').replace(',','')
if found.isdigit():
total_pages = int(found)
if next_page != "": if next_page != "":
if resub: next_page = re.sub(resub[0], resub[1], next_page) if resub: next_page = re.sub(resub[0], resub[1], next_page)
if 'http' not in next_page: if 'http' not in next_page:
@@ -1211,22 +1222,29 @@ def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page=
title=typo(config.get_localized_string(30992), 'color kod bold'), title=typo(config.get_localized_string(30992), 'color kod bold'),
url=next_page, url=next_page,
nextPage=True, nextPage=True,
total_pages=total_pages,
page = page,
thumbnail=thumb())) thumbnail=thumb()))
return itemlist[-1] return itemlist[-1]
def pagination(itemlist, item, page, perpage, function_level=1): def pagination(itemlist, item, page, perpage, function_level=1):
itlist = []
for i, it in enumerate(itemlist):
if perpage and (page - 1) * perpage > i: continue # pagination
if perpage and i >= page * perpage: break # pagination
itlist.append(it)
if len(itemlist) >= page * perpage: if len(itemlist) >= page * perpage:
itemlist.append( itlist.append(
Item(channel=item.channel, item.clone(channel=item.channel,
action=inspect.stack()[function_level][3], action=inspect.stack()[function_level][3],
contentType=item.contentType, contentType=item.contentType,
title=typo(config.get_localized_string(30992), 'color kod bold'), title=typo(config.get_localized_string(30992), 'color kod bold'),
url=item.url,
args=item.args,
page=page + 1, page=page + 1,
total_pages=round(len(itemlist)/perpage),
nextPage=True,
thumbnail=thumb())) thumbnail=thumb()))
return itemlist return itlist
def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True, Download=True, patronTag=None, Videolibrary=True): def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True, Download=True, patronTag=None, Videolibrary=True):
+7 -4
View File
@@ -408,12 +408,11 @@ def set_infoLabels_item(item, seekTmdb=True, search_language=def_lang):
if otmdb.get_id() and config.get_setting("tmdb_plus_info", default=False): if otmdb.get_id() and config.get_setting("tmdb_plus_info", default=False):
# If the search has been successful and you are not looking for a list of items, # If the search has been successful and you are not looking for a list of items,
# carry out another search to expand the information # carry out another search to expand the information
if search_type == 'multi':
search_type = 'movie' if otmdb.result.get('media_type') else 'tv'
otmdb = Tmdb(id_Tmdb=otmdb.result.get("id"), search_type=search_type, otmdb = Tmdb(id_Tmdb=otmdb.result.get("id"), search_type=search_type,
search_language=search_language) search_language=search_language)
if otmdb and config.get_setting('tmdb_plus_info'):
info = otmdb.get_infoLabels(item.infoLabels)
otmdb = Tmdb(id_Tmdb=info['tmdb_id'], search_type=search_type,
search_language=search_language)
if otmdb is not None and otmdb.get_id(): if otmdb is not None and otmdb.get_id():
# The search has found a valid result # The search has found a valid result
@@ -437,8 +436,11 @@ def set_infoLabels_item(item, seekTmdb=True, search_language=def_lang):
ret = search(otmdb_global, search_type) ret = search(otmdb_global, search_type)
if not ret: # try with unified title if not ret: # try with unified title
backup = [item.fulltitle, item.infoLabels['tvshowtitle'], item.infoLabels['title']]
if unify(): if unify():
ret = search(otmdb_global, search_type) ret = search(otmdb_global, search_type)
if not ret:
item.fulltitle, item.infoLabels['tvshowtitle'], item.infoLabels['title'] = backup
return ret return ret
# Search in tmdb is deactivated or has not given result # Search in tmdb is deactivated or has not given result
# item.contentType = item.infoLabels['mediatype'] # item.contentType = item.infoLabels['mediatype']
@@ -607,6 +609,7 @@ def discovery(item, dict_=False, cast=False):
if dict_: if dict_:
if item.page: if item.page:
item.discovery={}
item.discovery['page'] = item.page item.discovery['page'] = item.page
listado = Tmdb(discover = dict_, cast=cast) listado = Tmdb(discover = dict_, cast=cast)
+11 -3
View File
@@ -149,15 +149,23 @@ def run(item=None):
else: else:
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % "\n".join([item.url[j:j+57] for j in range(0, len(item.url), 57)])) platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(70740) % "\n".join([item.url[j:j+57] for j in range(0, len(item.url), 57)]))
elif item.action == "gotopage": elif item.action == "gotopage":
page = platformtools.dialog_numeric(0, config.get_localized_string(70513)) from core import scrapertools
if page: head = config.get_localized_string(70511)
scraped_page = scrapertools.find_single_match(item.url,'[=/]([0-9]+)')
if item.total_pages and (item.page or scraped_page.isdigit()):
pages = [str(p) for p in range(1, item.total_pages + 1)]
page = item.page if item.page else int(scraped_page)
page = platformtools.dialog_select(head, pages, page - 2) + 1
else:
page = platformtools.dialog_numeric(0, head)
if page and int(page) > -1:
import xbmc import xbmc
item.action = item.real_action item.action = item.real_action
if item.page: if item.page:
item.page = page item.page = page
else: else:
import re import re
item.url = re.sub('([=/])[0-9]+(/?)$', '\g<1>' + page + '\g<2>', item.url) item.url = re.sub('([=/])[0-9]+(/?)$', '\g<1>{}\g<2>'.format(page), item.url)
xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl())) xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl()))
else: else:
# Checks if channel exists # Checks if channel exists
+20 -13
View File
@@ -346,9 +346,9 @@ def render_items(itemlist, parent_item):
itemlist.append(Item(title=config.get_localized_string(60347), thumbnail=thumb('nofolder'))) itemlist.append(Item(title=config.get_localized_string(60347), thumbnail=thumb('nofolder')))
dirItems = [] dirItems = []
# for n, item in enumerate(itemlist):
def set_item(n, item, parent_item): def set_item(n, item, parent_item):
item.itemlistPosition = n + 1 item.itemlistPosition = n
item_url = item.tourl() item_url = item.tourl()
if item.category == "": if item.category == "":
@@ -379,15 +379,16 @@ def render_items(itemlist, parent_item):
if episode: title = '{}. {}'.format(episode, title) if episode: title = '{}. {}'.format(episode, title)
if item.title2: title = '{} - {}'.format(title, item.title2) if item.title2: title = '{} - {}'.format(title, item.title2)
if config.get_setting('format_title'): if config.get_setting('format_title') or item.server:
server = typo(item.serverName, '_ []') if item.server else '' server = typo(item.serverName, '__ [] bold') if item.server else ''
quality = typo(item.quality, '_ [] color kod') if item.quality else '' quality = typo(item.quality, '_ [] color kod') if item.quality else ''
lang = typo(item.contentLanguage, '_ [] color kod') if item.contentLanguage else '' lang = typo(item.contentLanguage, '_ [] color kod') if item.contentLanguage else ''
extra = typo(item.extraInfo, '_ [] color kod') if item.extraInfo else '' extra = typo(item.extraInfo, '_ [] color kod') if item.extraInfo else ''
size = typo(item.size, '_ [] color kod') if item.size else '' size = typo(item.size, '_ [] color kod') if item.size else ''
seed = typo('Seed: ' + item.seed, '_ [] color kod') if item.seed else '' seed = typo('Seed: ' + item.seed, '_ [] color kod') if item.seed else ''
title = '{}{}{}{}{}{}{}'.format(title, server, quality, lang, extra, size, seed) title = '{}{}{}{}{}{}{}'.format(server, title, quality, lang, extra, size, seed)
listitem = xbmcgui.ListItem(title) listitem = xbmcgui.ListItem(title)
art = {'icon': icon_image, 'thumb': item.thumbnail, 'poster': item.thumbnail, 'fanart': item.fanart if item.fanart else default_fanart} art = {'icon': icon_image, 'thumb': item.thumbnail, 'poster': item.thumbnail, 'fanart': item.fanart if item.fanart else default_fanart}
@@ -426,6 +427,7 @@ def render_items(itemlist, parent_item):
# r_list = [set_item(i, item, parent_item) for i, item in enumerate(itemlist)] # r_list = [set_item(i, item, parent_item) for i, item in enumerate(itemlist)]
r_list = [] r_list = []
position = 0
with futures.ThreadPoolExecutor() as executor: with futures.ThreadPoolExecutor() as executor:
searchList = [executor.submit(set_item, i, item, parent_item) for i, item in enumerate(itemlist)] searchList = [executor.submit(set_item, i, item, parent_item) for i, item in enumerate(itemlist)]
@@ -434,9 +436,10 @@ def render_items(itemlist, parent_item):
r_list.sort(key=lambda it: it[0].itemlistPosition) r_list.sort(key=lambda it: it[0].itemlistPosition)
for item, item_url, listitem in r_list: for item, item_url, listitem in r_list:
# item, item_url, listitem = v if not position and not item.infoLabels.get('playcount', 0):
# if item.infoLabels.get('playcount', 0): pos = n + 2 position = item.itemlistPosition
dirItems.append(('%s?%s' % (sys.argv[0], item_url), listitem, item.folder, len(r_list))) dirItems.append(('%s?%s' % (sys.argv[0], item_url), listitem, item.folder, len(r_list)))
xbmcplugin.addDirectoryItems(_handle, dirItems) xbmcplugin.addDirectoryItems(_handle, dirItems)
@@ -464,12 +467,15 @@ def render_items(itemlist, parent_item):
logger.debug('END render_items') logger.debug('END render_items')
if parent_item.channel == 'videolibrary' and parent_item.action in ['get_episodes', 'get_season']: if parent_item.channel == 'videolibrary' and parent_item.action in ['get_episodes', 'get_season']:
_id = xbmcgui.getCurrentWindowId()
win = xbmcgui.Window(_id) while xbmcgui.getCurrentWindowDialogId() == 10138:
logger.debug('WINDOW ID', xbmcgui.getCurrentWindowDialogId())
xbmc.sleep(100)
xbmc.sleep(100)
win = xbmcgui.Window(10025)
cid = win.getFocusId() cid = win.getFocusId()
ctl = win.getControl(cid) ctl = win.getControl(cid)
xbmc.sleep(50) pos = position + (1 if xbmc.getInfoLabel('Container(10138).HasParent') else 0)
pos = int(xbmc.getInfoLabel('Container.TotalWatched')) + (1 if xbmc.getInfoLabel('Container(10138).HasParent') else 0)
ctl.selectItem(pos) ctl.selectItem(pos)
@@ -659,6 +665,8 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
return context_commands return context_commands
# Options according to criteria, only if the item is not a tag, nor is it "Add to the video library", etc... # Options according to criteria, only if the item is not a tag, nor is it "Add to the video library", etc...
if item.action and item.action not in ["add_movie_to_library", "add_serie_to_library", "buscartrailer", "actualizar_titulos"]: if item.action and item.action not in ["add_movie_to_library", "add_serie_to_library", "buscartrailer", "actualizar_titulos"]:
if item.nextPage:
context_commands.append((config.get_localized_string(70511), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=gotopage&real_action='+item.action)))
# Show information: if the item has a plot, we assume that it is a series, season, chapter or movie # Show information: if the item has a plot, we assume that it is a series, season, chapter or movie
# if item.infoLabels['plot'] and (num_version_xbmc < 17.0 or item.contentType == 'season'): # if item.infoLabels['plot'] and (num_version_xbmc < 17.0 or item.contentType == 'season'):
# context_commands.append((config.get_localized_string(60348), "Action(Info)")) # context_commands.append((config.get_localized_string(60348), "Action(Info)"))
@@ -734,8 +742,7 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
if (item.contentTitle and item.contentType in ['movie', 'tvshow']) or "buscar_trailer" in context: if (item.contentTitle and item.contentType in ['movie', 'tvshow']) or "buscar_trailer" in context:
context_commands.append((config.get_localized_string(60359), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({ 'channel': "trailertools", 'action': "buscartrailer", 'search_title': item.contentTitle if item.contentTitle else item.fulltitle, 'contextual': True})))) context_commands.append((config.get_localized_string(60359), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, urllib.urlencode({ 'channel': "trailertools", 'action': "buscartrailer", 'search_title': item.contentTitle if item.contentTitle else item.fulltitle, 'contextual': True}))))
if item.nextPage:
context_commands.append((config.get_localized_string(70511), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=gotopage&real_action='+item.action)))
if config.dev_mode(): if config.dev_mode():
context_commands.insert(0, ("item info", "Container.Update (%s?%s)" % (sys.argv[0], Item(action="itemInfo", parent=item.tojson()).tourl()))) context_commands.insert(0, ("item info", "Container.Update (%s?%s)" % (sys.argv[0], Item(action="itemInfo", parent=item.tojson()).tourl())))
return context_commands return context_commands
+1 -2
View File
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from platformcode import logger from platformcode import logger, platformtools
def context(): def context():
from platformcode import config from platformcode import config
+207 -44
View File
@@ -37,7 +37,7 @@
<width>100%</width> <width>100%</width>
<height>100%</height> <height>100%</height>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
<texture colordiffuse="FF555555">$INFO[Container(102).ListItem.Property(fanart)]</texture> <texture colordiffuse="FF555555">$INFO[Container(102).ListItem.Art(fanart)]</texture>
</control> </control>
@@ -63,47 +63,194 @@
<description>Search Result Group</description> <description>Search Result Group</description>
<visible>Integer.IsGreater(Container(102).NumItems, 0)</visible> <visible>Integer.IsGreater(Container(102).NumItems, 0)</visible>
<animation effect="fade" time="200">Visible</animation> <animation effect="fade" time="200">Visible</animation>
<control type='group'>
<control type="textbox">
<description>Item Title</description>
<left>400</left> <left>400</left>
<top>90</top> <top>90</top>
<control type='group'>
<visible>!String.IsEmpty(Container(102).ListItem.Property(rating))</visible>
<control type='image'>
<description>Rating Circle</description>
<top>0</top>
<left>0</left>
<width>60</width>
<height>60</height>
<texture colordiffuse='$INFO[Container(102).ListItem.Property(color)]'>Circular/$INFO[Container(102).ListItem.Property(rating)].png</texture>
<aspectratio>keep</aspectratio>
</control>
<control type='textbox'>
<description>Rating</description>
<visible>!String.IsEmpty(Container(102).ListItem.Rating())</visible>
<top>15</top>
<left>10</left>
<height>30</height>
<width>40</width>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(102).ListItem.Rating()]</label>
<align>center</align>
<aligny>center</aligny>
</control>
<control type='textbox'>
<description>NO Rating</description>
<visible>String.IsEmpty(Container(102).ListItem.Rating())</visible>
<top>15</top>
<left>10</left>
<height>30</height>
<width>40</width>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>N/A</label>
<align>center</align>
<aligny>center</aligny>
</control>
<control type="textbox">
<description>Item Title</description>
<left>80</left>
<top>0</top>
<width>840</width> <width>840</width>
<height>60</height> <height>60</height>
<font>font13</font> <font>font13</font>
<textcolor>FFFFFFFF</textcolor> <textcolor>FFFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor> <shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(102).ListItem.Label][B][COLOR FFAAAAAA]$INFO[Container(102).ListItem.Property(year)]$INFO[Container(102).ListItem.Property(rating)][CR]$INFO[Container(102).ListItem.Property(channel)][/COLOR][/B]</label> <label>$INFO[Container(102).ListItem.Label]</label>
<align>left</align>
<aligny>center</aligny>
</control>
</control>
<control type="textbox">
<visible>String.IsEmpty(Container(102).ListItem.Property(rating))</visible>
<description>Item Title</description>
<left>0</left>
<top>0</top>
<width>840</width>
<height>60</height>
<font>font13</font>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(102).ListItem.Label]</label>
<align>left</align> <align>left</align>
<aligny>center</aligny> <aligny>center</aligny>
</control> </control>
<control type="textbox"> <control type="textbox">
<description>Item Title</description> <description>Item Count</description>
<left>1040</left> <left>640</left>
<top>91</top> <top>1</top>
<width>200</width> <width>200</width>
<height>30</height> <height>30</height>
<font>font13</font> <font>font13</font>
<textcolor>FFFFFFFF</textcolor> <textcolor>FFAAAAAA</textcolor>
<shadowcolor>00000000</shadowcolor> <shadowcolor>00000000</shadowcolor>
<label>[B][COLOR FFAAAAAA]$INFO[Container(102).CurrentItem]/$INFO[Container(102).NumItems][/COLOR][/B]</label> <label>[B]$INFO[Container(102).CurrentItem]/$INFO[Container(102).NumItems][/B]</label>
<align>right</align> <align>right</align>
<aligny>center</aligny> <aligny>center</aligny>
</control> </control>
<control type="textbox">
<description>Item Plot</description> <!-- Video Info -->
<left>400</left> <control type='group'>
<top>170</top> <description>Video Info</description>
<visible>Integer.IsGreater(Container(102).NumItems, 0)</visible>
<top>80</top>
<height>120</height>
<width>840</width> <width>840</width>
<height>170</height> <control type='grouplist'>
<font>font13</font> <top>0</top>
<textcolor>FFFFFFFF</textcolor> <height>30</height>
<shadowcolor>00000000</shadowcolor> <width>300</width>
<label>$INFO[Container(102).ListItem.Property(plot)]</label> <itemgap>10</itemgap>
<autoscroll time="3000" delay="3000" repeat="3000">True</autoscroll> <orientation>horizontal</orientation>
<align>left</align> <align>left</align>
<control type='textbox'>
<description>Year</description>
<height>30</height>
<width>45</width>
<font>font13</font>
<textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(102).ListItem.Year]</label>
<align>left</align>
<aligny>center</aligny>
</control>
<control type='textbox'>
<description>Separator</description>
<height>30</height>
<width>10</width>
<font>font13</font>
<textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<visible>!String.IsEmpty(Container(102).ListItem.Duration())</visible>
<label>[B]•[/B]</label>
<align>center</align>
<aligny>center</aligny>
</control>
<control type='textbox'>
<description>Duration</description>
<height>30</height>
<width>50</width>
<font>font13</font>
<textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(102).ListItem.Duration(hh:mm)]</label>
<align>left</align>
<aligny>center</aligny>
</control>
<control type='textbox'>
<description>Separator</description>
<height>30</height>
<width>10</width>
<font>font13</font>
<textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<visible>!String.IsEmpty(Container(102).ListItem.Mpaa)</visible>
<label>[B]•[/B]</label>
<align>center</align>
<aligny>center</aligny>
</control>
<control type='textbox'>
<description>Mpaa</description>
<height>30</height>
<width>60</width>
<font>font13</font>
<textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(102).ListItem.Mpaa]</label>
<align>left</align>
<aligny>center</aligny>
</control>
</control>
<control type='textbox'>
<description>Genre</description>
<visible>!String.isEmpty(Container(102).ListItem.Genre</visible>
<right>0</right>
<height>30</height>
<width>600</width>
<font>font13</font>
<textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>[B]$ADDON[plugin.video.kod 70499][/B] $INFO[Container(102).ListItem.Genre]</label>
<align>right</align>
<aligny>center</aligny>
</control>
<control type='textbox'>
<description>Plot</description>
<top>40</top>
<left>0</left>
<height>150</height>
<font>font13</font>
<textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(102).ListItem.Plot]</label>
<align>justify</align>
<aligny>top</aligny>
<autoscroll time='3000' delay='3000' repeat='3000'>True</autoscroll>
</control>
</control>
</control> </control>
<control type="fixedlist" id="102"> <control type="fixedlist" id="102">
@@ -126,7 +273,7 @@
<left>0</left> <left>0</left>
<width>180</width> <width>180</width>
<height>270</height> <height>270</height>
<texture colordiffuse="FF999999">$INFO[ListItem.Property(thumb)]</texture> <texture colordiffuse="FF999999">$INFO[ListItem.Art(poster)]</texture>
<visible>!Control.HasFocus(102)</visible> <visible>!Control.HasFocus(102)</visible>
<bordersize>10</bordersize> <bordersize>10</bordersize>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
@@ -137,7 +284,7 @@
<left>0</left> <left>0</left>
<width>180</width> <width>180</width>
<height>270</height> <height>270</height>
<texture>$INFO[ListItem.Property(thumb)]</texture> <texture>$INFO[ListItem.Art(poster)]</texture>
<visible>Control.HasFocus(102)</visible> <visible>Control.HasFocus(102)</visible>
<bordersize>10</bordersize> <bordersize>10</bordersize>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
@@ -178,7 +325,7 @@
<left>0</left> <left>0</left>
<width>380</width> <width>380</width>
<height>570</height> <height>570</height>
<texture colordiffuse="FF999999">$INFO[ListItem.Property(thumb)]</texture> <texture colordiffuse="FF999999">$INFO[ListItem.Art(poster)]</texture>
<visible>!Control.HasFocus(102)</visible> <visible>!Control.HasFocus(102)</visible>
<bordersize>10</bordersize> <bordersize>10</bordersize>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
@@ -189,7 +336,7 @@
<left>0</left> <left>0</left>
<width>380</width> <width>380</width>
<height>570</height> <height>570</height>
<texture>$INFO[ListItem.Property(thumb)]</texture> <texture>$INFO[ListItem.Art(poster)]</texture>
<visible>Control.HasFocus(102)</visible> <visible>Control.HasFocus(102)</visible>
<bordersize>10</bordersize> <bordersize>10</bordersize>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
@@ -238,31 +385,45 @@
<control type="group"> <!-- Chennels Group--> <control type="group"> <!-- Chennels Group-->
<description>Chennels Group</description> <description>Chennels Group</description>
<bottom>-100</bottom> <bottom>-160</bottom>
<width>100%</width> <width>100%</width>
<height>150</height> <height>200</height>
<animation effect="slide" start="0,150" time="500" condition="Integer.IsGreater(Container(101).NumItems, 0)">Conditional</animation> <animation effect="slide" start="0,150" time="500" condition="Integer.IsGreater(Container(101).NumItems, 0)">Conditional</animation>
<animation effect="slide" start="0,-100" time="200" condition="!Control.HasFocus(101)">Conditional</animation> <animation effect="slide" start="0,-160" time="200" condition="!Control.HasFocus(101)">Conditional</animation>
<visible>Integer.IsGreater(Container(101).NumItems, 0)</visible> <visible>Integer.IsGreater(Container(101).NumItems, 0)</visible>
<control type="button" id='506'>
<description>Chennels Bar Tab</description>
<top>0</top>
<left>575</left>
<width>130</width>
<height>30</height>
<texturefocus colordiffuse="FF232323">tab.png</texturefocus>
<texturenofocus colordiffuse="FF232323">tab.png</texturenofocus>
</control>
<control type="image"> <control type="image">
<description>Chennels Bar Background Opacity on hover</description> <description>Chennels Bar Arrow</description>
<width>100%</width> <top>8</top>
<height>100%</height> <left>633</left>
<animation effect="fade" start='100' end='0' time="200" condition="!Control.HasFocus(101)">Conditional</animation> <width>14</width>
<texture colordiffuse="FF232323">white.png</texture> <height>14</height>
<texture colordiffuse="FFFFFFFF">dd.png</texture>
<aspectratio align='center' aligny='center'>keep</aspectratio>
<animation effect="rotate" center= 'auto' end="180" time="200" condition="Control.HasFocus(101)">Conditional</animation>
</control> </control>
<control type="image"> <control type="image">
<description>Chennels Bar Background</description> <description>Chennels Bar Background</description>
<top>30</top>
<width>100%</width> <width>100%</width>
<height>100%</height> <height>180</height>
<texture colordiffuse="88232323">white.png</texture> <texture colordiffuse="FF232323">white.png</texture>
</control> </control>
<control type="list" id="101"> <control type="list" id="101">
<description>Channels list</description> <description>Channels list</description>
<width>100%</width> <width>100%</width>
<top>40</top>
<height>150</height> <height>150</height>
<onup>102</onup> <onup>102</onup>
<orientation>horizontal</orientation> <orientation>horizontal</orientation>
@@ -275,7 +436,8 @@
<left>0</left> <left>0</left>
<width>150</width> <width>150</width>
<height>150</height> <height>150</height>
<texture colordiffuse="55FFFFFF">$INFO[ListItem.Property(thumb)]</texture> <texture>$INFO[ListItem.Property(thumb)]</texture>
<bordersize>2</bordersize>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
</control> </control>
<control type="image"> <control type="image">
@@ -284,7 +446,7 @@
<left>110</left> <left>110</left>
<width>40</width> <width>40</width>
<height>40</height> <height>40</height>
<texture colordiffuse="20232323">white.png</texture> <texture colordiffuse="FF232323">white.png</texture>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
</control> </control>
<control type="textbox"> <control type="textbox">
@@ -309,6 +471,8 @@
<width>150</width> <width>150</width>
<height>150</height> <height>150</height>
<texture>$INFO[ListItem.Property(thumb)]</texture> <texture>$INFO[ListItem.Property(thumb)]</texture>
<bordersize>2</bordersize>
<bordertexture colordiffuse='FF0082C2'>white.png</bordertexture>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
</control> </control>
<control type="image"> <control type="image">
@@ -317,7 +481,7 @@
<left>110</left> <left>110</left>
<width>40</width> <width>40</width>
<height>40</height> <height>40</height>
<texture colordiffuse="880082C2">white.png</texture> <texture colordiffuse="FF0082C2">white.png</texture>
<aspectratio>scale</aspectratio> <aspectratio>scale</aspectratio>
</control> </control>
<control type="textbox"> <control type="textbox">
@@ -339,7 +503,6 @@
</control> <!-- END SEARCH GROUP--> </control> <!-- END SEARCH GROUP-->
<control type="group"> <!-- EPISODES GROUP--> <control type="group"> <!-- EPISODES GROUP-->
<description>Episodes Group</description> <description>Episodes Group</description>
<visible>Control.IsVisible(2)</visible> <visible>Control.IsVisible(2)</visible>
@@ -619,18 +782,18 @@
<animation effect="slide" tween="linear" center="auto" end="0,-890" time="600" condition="Integer.IsGreater(Container(102).NumItems, 0)">Conditional</animation> <animation effect="slide" tween="linear" center="auto" end="0,-890" time="600" condition="Integer.IsGreater(Container(102).NumItems, 0)">Conditional</animation>
</control> </control>
<control type="textbox" id="501"> <control type="label" id="501">
<description>Progress Count</description> <description>Progress Count</description>
<top>340</top> <top>270</top>
<left>950</left> <left>450</left>
<width>200</width> <width>180</width>
<height>40</height> <height>30</height>
<font>font13</font> <font>font13</font>
<textcolor>FFFFFFFF</textcolor> <textcolor>FFFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor> <shadowcolor>00000000</shadowcolor>
<align>right</align> <align>right</align>
<aligny>center</aligny> <aligny>center</aligny>
<animation effect="slide" tween="linear" center="auto" end="-40,-311" time="200" condition="Integer.IsGreater(Container(101).NumItems, 0)">Conditional</animation> <animation effect="slide" tween="linear" center="0" end="-450,-240" time="600" condition="Integer.IsGreater(Container(102).NumItems, 0)">Conditional</animation>
<visible>Control.IsVisible(500)</visible> <visible>Control.IsVisible(500)</visible>
</control> </control>
+20 -6
View File
@@ -59,7 +59,7 @@
<width>60</width> <width>60</width>
<height>60</height> <height>60</height>
<texture colordiffuse='$INFO[Container(100).ListItem.Property(color)]'>Circular/$INFO[Container(100).ListItem.Property(rating)].png</texture> <texture colordiffuse='$INFO[Container(100).ListItem.Property(color)]'>Circular/$INFO[Container(100).ListItem.Property(rating)].png</texture>
<aspectratio>scale</aspectratio> <aspectratio aligny='center'>keep</aspectratio>
</control> </control>
<control type='textbox'> <control type='textbox'>
<description>Rating</description> <description>Rating</description>
@@ -145,7 +145,7 @@
<aligny>center</aligny> <aligny>center</aligny>
</control> </control>
<control type='textbox'> <control type='textbox'>
<description>Year</description> <description>Duration</description>
<height>30</height> <height>30</height>
<width>50</width> <width>50</width>
<font>font13</font> <font>font13</font>
@@ -168,7 +168,7 @@
<aligny>center</aligny> <aligny>center</aligny>
</control> </control>
<control type='textbox'> <control type='textbox'>
<description>Year</description> <description>Mpaa</description>
<height>30</height> <height>30</height>
<width>60</width> <width>60</width>
<font>font13</font> <font>font13</font>
@@ -179,6 +179,18 @@
<aligny>center</aligny> <aligny>center</aligny>
</control> </control>
</control> </control>
<control type='textbox'>
<description>Genre</description>
<right>0</right>
<height>30</height>
<width>400</width>
<font>font13</font>
<textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(100).ListItem.Genre]</label>
<align>right</align>
<aligny>center</aligny>
</control>
<control type='textbox'> <control type='textbox'>
<description>Plot</description> <description>Plot</description>
<top>50</top> <top>50</top>
@@ -188,7 +200,7 @@
<textcolor>ffFFFFFF</textcolor> <textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor> <shadowcolor>00000000</shadowcolor>
<label>$INFO[Container(100).ListItem.Plot]</label> <label>$INFO[Container(100).ListItem.Plot]</label>
<align>left</align> <align>justify</align>
<aligny>top</aligny> <aligny>top</aligny>
<autoscroll time='3000' delay='3000' repeat='3000'>True</autoscroll> <autoscroll time='3000' delay='3000' repeat='3000'>True</autoscroll>
</control> </control>
@@ -376,6 +388,7 @@
<top>20</top> <top>20</top>
<left>40</left> <left>40</left>
<height>30</height> <height>30</height>
<width>450</width>
<font>font13</font> <font>font13</font>
<textcolor>ffFFFFFF</textcolor> <textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor> <shadowcolor>00000000</shadowcolor>
@@ -383,13 +396,14 @@
<align>left</align> <align>left</align>
<aligny>center</aligny> <aligny>center</aligny>
</control> </control>
<control type='textbox'> <control type='label'>
<description>Name</description> <description>Name</description>
<top>20</top> <top>20</top>
<right>50</right> <right>50</right>
<width>40</width> <width>40</width>
<height>30</height> <height>30</height>
<font>font13</font> <font>font13</font>
<scroll>true</scroll>
<textcolor>ffFFFFFF</textcolor> <textcolor>ffFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor> <shadowcolor>00000000</shadowcolor>
<label>[B]$INFO[Container(102).ListItem.Rating][/B]</label> <label>[B]$INFO[Container(102).ListItem.Rating][/B]</label>
@@ -403,7 +417,7 @@
<width>30</width> <width>30</width>
<height>30</height> <height>30</height>
<texture colordiffuse='$INFO[Container(102).ListItem.Property(color)]'>Circular/$INFO[Container(102).ListItem.Property(rating)].png</texture> <texture colordiffuse='$INFO[Container(102).ListItem.Property(color)]'>Circular/$INFO[Container(102).ListItem.Property(rating)].png</texture>
<aspectratio>scale</aspectratio> <aspectratio aligny='center'>keep</aspectratio>
</control> </control>
<control type='textbox'> <control type='textbox'>
<description>Plot</description> <description>Plot</description>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+1 -1
View File
@@ -4,7 +4,7 @@
"ignore_urls": [], "ignore_urls": [],
"patterns": [ "patterns": [
{ {
"pattern": "userload.co/embed/([a-z0-9]+)", "pattern": "userload.co/(?:embed|f)/([a-z0-9]+)",
"url": "https://userload.co/e/\\1" "url": "https://userload.co/e/\\1"
} }
] ]
+49 -25
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import threading import threading
from core import support from core import jsontools, support
import xbmc, xbmcgui, sys, channelselector, time, os import xbmc, xbmcgui, sys, channelselector, time, os
from core.support import dbg, tmdb from core.support import dbg, tmdb
@@ -67,6 +67,7 @@ MENU = 502
BACK = 503 BACK = 503
CLOSE = 504 CLOSE = 504
QUALITYTAG = 505 QUALITYTAG = 505
TAB = 506
# Servers # Servers
EPISODESLIST = 200 EPISODESLIST = 200
@@ -165,7 +166,8 @@ class SearchWindow(xbmcgui.WindowXML):
tmdb_info = tmdb.Tmdb(searched_text=self.item.text, search_type=self.item.mode.replace('show', '')) tmdb_info = tmdb.Tmdb(searched_text=self.item.text, search_type=self.item.mode.replace('show', ''))
results = tmdb_info.results results = tmdb_info.results
for result in results:
def make(n, result):
result = tmdb_info.get_infoLabels(result, origen=result) result = tmdb_info.get_infoLabels(result, origen=result)
if self.item.mode == 'movie': if self.item.mode == 'movie':
title = result['title'] title = result['title']
@@ -177,17 +179,12 @@ class SearchWindow(xbmcgui.WindowXML):
title = result.get('title', '') title = result.get('title', '')
result['mode'] = result['media_type'].replace('tv', 'tvshow') result['mode'] = result['media_type'].replace('tv', 'tvshow')
thumbnail = result.get('thumbnail', '')
noThumb = 'Infoplus/' + result['mode'].replace('show','') + '.png' noThumb = 'Infoplus/' + result['mode'].replace('show','') + '.png'
fanart = result.get('fanart', '') rating = result.get('vote_average', 0)
year = result.get('release_date', '')
rating = str(result.get('vote_average', ''))
new_item = Item(channel='globalsearch', new_item = Item(channel='globalsearch',
action=True, action=True,
title=title, title=title,
thumbnail=thumbnail,
fanart=fanart,
mode='search', mode='search',
type=result['mode'], type=result['mode'],
contentType=result['mode'], contentType=result['mode'],
@@ -198,12 +195,26 @@ class SearchWindow(xbmcgui.WindowXML):
new_item.contentTitle = result['title'] new_item.contentTitle = result['title']
else: else:
new_item.contentSerieName = result['name'] new_item.contentSerieName = result['name']
tmdb.set_infoLabels(new_item)
tagline = new_item.infoLabels.get('tagline')
it = xbmcgui.ListItem('[B]{}[/B]'.format(title) + ('\n[I]{}[/I]'.format(tagline if tagline else '')))
it.setArt({'poster':result.get('thumbnail', noThumb), 'fanart':result.get('fanart', '')})
it = xbmcgui.ListItem(title) platformtools.set_infolabels(it, new_item)
it.setProperties({'thumb': result.get('thumbnail', noThumb), 'fanart': result.get('fanart', ''), 'rating': ' [' + rating + ']' if rating else '', # logger.debug(jsontools.dump(result))
'plot': result.get('overview', ''), 'search': 'search', 'release_date': '', 'item': new_item.tourl(), # logger.debug(new_item)
'year': ' [' + year.split('/')[-1] + ']' if year else ' [' + result.get('first_air_date','').split('-')[0] + ']'})
self.items.append(it) color = 'FFFFFFFF' if not rating else 'FFDB2360' if rating < 4 else 'FFD2D531' if rating < 7 else 'FF21D07A'
it.setProperties({'rating': str(int(rating) * 10) if rating else 100, 'color':color, 'item': new_item.tourl(), 'search': 'search'})
return n, it
r_list = []
with futures.ThreadPoolExecutor() as executor:
searchList = [executor.submit(make, n, result) for n, result in enumerate(results)]
for res in futures.as_completed(searchList):
r_list.append(res.result())
r_list.sort(key=lambda r: r[0] )
self.items = [r[1] for r in r_list]
if self.items: if self.items:
self.RESULTS.reset() self.RESULTS.reset()
@@ -248,19 +259,22 @@ class SearchWindow(xbmcgui.WindowXML):
action=True, action=True,
title=name, title=name,
thumbnail=thumb, thumbnail=thumb,
plot= plot,
mode='search') mode='search')
it = xbmcgui.ListItem(name) it = xbmcgui.ListItem(name)
it.setProperties({'thumb': thumb, 'plot': plot, 'search': 'persons', 'item': new_item.tourl()}) platformtools.set_infolabels(it, new_item)
it.setArt({'poster':thumb})
it.setProperties({'search': 'persons', 'item': new_item.tourl()})
items.append(it) items.append(it)
if len(results) > 19: if len(results) > 19:
it = xbmcgui.ListItem(config.get_localized_string(70006)) it = xbmcgui.ListItem(config.get_localized_string(70006))
it.setProperty('thumb', 'Infoplus/next_focus.png') it.setArt({'poster':'Infoplus/next_focus.png'})
it.setProperty('search','next') it.setProperty('search','next')
items.append(it) items.append(it)
if self.page > 1: if self.page > 1:
it = xbmcgui.ListItem(config.get_localized_string(70005)) it = xbmcgui.ListItem(config.get_localized_string(70005))
it.setProperty('thumb', 'Infoplus/previous_focus.png') it.setArt({'poster':'Infoplus/previous_focus.png'})
it.setProperty('search','previous') it.setProperty('search','previous')
items.insert(0, it) items.insert(0, it)
@@ -308,7 +322,8 @@ class SearchWindow(xbmcgui.WindowXML):
except ZeroDivisionError: except ZeroDivisionError:
percent = 0 percent = 0
self.PROGRESS.setPercent(percent) self.PROGRESS.setPercent(percent)
self.COUNT.setText('%s/%s [%s"]' % (self.count, len(self.searchActions), int(time.time() - self.time))) self.MAINTITLE.setText('{} | {}/{} [{}"]'.format(self.mainTitle,self.count, len(self.searchActions), int(time.time() - self.time)))
# self.COUNT.setText('%s/%s [%s"]' % (self.count, len(self.searchActions), int(time.time() - self.time)))
if percent == 100: if percent == 100:
self.channels = [] self.channels = []
self.moduleDict = {} self.moduleDict = {}
@@ -393,13 +408,20 @@ class SearchWindow(xbmcgui.WindowXML):
def makeItem(self, url): def makeItem(self, url):
item = Item().fromurl(url) item = Item().fromurl(url)
channelParams = channeltools.get_channel_parameters(item.channel) 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 '')
thumb = item.thumbnail if item.thumbnail else 'Infoplus/' + item.contentType.replace('show', '') + '.png' thumb = item.thumbnail if item.thumbnail else 'Infoplus/' + item.contentType.replace('show', '') + '.png'
logger.info('THUMB', thumb)
it = xbmcgui.ListItem(item.title) it = xbmcgui.ListItem(title)
year = str(item.year if item.year else item.infoLabels.get('year', '')) it.setArt({'poster':thumb, 'fanart':item.fanart})
rating = str(item.infoLabels.get('rating', '')) platformtools.set_infolabels(it, item)
it.setProperties({'thumb': thumb, 'fanart': item.fanart, 'plot': item.plot, logger.debug(item)
'year': ' [' + year + ']' if year else '', 'rating':' [' + rating + ']' if rating else '',
rating = info.get('rating')
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': url, 'verified': item.verified, 'channel':channelParams['title'], 'channelthumb': channelParams['thumbnail'] if item.verified else ''})
if item.server: if item.server:
color = scrapertools.find_single_match(item.alive, r'(FF[^\]]+)') color = scrapertools.find_single_match(item.alive, r'(FF[^\]]+)')
@@ -485,6 +507,7 @@ class SearchWindow(xbmcgui.WindowXML):
def onInit(self): def onInit(self):
self.time = time.time() self.time = time.time()
self.mainTitle = config.get_localized_string(30993).replace('...', '') % '"%s"' % self.item.text
# collect controls # collect controls
self.CHANNELS = self.getControl(CHANNELS) self.CHANNELS = self.getControl(CHANNELS)
@@ -492,7 +515,7 @@ class SearchWindow(xbmcgui.WindowXML):
self.PROGRESS = self.getControl(PROGRESS) self.PROGRESS = self.getControl(PROGRESS)
self.COUNT = self.getControl(COUNT) self.COUNT = self.getControl(COUNT)
self.MAINTITLE = self.getControl(MAINTITLE) self.MAINTITLE = self.getControl(MAINTITLE)
self.MAINTITLE.setText(config.get_localized_string(30993).replace('...', '') % '"%s"' % self.item.text) self.MAINTITLE.setText(self.mainTitle)
self.SEARCH = self.getControl(SEARCH) self.SEARCH = self.getControl(SEARCH)
self.EPISODES = self.getControl(EPISODES) self.EPISODES = self.getControl(EPISODES)
self.EPISODESLIST = self.getControl(EPISODESLIST) self.EPISODESLIST = self.getControl(EPISODESLIST)
@@ -589,7 +612,7 @@ class SearchWindow(xbmcgui.WindowXML):
if self.RESULTS.getSelectedItem(): search = self.RESULTS.getSelectedItem().getProperty('search') if self.RESULTS.getSelectedItem(): search = self.RESULTS.getSelectedItem().getProperty('search')
else: search = None else: search = None
if control_id in [CHANNELS]: if control_id in [CHANNELS, TAB]:
items = [] items = []
name = self.CHANNELS.getSelectedItem().getLabel() name = self.CHANNELS.getSelectedItem().getLabel()
subpos = int(self.CHANNELS.getSelectedItem().getProperty('position')) subpos = int(self.CHANNELS.getSelectedItem().getProperty('position'))
@@ -600,6 +623,7 @@ class SearchWindow(xbmcgui.WindowXML):
self.RESULTS.addItems(items) self.RESULTS.addItems(items)
self.RESULTS.selectItem(subpos) self.RESULTS.selectItem(subpos)
self.CHANNELS.getSelectedItem().setProperty('position', str(subpos)) self.CHANNELS.getSelectedItem().setProperty('position', str(subpos))
self.setFocusId(CHANNELS)
elif control_id in [BACK]: elif control_id in [BACK]:
self.Back() self.Back()