Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -5,13 +5,17 @@
|
||||
"""
|
||||
|
||||
Problemi noti che non superano il test del canale:
|
||||
- indicare i problemi
|
||||
- Nella ricerca globale non sono presenti le voci:
|
||||
- "Aggiungi in videoteca"
|
||||
- "Scarica film/serie"
|
||||
presenti però quando si entra nella pagina
|
||||
|
||||
Avvisi:
|
||||
-
|
||||
|
||||
|
||||
Novità:
|
||||
- Film, SerieTv
|
||||
|
||||
Ulteriori info:
|
||||
|
||||
"""
|
||||
@@ -20,7 +24,7 @@ from core import support
|
||||
from platformcode import config
|
||||
|
||||
# in caso di necessità
|
||||
from core import scrapertoolsV2, httptools#, servertools, tmdb
|
||||
from core import scrapertoolsV2, httptools
|
||||
from core.item import Item
|
||||
|
||||
|
||||
@@ -35,14 +39,15 @@ list_quality = ['HD', 'SD']
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log(item)
|
||||
## support.dbg()
|
||||
|
||||
film = ['/category/film',
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Sub-ITA', ['/category/sub-ita/', 'peliculas', 'sub'])
|
||||
]
|
||||
|
||||
tvshow = ['/aggiornamenti-serie-tv',
|
||||
('Ultime', ['/category/serie-tv', 'peliculas', '']),
|
||||
tvshow = ['/category/serie-tv',
|
||||
('Novità', ['/aggiornamenti-serie-tv', 'peliculas', '']),
|
||||
]
|
||||
|
||||
search = ''
|
||||
@@ -52,11 +57,11 @@ def mainlist(item):
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.log(item)
|
||||
#dbg # decommentare per attivare web_pdb
|
||||
## support.dbg() # decommentare per attivare web_pdb
|
||||
|
||||
if item.contentType == 'movie':
|
||||
action = 'findvideos'
|
||||
if item.contentType == 'tvshow':
|
||||
elif item.contentType == 'tvshow':
|
||||
action = 'episodios'
|
||||
pagination = ''
|
||||
else:
|
||||
@@ -95,7 +100,7 @@ def episodios(item):
|
||||
## debug = True
|
||||
return locals()
|
||||
|
||||
# Questa def è utilizzata per generare i menu del canale
|
||||
# Questa def è utilizzata per generare il menu 'Generi' del canale
|
||||
# per genere, per anno, per lettera, per qualità ecc ecc
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
@@ -103,7 +108,7 @@ def genres(item):
|
||||
#dbg
|
||||
|
||||
action = 'peliculas'
|
||||
blacklist = ['PRIME VISIONI', 'ULTIME SERIE TV']
|
||||
blacklist = ['PRIME VISIONI', 'ULTIME SERIE TV', 'ULTIMI FILM']
|
||||
patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<>]+)</a></li>'
|
||||
patronBlock = r'<div class="container home-cats">(?P<block>.*?)<div class="clear">'
|
||||
|
||||
@@ -112,7 +117,7 @@ def genres(item):
|
||||
|
||||
def select(item):
|
||||
support.log('select --->', item)
|
||||
debug = True
|
||||
## debug = True
|
||||
#support.dbg()
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
data = re.sub('\n|\t', ' ', data)
|
||||
@@ -148,8 +153,8 @@ def search(item, text):
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/?s=' + text
|
||||
item.args = 'search'
|
||||
item.contentType = 'episode' # non fa uscire le voci nel context menu
|
||||
try:
|
||||
item.contentType = 'episode' # non fa uscire le voci nel context menu
|
||||
return peliculas(item)
|
||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||
except:
|
||||
|
||||
@@ -515,6 +515,7 @@ def play_from_library(item):
|
||||
return
|
||||
else:
|
||||
item = videolibrary.play(itemlist[seleccion])[0]
|
||||
item.play_from = 'window'
|
||||
platformtools.play_video(item)
|
||||
|
||||
from specials import autoplay
|
||||
|
||||
@@ -673,6 +673,8 @@ def is_playing():
|
||||
|
||||
def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||
logger.info()
|
||||
if item.play_from == 'window':
|
||||
force_direct=True
|
||||
# logger.debug(item.tostring('\n'))
|
||||
logger.debug('item play: %s'%item)
|
||||
xbmc_player = XBMCPlayer()
|
||||
@@ -916,10 +918,10 @@ def get_dialogo_opciones(item, default_action, strm, autoplay):
|
||||
# "Descargar"
|
||||
import xbmcaddon
|
||||
addon = xbmcaddon.Addon('plugin.video.kod')
|
||||
downloadenabled = addon.getSetting('downloadenabled')
|
||||
if downloadenabled != "false":
|
||||
opcion = config.get_localized_string(30153)
|
||||
opciones.append(opcion)
|
||||
# downloadenabled = addon.getSetting('downloadenabled')
|
||||
# if downloadenabled != "false":
|
||||
# opcion = config.get_localized_string(30153)
|
||||
# opciones.append(opcion)
|
||||
|
||||
if item.isFavourite:
|
||||
# "Quitar de favoritos"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "wstream.video/(?:embed-|videos/|video/)?([a-z0-9A-Z]+)",
|
||||
"url": "http:\/\/wstream.video\/video\/\\1"
|
||||
"url": "http:\/\/wstream.video\/videow\/\\1"
|
||||
}
|
||||
],
|
||||
"ignore_urls": [ ]
|
||||
|
||||
@@ -17,6 +17,7 @@ from core.item import Item
|
||||
from platformcode import logger, config, platformtools
|
||||
from specials import autoplay
|
||||
from specials import filtertools
|
||||
from core.support import typo
|
||||
|
||||
list_data = {}
|
||||
|
||||
@@ -49,7 +50,7 @@ def show_channels(item):
|
||||
file = open(path, "r")
|
||||
json = jsontools.load(file.read())
|
||||
|
||||
itemlist.append(Item(channel=item.channel, title=config.get_localized_string(70676), action='add_channel', thumbnail=get_thumb('add.png')))
|
||||
itemlist.append(Item(channel=item.channel, title=typo(config.get_localized_string(70676),'bold color kod'), action='add_channel', thumbnail=get_thumb('add.png')))
|
||||
|
||||
for key, channel in json['channels'].items():
|
||||
file_path = channel ['path']
|
||||
@@ -59,7 +60,7 @@ def show_channels(item):
|
||||
fanart = json_url['fanart'] if 'fanart' in json_url else ''
|
||||
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=channel['channel_name'],
|
||||
title=typo(channel['channel_name'],'bold'),
|
||||
url=file_path,
|
||||
thumbnail=thumbnail,
|
||||
fanart=fanart,
|
||||
@@ -101,7 +102,7 @@ def show_menu(item):
|
||||
plot = option['plot']
|
||||
else:
|
||||
plot = item.plot
|
||||
itemlist.append(Item(channel=item.channel, title=option['title'], thumbnail=thumbnail, fanart=fanart, plot=plot, action='show_menu', url=option['link']))
|
||||
itemlist.append(Item(channel=item.channel, title=format_title(option['title']), thumbnail=thumbnail, fanart=fanart, plot=plot, action='show_menu', url=option['link']))
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
return itemlist
|
||||
|
||||
@@ -132,7 +133,7 @@ def list_all(item):
|
||||
title = media['title']
|
||||
title = set_title(title, language, quality)
|
||||
|
||||
new_item = Item(channel=item.channel, title=title, quality=quality,
|
||||
new_item = Item(channel=item.channel, title=format_title(title), quality=quality,
|
||||
language=language, plot=plot, thumbnail=poster)
|
||||
|
||||
new_item.infoLabels['year'] = media['year'] if 'year' in media else ''
|
||||
@@ -161,7 +162,7 @@ def seasons(item):
|
||||
for season in list_seasons:
|
||||
infoLabels['season'] = season['season']
|
||||
title = config.get_localized_string(60027) % season['season']
|
||||
itemlist.append(Item(channel=item.channel, title=title, url=season['link'], action='episodesxseason',
|
||||
itemlist.append(Item(channel=item.channel, title=format_title(title), url=season['link'], action='episodesxseason',
|
||||
contentSeasonNumber=season['season'], infoLabels=infoLabels))
|
||||
|
||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||
@@ -185,7 +186,7 @@ def episodesxseason(item):
|
||||
|
||||
title = config.get_localized_string(70677) + ' %s' % (episode_number)
|
||||
|
||||
itemlist.append(Item(channel=item.channel, title=title, url=episode, action='findvideos',
|
||||
itemlist.append(Item(channel=item.channel, title=format_title(title), url=episode, action='findvideos',
|
||||
contentEpisodeNumber=episode_number, infoLabels=infoLabels))
|
||||
|
||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||
@@ -201,7 +202,7 @@ def findvideos(item):
|
||||
title = ''
|
||||
title = set_title(title, language, quality)
|
||||
|
||||
itemlist.append(Item(channel=item.channel, title='%s'+title, url=url['url'], action='play', quality=quality,
|
||||
itemlist.append(Item(channel=item.channel, title=format_title('%s'+title), url=url['url'], action='play', quality=quality,
|
||||
language=language, infoLabels = item.infoLabels))
|
||||
|
||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||
@@ -307,13 +308,21 @@ def set_title(title, language, quality):
|
||||
|
||||
if not config.get_setting('unify'):
|
||||
if quality != '':
|
||||
title += ' [%s]' % quality
|
||||
title += typo(quality, '_ [] color kod')
|
||||
if language != '':
|
||||
if not isinstance(language, list):
|
||||
title += ' [%s]' % language.upper()
|
||||
title += typo(language.upper(), '_ [] color kod')
|
||||
else:
|
||||
title += ' '
|
||||
for lang in language:
|
||||
title += '[%s]' % lang.upper()
|
||||
title += typo(lang.upper(), '_ [] color kod')
|
||||
|
||||
return title.capitalize()
|
||||
return title
|
||||
|
||||
def format_title(title):
|
||||
t = scrapertools.find_single_match(title, r'\{([^\}]+)\}')
|
||||
logger.info(t)
|
||||
logger.info(title)
|
||||
if 'bold' not in t: t += ' bold'
|
||||
title = re.sub(r'(\{[^\}]+\})','',title)
|
||||
logger.info(title)
|
||||
return typo(title,t)
|
||||
Reference in New Issue
Block a user