Merge branch 'master' of github.com:kodiondemand/addon
This commit is contained in:
@@ -27,28 +27,17 @@ checklinks_number = config.get_setting('checklinks_number', 'seriehd')
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
menu(itemlist, 'Serie TV', 'peliculas', host + '/serie-tv-streaming', 'tvshow')
|
||||
menu(itemlist, 'Per Genere submenu', 'genre', host, 'tvshow', 'TV')
|
||||
menu(itemlist, 'Per Nazione submenu', 'nation', host + '/serie-tv-streaming/', 'tvshow', 'TV')
|
||||
menu(itemlist, 'Cerca...', 'search', contentType='tvshow', args='TV')
|
||||
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
config.get_setting("channel_host", __channel__)
|
||||
|
||||
return itemlist
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
tvshow = [('Genere', ['', 'genre', 'tv']),
|
||||
('Americane', ['/serie-tv-streaming/serie-tv-americane', 'peliculas', 'tv']),
|
||||
('Italiane', ['/serie-tv-streaming/serie-tv-italiane', 'peliculas', 'tv']),]
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
log(texto)
|
||||
|
||||
item.url = host + "/?s=" + texto
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
|
||||
@@ -65,14 +54,11 @@ def newest(categoria):
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
|
||||
## cambiar los valores "peliculas, infantiles, series, anime, documentales por los que correspondan aqui en
|
||||
# el py y en l json ###
|
||||
if categoria == "series":
|
||||
item.url = host
|
||||
itemlist = peliculas(item)
|
||||
|
||||
if 'Successivo>>' in itemlist[-1].title:
|
||||
if config.get_localized_string(30992) in itemlist[-1].title:
|
||||
itemlist.pop()
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
@@ -85,31 +71,25 @@ def newest(categoria):
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genre(item):
|
||||
itemlist = support.scrape(item, '<a href="([^"]+)">([^<]+)</a>', ['url', 'title'], headers,['Serie TV','Serie TV Americane','Serie TV Italiane','altadefinizione'], action='peliculas')
|
||||
return thumb(itemlist)
|
||||
|
||||
|
||||
def nation(item):
|
||||
log()
|
||||
itemlist = []
|
||||
menu(itemlist, 'Serie TV Americane', 'peliculas', host + '/serie-tv-streaming/serie-tv-americane/')
|
||||
menu(itemlist, 'Serie TV Italiane', 'peliculas', host + '/serie-tv-streaming/serie-tv-italiane/')
|
||||
return itemlist
|
||||
|
||||
patronMenu = '<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>'
|
||||
blacklist = ['Serie TV','Serie TV Americane','Serie TV Italiane','altadefinizione']
|
||||
patronBlock = '<ul class="sub-menu">(.*?)</ul>'
|
||||
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
item.contentType = 'tvshow'
|
||||
return support.scrape(item,r'<h2>(.*?)</h2>\s*<img src="([^"]+)" alt="[^"]*" />\s*<A HREF="([^"]+)">.*?<span class="year">([0-9]{4}).*?<span class="calidad">([A-Z]+)',['title', 'thumb', 'url', 'year', 'quality'], headers, patronNext=r"<span class='current'>\d+</span><a rel='nofollow' class='page larger' href='([^']+)'>\d+</a>", action='episodios')
|
||||
|
||||
patron = r'<h2>(?P<title>.*?)</h2>\s*<img src="(?P<thumb>[^"]+)" alt="[^"]*" />\s*<A HREF="(?P<url>[^"]+)">.*?<span class="year">(?P<year>[0-9]{4}).*?<span class="calidad">(?P<quality>[A-Z]+)'
|
||||
patronNext=r'<span class="current">\d+</span><a rel="nofollow" class="page larger" href="([^"]+)">\d+</a>'
|
||||
action='episodios'
|
||||
return locals()
|
||||
|
||||
def episodios(item):
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
patron = r'<iframe width=".+?" height=".+?" src="([^"]+)" allowfullscreen frameborder="0">'
|
||||
url = scrapertoolsV2.find_single_match(data, patron).replace("?seriehd", "")
|
||||
itemlist = []
|
||||
url = support.match(item, patronBlock=r'<iframe width=".+?" height=".+?" src="([^"]+)" allowfullscreen frameborder="0">')[1]
|
||||
seasons = support.match(item, r'<a href="([^"]+)">(\d+)<', r'<h3>STAGIONE</h3><ul>(.*?)</ul>', headers, url)[0]
|
||||
for season_url, season in seasons:
|
||||
season_url = urlparse.urljoin(url, season_url)
|
||||
@@ -124,7 +104,7 @@ def episodios(item):
|
||||
contentType="episode",
|
||||
title=support.typo(title + ' - ' +item.show,'bold'),
|
||||
url=episode_url,
|
||||
fulltitle=title + ' - ' + item.show,
|
||||
fulltitle=item.fulltitle,
|
||||
show=item.show,
|
||||
thumbnail=item.thumbnail))
|
||||
|
||||
@@ -135,16 +115,9 @@ def episodios(item):
|
||||
|
||||
def findvideos(item):
|
||||
log()
|
||||
|
||||
itemlist = []
|
||||
itemlist = support.hdpass_get_servers(item)
|
||||
|
||||
if checklinks:
|
||||
itemlist = servertools.check_list_links(itemlist, checklinks_number)
|
||||
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
return itemlist
|
||||
itemlist = support.hdpass_get_servers(item)
|
||||
return support.controls(itemlist, item)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ def mainlist(item):
|
||||
('Aggiornamenti', ['', 'peliculas', 'last', 'tvshow']),
|
||||
('Popolari', ['', 'peliculas', 'most_view', 'tvshow'])]
|
||||
tvshow = '/lista-serie-tv/'
|
||||
anime = '/lista-anime-2/'
|
||||
animeSub =[('Sub-Ita',['/lista-anime-sub-ita/']),
|
||||
('Film Animati',['/lista-film-animazione/','peliculas', 'movie'])]
|
||||
anime =['/lista-anime-2/',
|
||||
('Sub-Ita',['/lista-anime-sub-ita/']),
|
||||
('Film Animati',['/lista-film-animazione/','peliculas', 'movie'])]
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
@@ -333,10 +333,10 @@ def auto_filter(auto_lang=False):
|
||||
return lang
|
||||
|
||||
|
||||
def thumb(itemlist=[]):
|
||||
def thumb(itemlist=[], genre=False):
|
||||
if itemlist:
|
||||
import re
|
||||
|
||||
|
||||
icon_dict = {'channels_movie':['film'],
|
||||
'channels_tvshow':['serie','tv','episodi','episodio'],
|
||||
'channels_documentary':['documentari','documentario'],
|
||||
@@ -344,9 +344,9 @@ def thumb(itemlist=[]):
|
||||
'news':['novità', "novita'", 'aggiornamenti'],
|
||||
'now_playing':['cinema', 'in sala'],
|
||||
'channels_anime':['anime'],
|
||||
'genres':['genere', 'generi', 'categorie', 'categoria'],
|
||||
'channels_animation': ['animazione', 'cartoni', 'cartoon'],
|
||||
'genres':['genere', 'generi', 'categorie', 'categoria'],
|
||||
'channels_action':['azione', 'arti marziali'],
|
||||
'channels_animation': ['animazione', 'cartoni', 'cartoon'],
|
||||
'channels_adventure': ['avventura'],
|
||||
'channels_biographical':['biografico'],
|
||||
'channels_comedy':['comico','commedia', 'demenziale'],
|
||||
@@ -377,40 +377,44 @@ def thumb(itemlist=[]):
|
||||
suffix_dict = {'_hd':['hd','altadefinizione','alta definizione'],
|
||||
'_4k':['4K'],
|
||||
'_az':['lettera','lista','alfabetico','a-z'],
|
||||
'_year':['anno'],
|
||||
'_year':['anno', 'anni'],
|
||||
'_genre':['genere', 'generi', 'categorie', 'categoria']}
|
||||
|
||||
search = ['cerca']
|
||||
|
||||
search_suffix ={'_movie':['film'],
|
||||
'_tvshow':['serie','tv']}
|
||||
|
||||
for item in itemlist:
|
||||
|
||||
# Check if item has args propriety
|
||||
if item.args: item.title = item.title + ' || ' + str(item.args)
|
||||
if genre == False:
|
||||
|
||||
for thumb, titles in icon_dict.items():
|
||||
if any( word in item.title.lower() for word in search):
|
||||
thumb = 'search'
|
||||
for suffix, titles in search_suffix.items():
|
||||
if any( word in item.title.lower() for word in titles ):
|
||||
thumb = thumb + suffix
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
elif any( word in item.title.lower() for word in titles ):
|
||||
if thumb == 'channels_movie' or thumb == 'channels_tvshow':
|
||||
for suffix, titles in suffix_dict.items():
|
||||
if any( word in item.title.lower() for word in titles ):
|
||||
for thumb, titles in icon_dict.items():
|
||||
if any( word in item.title.lower() for word in search):
|
||||
thumb = 'search'
|
||||
for suffix, titles in search_suffix.items():
|
||||
if any( word in item.title.lower() for word in titles ):
|
||||
thumb = thumb + suffix
|
||||
else:
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
else:
|
||||
thumb = item.thumbnails
|
||||
elif any( word in item.title.lower() for word in titles ):
|
||||
if thumb == 'channels_movie' or thumb == 'channels_tvshow':
|
||||
for suffix, titles in suffix_dict.items():
|
||||
if any( word in item.title.lower() for word in titles ):
|
||||
thumb = thumb + suffix
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
else: item.thumbnail = get_thumb(thumb + '.png')
|
||||
else:
|
||||
thumb = item.thumbnails
|
||||
|
||||
if item.thumbnail != '':
|
||||
break
|
||||
else:
|
||||
for thumb, titles in icon_dict.items():
|
||||
if any(word in item.title.lower() for word in titles ):
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
else:
|
||||
thumb = item.thumbnails
|
||||
|
||||
# Remove args from title
|
||||
if item.args: item.title = item.title.replace(' || ' + str(item.args), '')
|
||||
|
||||
item.title = re.sub(r'\s*\{[^\}]+\}','',item.title)
|
||||
return itemlist
|
||||
else:
|
||||
return get_thumb('next.png')
|
||||
|
||||
@@ -306,17 +306,18 @@ def scrape(func):
|
||||
it = Item(
|
||||
channel=item.channel,
|
||||
action=action,
|
||||
contentType= 'episode' if item.action == 'episodios' else item.contentType,
|
||||
contentType= 'episode' if (action == 'findvideos' and item.contentType == 'tvshow') else item.contentType,
|
||||
title=longtitle,
|
||||
fulltitle=title,
|
||||
show=item.show if item.action == 'episodios' else title,
|
||||
fulltitle=item.fulltitle if (action == 'findvideos' and item.contentType != 'movie') else title,
|
||||
show=item.show if (action == 'findvideos' and item.contentType != 'movie') else title,
|
||||
quality=scraped["quality"],
|
||||
url=scraped["url"],
|
||||
infoLabels=infolabels,
|
||||
thumbnail=scraped["thumb"],
|
||||
args=item.args
|
||||
args=item.args,
|
||||
contentSerieName = title if (action == 'episodios' and item.contentType != 'movie') else ''
|
||||
)
|
||||
|
||||
|
||||
for lg in list(set(listGroups).difference(known_keys)):
|
||||
it.__setattr__(lg, match[listGroups.index(lg)])
|
||||
|
||||
@@ -325,13 +326,13 @@ def scrape(func):
|
||||
itemlist.append(it)
|
||||
checkHost(item, itemlist)
|
||||
|
||||
if ('patronMenu' not in args and item.contentType == "tvshow" and (action == "findvideos" and action != "play")) \
|
||||
if (item.contentType == "tvshow" and (action != "findvideos" and action != "play")) \
|
||||
or (item.contentType == "episode" and action != "play") \
|
||||
or (item.contentType == "movie" and action != "play") :
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
else:
|
||||
for it in itemlist:
|
||||
it.infoLabels = item.infoLabels
|
||||
# else: # Si perde item show :(
|
||||
# for it in itemlist:
|
||||
# it.infoLabels = item.infoLabels
|
||||
|
||||
if 'itemlistHook' in args:
|
||||
itemlist = args['itemlistHook'](itemlist)
|
||||
@@ -361,7 +362,7 @@ def scrape(func):
|
||||
videolibrary(itemlist, item)
|
||||
|
||||
if 'patronMenu' in args:
|
||||
itemlist = thumb(itemlist)
|
||||
itemlist = thumb(itemlist, genre=True)
|
||||
|
||||
if 'fullItemlistHook' in args:
|
||||
itemlist = args['fullItemlistHook'](itemlist)
|
||||
@@ -531,7 +532,6 @@ def menuItem(itemlist, filename, title='', action='', url='', contentType='movie
|
||||
# Apply auto Thumbnails at the menus
|
||||
from channelselector import thumb
|
||||
thumb(itemlist)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -588,7 +588,7 @@ def menu(func):
|
||||
if dictUrl[name] is not None and type(dictUrl[name]) is not str:
|
||||
for sub, var in dictUrl[name]:
|
||||
menuItem(itemlist, filename,
|
||||
title = sub + ' submenu',
|
||||
title = sub + ' submenu' + typo(title,'_ {}'),
|
||||
url = host + var[0] if len(var) > 0 else '',
|
||||
action = var[1] if len(var) > 1 else 'peliculas',
|
||||
args=var[2] if len(dictUrl[name]) > 2 else '',
|
||||
|
||||
@@ -340,7 +340,7 @@ def save_tvshow(item, episodelist):
|
||||
'''msg = "Insertados: %d | Sobreescritos: %d | Fallidos: %d | Tiempo: %2.2f segundos" % \
|
||||
(insertados, sobreescritos, fallidos, time.time() - start_time)
|
||||
logger.debug(msg)'''
|
||||
|
||||
|
||||
return insertados, sobreescritos, fallidos, path
|
||||
|
||||
|
||||
@@ -398,8 +398,8 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
channel_alt = generictools.verify_channel(serie.channel) #Preparamos para añadir las urls de emergencia
|
||||
emergency_urls_stat = config.get_setting("emergency_urls", channel_alt) #El canal quiere urls de emergencia?
|
||||
emergency_urls_succ = False
|
||||
#channel = __import__('channels.%s' % channel_alt, fromlist=["channels.%s" % channel_alt])
|
||||
channel = __import__('specials.%s' % channel_alt, fromlist=["specials.%s" % channel_alt])
|
||||
try: channel = __import__('specials.%s' % channel_alt, fromlist=["specials.%s" % channel_alt])
|
||||
except: channel = __import__('channels.%s' % channel_alt, fromlist=["channels.%s" % channel_alt])
|
||||
if serie.torrent_caching_fail: #Si el proceso de conversión ha fallado, no se cachean
|
||||
emergency_urls_stat = 0
|
||||
del serie.torrent_caching_fail
|
||||
|
||||
@@ -56,8 +56,8 @@ def show_option(channel, itemlist, text_color=colorKOD, thumbnail=None, fanart=N
|
||||
|
||||
if thumbnail == None:
|
||||
thumbnail = get_thumb('autoplay.png')
|
||||
if fanart == None:
|
||||
fanart = get_thumb('autoplay.png')
|
||||
# if fanart == None:
|
||||
# fanart = get_thumb('autoplay.png')
|
||||
|
||||
plot_autoplay = config.get_localized_string(60399)
|
||||
itemlist.append(
|
||||
@@ -67,7 +67,7 @@ def show_option(channel, itemlist, text_color=colorKOD, thumbnail=None, fanart=N
|
||||
text_color=text_color,
|
||||
text_bold=True,
|
||||
thumbnail=thumbnail,
|
||||
fanart=fanart,
|
||||
# fanart=fanart,
|
||||
plot=plot_autoplay,
|
||||
from_channel=channel,
|
||||
folder=False
|
||||
|
||||
@@ -263,9 +263,10 @@ def menu(item):
|
||||
|
||||
def move_to_libray(item):
|
||||
download_path = filetools.join(config.get_setting("downloadpath"), item.downloadFilename)
|
||||
library_path = filetools.join(config.get_videolibrary_path(), *filetools.split(item.downloadFilename))
|
||||
library_path = filetools.join(config.get_videolibrary_path(), (config.get_setting("folder_movies") if item.contentType == 'movie' else config.get_setting("folder_tvshows")))
|
||||
library_path = filetools.join(library_path, *filetools.split(item.downloadFilename))
|
||||
final_path = download_path
|
||||
|
||||
|
||||
if config.get_setting("library_add", "downloads") == True and config.get_setting("library_move", "downloads") == True:
|
||||
if not filetools.isdir(filetools.dirname(library_path)):
|
||||
filetools.mkdir(filetools.dirname(library_path))
|
||||
@@ -293,7 +294,7 @@ def move_to_libray(item):
|
||||
tvshow = Item(channel="downloads", contentType="tvshow",
|
||||
infoLabels={"tmdb_id": item.infoLabels["tmdb_id"]})
|
||||
videolibrarytools.save_tvshow(tvshow, [library_item])
|
||||
|
||||
|
||||
|
||||
def update_json(path, params):
|
||||
item = Item().fromjson(filetools.read(path))
|
||||
@@ -804,7 +805,7 @@ def save_download_movie(item):
|
||||
|
||||
progreso.update(0, config.get_localized_string(60062))
|
||||
|
||||
item.downloadFilename = filetools.validate_path("%s [%s]" % (item.contentTitle.strip(), item.contentChannel))
|
||||
item.downloadFilename = filetools.validate_path("%s [%s] [%s]" % (item.contentTitle.strip(), item.contentChannel, item.infoLabels['IMDBNumber']))
|
||||
|
||||
write_json(item)
|
||||
|
||||
@@ -825,8 +826,8 @@ def save_download_tvshow(item):
|
||||
|
||||
item.show = item.fulltitle
|
||||
scraper.find_and_set_infoLabels(item)
|
||||
|
||||
item.downloadFilename = filetools.validate_path("%s [%s]" % (item.contentSerieName, item.contentChannel))
|
||||
logger.info('ID= ' + item.infoLabels['IMDBNumber'])
|
||||
item.downloadFilename = filetools.validate_path("%s [%s]" % (item.contentSerieName, item.infoLabels['IMDBNumber']))
|
||||
|
||||
progreso.update(0, config.get_localized_string(70186), config.get_localized_string(70187) % item.contentChannel)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user