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