update v1.5.1
This commit is contained in:
39
plugin.video.alfa/channels/pelisfox.py
Executable file → Normal file
39
plugin.video.alfa/channels/pelisfox.py
Executable file → Normal file
@@ -9,6 +9,8 @@ from core import logger
|
||||
from core import scrapertools
|
||||
from core import tmdb
|
||||
from core.item import Item
|
||||
from core import servertools
|
||||
|
||||
|
||||
tgenero = {"Drama": "https://s16.postimg.org/94sia332d/drama.png",
|
||||
u"Accción": "https://s3.postimg.org/y6o9puflv/accion.png",
|
||||
@@ -225,6 +227,7 @@ def findvideos(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
templist = []
|
||||
video_list = []
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||
patron = '<li data-quality=(.*?) data-lang=(.*?)><a href=(.*?) title=.*?'
|
||||
@@ -236,9 +239,9 @@ def findvideos(item):
|
||||
language=lang,
|
||||
url=url
|
||||
))
|
||||
|
||||
logger.debug('templist: %s'%templist)
|
||||
for videoitem in templist:
|
||||
|
||||
logger.debug('videoitem.language: %s'%videoitem.language)
|
||||
data = httptools.downloadpage(videoitem.url).data
|
||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||
id = scrapertools.find_single_match(data, 'var _SOURCE =.*?source:(.*?),')
|
||||
@@ -247,24 +250,26 @@ def findvideos(item):
|
||||
sub = sub.replace('\\', '')
|
||||
else:
|
||||
sub = ''
|
||||
new_url = 'http://iplay.one/api/embed?id=%s&token=8908d9f846&%s' % (id, sub)
|
||||
new_url = 'https://onevideo.tv/api/player?key=90503e3de26d45e455b55e9dc54f015b3d1d4150&link' \
|
||||
'=%s&srt=%s' % (id, sub)
|
||||
|
||||
data = httptools.downloadpage(new_url).data
|
||||
|
||||
patron = 'file":"(.*?)","label":"(.*?)","type":".*?"}'
|
||||
matches = matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
url = scrapertools.find_single_match (data, '<iframe src="(.*?preview)"')
|
||||
title = videoitem.contentTitle + ' (' + audio[videoitem.language] + ')'
|
||||
logger.debug('url: %s'%url)
|
||||
video_list.extend(servertools.find_video_items(data=url))
|
||||
for urls in video_list:
|
||||
if urls.language=='':
|
||||
urls.language = videoitem.language
|
||||
urls.title = item.title+'(%s) (%s)'%(urls.language, urls.server)
|
||||
logger.debug('video_list: %s'%video_list)
|
||||
#itemlist.append(item.clone(title= title, url = url, action = 'play', subtitle = sub))
|
||||
|
||||
for video_url in video_list:
|
||||
video_url.channel = item.channel
|
||||
video_url.action ='play'
|
||||
|
||||
for scrapedurl, quality in matches:
|
||||
title = videoitem.contentTitle + ' (' + quality + ') (' + audio[videoitem.language] + ')'
|
||||
url = scrapedurl.replace('\\', '')
|
||||
itemlist.append(item.clone(title=title,
|
||||
action='play',
|
||||
url=url,
|
||||
subtitle=sub,
|
||||
server='directo',
|
||||
quality=quality,
|
||||
language='lang'
|
||||
))
|
||||
|
||||
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
|
||||
itemlist.append(
|
||||
@@ -275,7 +280,7 @@ def findvideos(item):
|
||||
extra="findvideos",
|
||||
contentTitle=item.contentTitle
|
||||
))
|
||||
return itemlist
|
||||
return video_list
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
|
||||
5
plugin.video.alfa/channels/setting.py
Executable file → Normal file
5
plugin.video.alfa/channels/setting.py
Executable file → Normal file
@@ -873,8 +873,9 @@ def overwrite_tools(item):
|
||||
p_dialog = platformtools.dialog_progress_bg('alfa', heading)
|
||||
p_dialog.update(0, '')
|
||||
|
||||
import glob
|
||||
show_list = glob.glob(filetools.join(videolibrarytools.TVSHOWS_PATH, u'/*/tvshow.nfo'))
|
||||
show_list = []
|
||||
for path, folders, files in filetools.walk(videolibrarytools.TVSHOWS_PATH):
|
||||
show_list.extend([filetools.join(path, f) for f in files if f == "tvshow.nfo"])
|
||||
|
||||
if show_list:
|
||||
t = float(100) / len(show_list)
|
||||
|
||||
323
plugin.video.alfa/channels/videolibrary.py
Executable file → Normal file
323
plugin.video.alfa/channels/videolibrary.py
Executable file → Normal file
@@ -1,6 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import glob
|
||||
import os
|
||||
|
||||
from core import config
|
||||
@@ -36,53 +35,55 @@ def list_movies(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
|
||||
for f in glob.glob(filetools.join(videolibrarytools.MOVIES_PATH, u'/*/*.nfo')):
|
||||
nfo_path = f
|
||||
head_nfo, new_item = videolibrarytools.read_nfo(nfo_path)
|
||||
for raiz, subcarpetas, ficheros in filetools.walk(videolibrarytools.MOVIES_PATH):
|
||||
for f in ficheros:
|
||||
if f.endswith(".nfo"):
|
||||
nfo_path = filetools.join(raiz, f)
|
||||
head_nfo, new_item = videolibrarytools.read_nfo(nfo_path)
|
||||
|
||||
new_item.nfo = nfo_path
|
||||
new_item.path = filetools.dirname(f)
|
||||
new_item.thumbnail = new_item.contentThumbnail
|
||||
new_item.text_color = "blue"
|
||||
new_item.nfo = nfo_path
|
||||
new_item.path = raiz
|
||||
new_item.thumbnail = new_item.contentThumbnail
|
||||
new_item.text_color = "blue"
|
||||
|
||||
if not filetools.exists(filetools.join(videolibrarytools.MOVIES_PATH, new_item.strm_path)):
|
||||
# Si se ha eliminado el strm desde la bilbioteca de kodi, no mostrarlo
|
||||
continue
|
||||
if not filetools.exists(filetools.join(new_item.path, filetools.basename(new_item.strm_path))):
|
||||
# Si se ha eliminado el strm desde la bilbioteca de kodi, no mostrarlo
|
||||
continue
|
||||
|
||||
# Menu contextual: Marcar como visto/no visto
|
||||
visto = new_item.library_playcounts.get(os.path.splitext(f)[0], 0)
|
||||
new_item.infoLabels["playcount"] = visto
|
||||
if visto > 0:
|
||||
texto_visto = "Marcar película como no vista"
|
||||
contador = 0
|
||||
else:
|
||||
texto_visto = "Marcar película como vista"
|
||||
contador = 1
|
||||
# Menu contextual: Marcar como visto/no visto
|
||||
visto = new_item.library_playcounts.get(os.path.splitext(f)[0], 0)
|
||||
new_item.infoLabels["playcount"] = visto
|
||||
if visto > 0:
|
||||
texto_visto = "Marcar película como no vista"
|
||||
contador = 0
|
||||
else:
|
||||
texto_visto = "Marcar película como vista"
|
||||
contador = 1
|
||||
|
||||
# Menu contextual: Eliminar serie/canal
|
||||
num_canales = len(new_item.library_urls)
|
||||
if "downloads" in new_item.library_urls:
|
||||
num_canales -= 1
|
||||
if num_canales > 1:
|
||||
texto_eliminar = "Eliminar película/canal"
|
||||
multicanal = True
|
||||
else:
|
||||
texto_eliminar = "Eliminar esta película"
|
||||
multicanal = False
|
||||
# Menu contextual: Eliminar serie/canal
|
||||
num_canales = len(new_item.library_urls)
|
||||
if "downloads" in new_item.library_urls:
|
||||
num_canales -= 1
|
||||
if num_canales > 1:
|
||||
texto_eliminar = "Eliminar película/canal"
|
||||
multicanal = True
|
||||
else:
|
||||
texto_eliminar = "Eliminar esta película"
|
||||
multicanal = False
|
||||
|
||||
new_item.context = [{"title": texto_visto,
|
||||
"action": "mark_content_as_watched",
|
||||
"channel": "videolibrary",
|
||||
"playcount": contador},
|
||||
{"title": texto_eliminar,
|
||||
"action": "delete",
|
||||
"channel": "videolibrary",
|
||||
"multicanal": multicanal}]
|
||||
# ,{"title": "Cambiar contenido (PENDIENTE)",
|
||||
# "action": "",
|
||||
# "channel": "videolibrary"}]
|
||||
# logger.debug("new_item: " + new_item.tostring('\n'))
|
||||
itemlist.append(new_item)
|
||||
new_item.context = [{"title": texto_visto,
|
||||
"action": "mark_content_as_watched",
|
||||
"channel": "videolibrary",
|
||||
"playcount": contador},
|
||||
{"title": texto_eliminar,
|
||||
"action": "delete",
|
||||
"channel": "videolibrary",
|
||||
"multicanal": multicanal}]
|
||||
# ,{"title": "Cambiar contenido (PENDIENTE)",
|
||||
# "action": "",
|
||||
# "channel": "videolibrary"}]
|
||||
# logger.debug("new_item: " + new_item.tostring('\n'))
|
||||
itemlist.append(new_item)
|
||||
|
||||
return sorted(itemlist, key=lambda it: it.title.lower())
|
||||
|
||||
@@ -92,66 +93,68 @@ def list_tvshows(item):
|
||||
itemlist = []
|
||||
|
||||
# Obtenemos todos los tvshow.nfo de la videoteca de SERIES recursivamente
|
||||
for f in glob.glob(filetools.join(videolibrarytools.TVSHOWS_PATH, u'/*/tvshow.nfo')):
|
||||
# logger.debug("file es %s" % f)
|
||||
for raiz, subcarpetas, ficheros in filetools.walk(videolibrarytools.TVSHOWS_PATH):
|
||||
for f in ficheros:
|
||||
if f == "tvshow.nfo":
|
||||
tvshow_path = filetools.join(raiz, f)
|
||||
# logger.debug(tvshow_path)
|
||||
head_nfo, item_tvshow = videolibrarytools.read_nfo(tvshow_path)
|
||||
item_tvshow.title = item_tvshow.contentTitle
|
||||
item_tvshow.path = raiz
|
||||
item_tvshow.nfo = tvshow_path
|
||||
|
||||
head_nfo, item_tvshow = videolibrarytools.read_nfo(f)
|
||||
item_tvshow.title = item_tvshow.contentTitle
|
||||
item_tvshow.path = filetools.join(videolibrarytools.TVSHOWS_PATH, item_tvshow.path)
|
||||
item_tvshow.nfo = f
|
||||
# Menu contextual: Marcar como visto/no visto
|
||||
visto = item_tvshow.library_playcounts.get(item_tvshow.contentTitle, 0)
|
||||
item_tvshow.infoLabels["playcount"] = visto
|
||||
if visto > 0:
|
||||
texto_visto = "Marcar serie como no vista"
|
||||
contador = 0
|
||||
else:
|
||||
texto_visto = "Marcar serie como vista"
|
||||
contador = 1
|
||||
|
||||
# Menu contextual: Marcar como visto/no visto
|
||||
visto = item_tvshow.library_playcounts.get(item_tvshow.contentTitle, 0)
|
||||
item_tvshow.infoLabels["playcount"] = visto
|
||||
if visto > 0:
|
||||
texto_visto = "Marcar serie como no vista"
|
||||
contador = 0
|
||||
else:
|
||||
texto_visto = "Marcar serie como vista"
|
||||
contador = 1
|
||||
# Menu contextual: Buscar automáticamente nuevos episodios o no
|
||||
if item_tvshow.active and int(item_tvshow.active) > 0:
|
||||
texto_update = "Buscar automáticamente nuevos episodios: Desactivar"
|
||||
value = 0
|
||||
item_tvshow.text_color = "green"
|
||||
else:
|
||||
texto_update = "Buscar automáticamente nuevos episodios: Activar"
|
||||
value = 1
|
||||
item_tvshow.text_color = "0xFFDF7401"
|
||||
|
||||
# Menu contextual: Buscar automáticamente nuevos episodios o no
|
||||
if item_tvshow.active and int(item_tvshow.active) > 0:
|
||||
texto_update = "Buscar automáticamente nuevos episodios: Desactivar"
|
||||
value = 0
|
||||
item_tvshow.text_color = "green"
|
||||
else:
|
||||
texto_update = "Buscar automáticamente nuevos episodios: Activar"
|
||||
value = 1
|
||||
item_tvshow.text_color = "0xFFDF7401"
|
||||
# Menu contextual: Eliminar serie/canal
|
||||
num_canales = len(item_tvshow.library_urls)
|
||||
if "downloads" in item_tvshow.library_urls:
|
||||
num_canales -= 1
|
||||
if num_canales > 1:
|
||||
texto_eliminar = "Eliminar serie/canal"
|
||||
multicanal = True
|
||||
else:
|
||||
texto_eliminar = "Eliminar esta serie"
|
||||
multicanal = False
|
||||
|
||||
# Menu contextual: Eliminar serie/canal
|
||||
num_canales = len(item_tvshow.library_urls)
|
||||
if "downloads" in item_tvshow.library_urls:
|
||||
num_canales -= 1
|
||||
if num_canales > 1:
|
||||
texto_eliminar = "Eliminar serie/canal"
|
||||
multicanal = True
|
||||
else:
|
||||
texto_eliminar = "Eliminar esta serie"
|
||||
multicanal = False
|
||||
item_tvshow.context = [{"title": texto_visto,
|
||||
"action": "mark_content_as_watched",
|
||||
"channel": "videolibrary",
|
||||
"playcount": contador},
|
||||
{"title": texto_update,
|
||||
"action": "mark_tvshow_as_updatable",
|
||||
"channel": "videolibrary",
|
||||
"active": value},
|
||||
{"title": texto_eliminar,
|
||||
"action": "delete",
|
||||
"channel": "videolibrary",
|
||||
"multicanal": multicanal},
|
||||
{"title": "Buscar nuevos episodios ahora",
|
||||
"action": "update_tvshow",
|
||||
"channel": "videolibrary"}]
|
||||
# ,{"title": "Cambiar contenido (PENDIENTE)",
|
||||
# "action": "",
|
||||
# "channel": "videolibrary"}]
|
||||
|
||||
item_tvshow.context = [{"title": texto_visto,
|
||||
"action": "mark_content_as_watched",
|
||||
"channel": "videolibrary",
|
||||
"playcount": contador},
|
||||
{"title": texto_update,
|
||||
"action": "mark_tvshow_as_updatable",
|
||||
"channel": "videolibrary",
|
||||
"active": value},
|
||||
{"title": texto_eliminar,
|
||||
"action": "delete",
|
||||
"channel": "videolibrary",
|
||||
"multicanal": multicanal},
|
||||
{"title": "Buscar nuevos episodios ahora",
|
||||
"action": "update_tvshow",
|
||||
"channel": "videolibrary"}]
|
||||
# ,{"title": "Cambiar contenido (PENDIENTE)",
|
||||
# "action": "",
|
||||
# "channel": "videolibrary"}]
|
||||
|
||||
# logger.debug("item_tvshow:\n" + item_tvshow.tostring('\n'))
|
||||
itemlist.append(item_tvshow)
|
||||
# logger.debug("item_tvshow:\n" + item_tvshow.tostring('\n'))
|
||||
itemlist.append(item_tvshow)
|
||||
|
||||
if itemlist:
|
||||
itemlist = sorted(itemlist, key=lambda it: it.title.lower())
|
||||
@@ -168,19 +171,18 @@ def get_seasons(item):
|
||||
itemlist = []
|
||||
dict_temp = {}
|
||||
|
||||
raiz, carpetas_series, ficheros = filetools.walk(item.path).next()
|
||||
|
||||
# Menu contextual: Releer tvshow.nfo
|
||||
head_nfo, item_nfo = videolibrarytools.read_nfo(item.nfo)
|
||||
|
||||
# Miramos las temporadas que estén marcadas como vistas
|
||||
if not hasattr(item_nfo, 'library_playcounts'):
|
||||
item_nfo.library_playcounts = {}
|
||||
|
||||
if config.get_setting("no_pile_on_seasons", "videolibrary") == 2: # Siempre
|
||||
return get_episodes(item)
|
||||
|
||||
for f in glob.glob1(item.path, u'*.json'):
|
||||
season = f.split('x')[0]
|
||||
dict_temp[season] = "Temporada %s" % season
|
||||
for f in ficheros:
|
||||
if f.endswith('.json'):
|
||||
season = f.split('x')[0]
|
||||
dict_temp[season] = "Temporada %s" % season
|
||||
|
||||
if config.get_setting("no_pile_on_seasons", "videolibrary") == 1 and len(dict_temp) == 1: # Sólo si hay una temporada
|
||||
return get_episodes(item)
|
||||
@@ -231,54 +233,58 @@ def get_episodes(item):
|
||||
# logger.debug("item:\n" + item.tostring('\n'))
|
||||
itemlist = []
|
||||
|
||||
# Obtenemos los archivos de los episodios
|
||||
raiz, carpetas_series, ficheros = filetools.walk(item.path).next()
|
||||
|
||||
# Menu contextual: Releer tvshow.nfo
|
||||
head_nfo, item_nfo = videolibrarytools.read_nfo(item.nfo)
|
||||
|
||||
# Crear un item en la lista para cada strm encontrado
|
||||
for f in glob.glob1(item.path, u'*.strm'):
|
||||
season_episode = scrapertools.get_season_and_episode(f)
|
||||
if not season_episode:
|
||||
# El fichero no incluye el numero de temporada y episodio
|
||||
continue
|
||||
season, episode = season_episode.split("x")
|
||||
# Si hay q filtrar por temporada, ignoramos los capitulos de otras temporadas
|
||||
if item.filtrar_season and int(season) != int(item.contentSeason):
|
||||
continue
|
||||
for i in ficheros:
|
||||
if i.endswith('.strm'):
|
||||
season_episode = scrapertools.get_season_and_episode(i)
|
||||
if not season_episode:
|
||||
# El fichero no incluye el numero de temporada y episodio
|
||||
continue
|
||||
season, episode = season_episode.split("x")
|
||||
# Si hay q filtrar por temporada, ignoramos los capitulos de otras temporadas
|
||||
if item.filtrar_season and int(season) != int(item.contentSeason):
|
||||
continue
|
||||
|
||||
# Obtener los datos del season_episode.nfo
|
||||
nfo_path = filetools.join(item.path, f).replace('.strm', '.nfo')
|
||||
head_nfo, epi = videolibrarytools.read_nfo(nfo_path)
|
||||
# Obtener los datos del season_episode.nfo
|
||||
nfo_path = filetools.join(raiz, i).replace('.strm', '.nfo')
|
||||
head_nfo, epi = videolibrarytools.read_nfo(nfo_path)
|
||||
|
||||
# Fijar el titulo del capitulo si es posible
|
||||
if epi.contentTitle:
|
||||
title_episodie = epi.contentTitle.strip()
|
||||
else:
|
||||
title_episodie = "Temporada %s Episodio %s" % \
|
||||
(epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2))
|
||||
# Fijar el titulo del capitulo si es posible
|
||||
if epi.contentTitle:
|
||||
title_episodie = epi.contentTitle.strip()
|
||||
else:
|
||||
title_episodie = "Temporada %s Episodio %s" % \
|
||||
(epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2))
|
||||
|
||||
epi.contentTitle = "%sx%s" % (epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2))
|
||||
epi.title = "%sx%s - %s" % (epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2), title_episodie)
|
||||
epi.contentTitle = "%sx%s" % (epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2))
|
||||
epi.title = "%sx%s - %s" % (epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2), title_episodie)
|
||||
|
||||
if item_nfo.library_filter_show:
|
||||
epi.library_filter_show = item_nfo.library_filter_show
|
||||
if item_nfo.library_filter_show:
|
||||
epi.library_filter_show = item_nfo.library_filter_show
|
||||
|
||||
# Menu contextual: Marcar episodio como visto o no
|
||||
visto = item_nfo.library_playcounts.get(season_episode, 0)
|
||||
epi.infoLabels["playcount"] = visto
|
||||
if visto > 0:
|
||||
texto = "Marcar episodio como no visto"
|
||||
value = 0
|
||||
else:
|
||||
texto = "Marcar episodio como visto"
|
||||
value = 1
|
||||
epi.context = [{"title": texto,
|
||||
"action": "mark_content_as_watched",
|
||||
"channel": "videolibrary",
|
||||
"playcount": value,
|
||||
"nfo": item.nfo}]
|
||||
# Menu contextual: Marcar episodio como visto o no
|
||||
visto = item_nfo.library_playcounts.get(season_episode, 0)
|
||||
epi.infoLabels["playcount"] = visto
|
||||
if visto > 0:
|
||||
texto = "Marcar episodio como no visto"
|
||||
value = 0
|
||||
else:
|
||||
texto = "Marcar episodio como visto"
|
||||
value = 1
|
||||
epi.context = [{"title": texto,
|
||||
"action": "mark_content_as_watched",
|
||||
"channel": "videolibrary",
|
||||
"playcount": value,
|
||||
"nfo": item.nfo}]
|
||||
|
||||
# logger.debug("epi:\n" + epi.tostring('\n'))
|
||||
itemlist.append(epi)
|
||||
# logger.debug("epi:\n" + epi.tostring('\n'))
|
||||
itemlist.append(epi)
|
||||
|
||||
return sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber)))
|
||||
|
||||
@@ -530,25 +536,28 @@ def mark_season_as_watched(item):
|
||||
# logger.debug("item:\n" + item.tostring('\n'))
|
||||
|
||||
# Obtener el diccionario de episodios marcados
|
||||
tvshow_path = filetools.join(item.path, 'tvshow.nfo')
|
||||
head_nfo, it = videolibrarytools.read_nfo(tvshow_path)
|
||||
f = filetools.join(item.path, 'tvshow.nfo')
|
||||
head_nfo, it = videolibrarytools.read_nfo(f)
|
||||
if not hasattr(it, 'library_playcounts'):
|
||||
it.library_playcounts = {}
|
||||
|
||||
# Obtenemos los archivos de los episodios
|
||||
raiz, carpetas_series, ficheros = filetools.walk(item.path).next()
|
||||
|
||||
# Marcamos cada uno de los episodios encontrados de esta temporada
|
||||
episodios_marcados = 0
|
||||
for f in glob.glob1(item.path, u'*.strm'):
|
||||
# if f.endswith(".strm"):
|
||||
season_episode = scrapertools.get_season_and_episode(f)
|
||||
if not season_episode:
|
||||
# El fichero no incluye el numero de temporada y episodio
|
||||
continue
|
||||
season, episode = season_episode.split("x")
|
||||
for i in ficheros:
|
||||
if i.endswith(".strm"):
|
||||
season_episode = scrapertools.get_season_and_episode(i)
|
||||
if not season_episode:
|
||||
# El fichero no incluye el numero de temporada y episodio
|
||||
continue
|
||||
season, episode = season_episode.split("x")
|
||||
|
||||
if int(item.contentSeason) == -1 or int(season) == int(item.contentSeason):
|
||||
name_file = os.path.splitext(os.path.basename(f))[0]
|
||||
it.library_playcounts[name_file] = item.playcount
|
||||
episodios_marcados += 1
|
||||
if int(item.contentSeason) == -1 or int(season) == int(item.contentSeason):
|
||||
name_file = os.path.splitext(os.path.basename(f))[0]
|
||||
it.library_playcounts[name_file] = item.playcount
|
||||
episodios_marcados += 1
|
||||
|
||||
if episodios_marcados:
|
||||
if int(item.contentSeason) == -1:
|
||||
@@ -564,7 +573,7 @@ def mark_season_as_watched(item):
|
||||
it = check_tvshow_playcount(it, item.contentSeason)
|
||||
|
||||
# Guardamos los cambios en tvshow.nfo
|
||||
filetools.write(tvshow_path, head_nfo + it.tojson())
|
||||
filetools.write(f, head_nfo + it.tojson())
|
||||
item.infoLabels['playcount'] = item.playcount
|
||||
|
||||
if config.is_xbmc():
|
||||
|
||||
@@ -1,256 +1,263 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
|
||||
from core import channeltools
|
||||
from core import config
|
||||
from core import httptools
|
||||
from core import logger
|
||||
from core import scrapertoolsV2
|
||||
from core import servertools
|
||||
from core import tmdb
|
||||
from core.item import Item
|
||||
|
||||
HOST = 'http://www.yaske.ro'
|
||||
parameters = channeltools.get_channel_parameters('yaske')
|
||||
fanart_host = parameters['fanart']
|
||||
thumbnail_host = parameters['thumbnail']
|
||||
color1, color2, color3 = ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E']
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
item.url = HOST
|
||||
item.text_color = color2
|
||||
item.fanart = fanart_host
|
||||
thumbnail = "https://raw.githubusercontent.com/master-1970/resources/master/images/genres/4/verdes/%s.png"
|
||||
|
||||
itemlist.append(item.clone(title="Novedades", action="peliculas", text_bold=True, viewcontent='movies',
|
||||
url=HOST + "/ultimas-y-actualizadas",
|
||||
thumbnail=thumbnail % 'novedades', viewmode="movie_with_plot"))
|
||||
itemlist.append(item.clone(title="Estrenos", action="peliculas", text_bold=True,
|
||||
url=HOST + "/genre/premieres", thumbnail=thumbnail % 'estrenos'))
|
||||
itemlist.append(item.clone(title="", folder=False))
|
||||
|
||||
itemlist.append(Item(channel=item.channel, title="Filtrar por:", fanart=fanart_host, folder=False,
|
||||
text_color=color3, text_bold=True, thumbnail=thumbnail_host))
|
||||
itemlist.append(item.clone(title=" Género", action="menu_buscar_contenido", text_color=color1, text_italic=True,
|
||||
extra="genre", thumbnail=thumbnail % 'generos', viewmode="thumbnails"))
|
||||
itemlist.append(item.clone(title=" Idioma", action="menu_buscar_contenido", text_color=color1, text_italic=True,
|
||||
extra="audio", thumbnail=thumbnail % 'idiomas'))
|
||||
itemlist.append(item.clone(title=" Calidad", action="menu_buscar_contenido", text_color=color1, text_italic=True,
|
||||
extra="quality", thumbnail=thumbnail % 'calidad'))
|
||||
itemlist.append(item.clone(title=" Año", action="menu_buscar_contenido", text_color=color1, text_italic=True,
|
||||
extra="year", thumbnail=thumbnail % 'year'))
|
||||
|
||||
itemlist.append(item.clone(title="", folder=False))
|
||||
itemlist.append(item.clone(title="Buscar por título", action="search", thumbnail=thumbnail % 'buscar'))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
|
||||
try:
|
||||
# http://www.yaske.ro/search/?q=los+pitufos
|
||||
item.url = HOST + "/search/?q=" + texto.replace(' ', '+')
|
||||
item.extra = ""
|
||||
itemlist.extend(peliculas(item))
|
||||
if itemlist[-1].title == ">> Página siguiente":
|
||||
item_pag = itemlist[-1]
|
||||
itemlist = sorted(itemlist[:-1], key=lambda Item: Item.contentTitle)
|
||||
itemlist.append(item_pag)
|
||||
else:
|
||||
itemlist = sorted(itemlist, key=lambda Item: Item.contentTitle)
|
||||
|
||||
return itemlist
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
logger.info()
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == 'peliculas':
|
||||
item.url = HOST + "/ultimas-y-actualizadas"
|
||||
elif categoria == 'infantiles':
|
||||
item.url = HOST + "/search/?q=&genre%5B%5D=animation"
|
||||
else:
|
||||
return []
|
||||
|
||||
itemlist = peliculas(item)
|
||||
if itemlist[-1].title == ">> Página siguiente":
|
||||
itemlist.pop()
|
||||
|
||||
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
url_next_page = ""
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||
|
||||
patron = '<article class.*?'
|
||||
patron += '<a href="([^"]+)">.*?'
|
||||
patron += '<img src="([^"]+)".*?'
|
||||
patron += '<aside class="item-control down">(.*?)</aside>.*?'
|
||||
patron += '<small class="pull-right text-muted">([^<]+)</small>.*?'
|
||||
patron += '<h2 class.*?>([^<]+)</h2>'
|
||||
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
# Paginacion
|
||||
if item.next_page != 'b':
|
||||
if len(matches) > 30:
|
||||
url_next_page = item.url
|
||||
matches = matches[:30]
|
||||
next_page = 'b'
|
||||
else:
|
||||
matches = matches[30:]
|
||||
next_page = 'a'
|
||||
patron_next_page = 'Anteriores</a> <a href="([^"]+)" class="btn btn-default ".*?Siguiente'
|
||||
matches_next_page = re.compile(patron_next_page, re.DOTALL).findall(data)
|
||||
if len(matches_next_page) > 0:
|
||||
url_next_page = matches_next_page[0]
|
||||
|
||||
for scrapedurl, scrapedthumbnail, idiomas, year, scrapedtitle in matches:
|
||||
patronidiomas = "<img src='([^']+)'"
|
||||
matchesidiomas = re.compile(patronidiomas, re.DOTALL).findall(idiomas)
|
||||
|
||||
idiomas_disponibles = []
|
||||
for idioma in matchesidiomas:
|
||||
if idioma.endswith("la_la.png"):
|
||||
idiomas_disponibles.append("LAT")
|
||||
elif idioma.endswith("en_en.png"):
|
||||
idiomas_disponibles.append("VO")
|
||||
elif idioma.endswith("en_es.png"):
|
||||
idiomas_disponibles.append("VOSE")
|
||||
elif idioma.endswith("es_es.png"):
|
||||
idiomas_disponibles.append("ESP")
|
||||
|
||||
if idiomas_disponibles:
|
||||
idiomas_disponibles = "[" + "/".join(idiomas_disponibles) + "]"
|
||||
|
||||
contentTitle = scrapertoolsV2.decodeHtmlentities(scrapedtitle.strip())
|
||||
title = "%s %s" % (contentTitle, idiomas_disponibles)
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=scrapedurl,
|
||||
thumbnail=scrapedthumbnail, contentTitle=contentTitle,
|
||||
infoLabels={"year": year}, text_color=color1))
|
||||
|
||||
# Obtenemos los datos basicos de todas las peliculas mediante multihilos
|
||||
tmdb.set_infoLabels(itemlist)
|
||||
|
||||
# Si es necesario añadir paginacion
|
||||
if url_next_page:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel, action="peliculas", title=">> Página siguiente", thumbnail=thumbnail_host,
|
||||
url=url_next_page, next_page=next_page, folder=True, text_color=color3, text_bold=True))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def menu_buscar_contenido(item):
|
||||
logger.info(item)
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
patron = '<select name="' + item.extra + '(.*?)</select>'
|
||||
data = scrapertoolsV2.get_match(data, patron)
|
||||
|
||||
# Extrae las entradas
|
||||
patron = "<option value='([^']+)'>([^<]+)</option>"
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
itemlist = []
|
||||
for scrapedvalue, scrapedtitle in matches:
|
||||
thumbnail = ""
|
||||
|
||||
if item.extra == 'genre':
|
||||
if scrapedtitle.strip() in ['Documental', 'Short', 'News']:
|
||||
continue
|
||||
|
||||
url = HOST + "/search/?q=&genre%5B%5D=" + scrapedvalue
|
||||
filename = scrapedtitle.lower().replace(' ', '%20')
|
||||
if filename == "ciencia%20ficción":
|
||||
filename = "ciencia%20ficcion"
|
||||
thumbnail = "https://raw.githubusercontent.com/master-1970/resources/master/images/genres/4/verdes/%s.png" \
|
||||
% filename
|
||||
|
||||
elif item.extra == 'year':
|
||||
url = HOST + "/search/?q=&year=" + scrapedvalue
|
||||
thumbnail = item.thumbnail
|
||||
else:
|
||||
# http://www.yaske.ro/search/?q=&quality%5B%5D=c9
|
||||
# http://www.yaske.ro/search/?q=&audio%5B%5D=es
|
||||
url = HOST + "/search/?q=&" + item.extra + "%5B%5D=" + scrapedvalue
|
||||
thumbnail = item.thumbnail
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action="peliculas", title=scrapedtitle, url=url, text_color=color1,
|
||||
thumbnail=thumbnail, contentType='movie', folder=True, viewmode="movie_with_plot"))
|
||||
|
||||
if item.extra in ['genre', 'audio', 'year']:
|
||||
return sorted(itemlist, key=lambda i: i.title.lower(), reverse=item.extra == 'year')
|
||||
else:
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.info()
|
||||
itemlist = list()
|
||||
sublist = list()
|
||||
|
||||
# Descarga la página
|
||||
data = httptools.downloadpage(item.url).data
|
||||
|
||||
if not item.plot:
|
||||
item.plot = scrapertoolsV2.find_single_match(data, '>Sinopsis</dt> <dd>([^<]+)</dd>')
|
||||
item.plot = scrapertoolsV2.decodeHtmlentities(item.plot)
|
||||
|
||||
patron = '<option value="([^"]+)"[^>]+'
|
||||
patron += '>([^<]+).*?</i>([^<]+)'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
for url, idioma, calidad in matches:
|
||||
sublist.append(item.clone(action="play", url=url, folder=False, text_color=color1, quality=calidad.strip(),
|
||||
language=idioma.strip()))
|
||||
|
||||
sublist = servertools.get_servers_itemlist(sublist, lambda i: "Ver en %s %s" % (i.server, i.quality), True)
|
||||
|
||||
# Añadir servidores encontrados, agrupandolos por idioma
|
||||
for k in ["Español", "Latino", "Subtitulado", "Ingles"]:
|
||||
lista_idioma = filter(lambda i: i.language == k, sublist)
|
||||
if lista_idioma:
|
||||
itemlist.append(Item(channel=item.channel, title=k, fanart=item.fanart, folder=False,
|
||||
text_color=color2, text_bold=True, thumbnail=thumbnail_host))
|
||||
itemlist.extend(lista_idioma)
|
||||
|
||||
# Insertar items "Buscar trailer" y "Añadir a la videoteca"
|
||||
if itemlist and item.extra != "library":
|
||||
title = "%s [Buscar trailer]" % (item.contentTitle)
|
||||
itemlist.insert(0, item.clone(channel="trailertools", action="buscartrailer",
|
||||
text_color=color3, title=title, viewmode="list"))
|
||||
|
||||
if config.get_videolibrary_support():
|
||||
itemlist.append(Item(channel=item.channel, title="Añadir película a la videoteca",
|
||||
action="add_pelicula_to_library", url=item.url, text_color="green",
|
||||
contentTitle=item.contentTitle, extra="library", thumbnail=thumbnail_host))
|
||||
|
||||
return itemlist
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
import base64
|
||||
|
||||
from core import channeltools
|
||||
from core import config
|
||||
from core import httptools
|
||||
from core import logger
|
||||
from core import scrapertoolsV2
|
||||
from core import servertools
|
||||
from core import tmdb
|
||||
from core.item import Item
|
||||
|
||||
|
||||
HOST = 'http://www.yaske.ro'
|
||||
parameters = channeltools.get_channel_parameters('yaske')
|
||||
fanart_host = parameters['fanart']
|
||||
thumbnail_host = parameters['thumbnail']
|
||||
color1, color2, color3 = ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E']
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
item.url = HOST
|
||||
item.text_color = color2
|
||||
item.fanart = fanart_host
|
||||
thumbnail = "https://raw.githubusercontent.com/master-1970/resources/master/images/genres/4/verdes/%s.png"
|
||||
|
||||
itemlist.append(item.clone(title="Novedades", action="peliculas", text_bold=True, viewcontent='movies',
|
||||
url=HOST + "/ultimas-y-actualizadas",
|
||||
thumbnail=thumbnail % 'novedades', viewmode="movie_with_plot"))
|
||||
itemlist.append(item.clone(title="Estrenos", action="peliculas", text_bold=True,
|
||||
url=HOST + "/genre/premieres", thumbnail=thumbnail % 'estrenos'))
|
||||
itemlist.append(item.clone(title="", folder=False))
|
||||
|
||||
itemlist.append(Item(channel=item.channel, title="Filtrar por:", fanart=fanart_host, folder=False,
|
||||
text_color=color3, text_bold=True, thumbnail=thumbnail_host))
|
||||
itemlist.append(item.clone(title=" Género", action="menu_buscar_contenido", text_color=color1, text_italic=True,
|
||||
extra="genre", thumbnail=thumbnail % 'generos', viewmode="thumbnails"))
|
||||
itemlist.append(item.clone(title=" Idioma", action="menu_buscar_contenido", text_color=color1, text_italic=True,
|
||||
extra="audio", thumbnail=thumbnail % 'idiomas'))
|
||||
itemlist.append(item.clone(title=" Calidad", action="menu_buscar_contenido", text_color=color1, text_italic=True,
|
||||
extra="quality", thumbnail=thumbnail % 'calidad'))
|
||||
itemlist.append(item.clone(title=" Año", action="menu_buscar_contenido", text_color=color1, text_italic=True,
|
||||
extra="year", thumbnail=thumbnail % 'year'))
|
||||
|
||||
itemlist.append(item.clone(title="", folder=False))
|
||||
itemlist.append(item.clone(title="Buscar por título", action="search", thumbnail=thumbnail % 'buscar'))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
|
||||
try:
|
||||
# http://www.yaske.ro/search/?q=los+pitufos
|
||||
item.url = HOST + "/search/?q=" + texto.replace(' ', '+')
|
||||
item.extra = ""
|
||||
itemlist.extend(peliculas(item))
|
||||
if itemlist[-1].title == ">> Página siguiente":
|
||||
item_pag = itemlist[-1]
|
||||
itemlist = sorted(itemlist[:-1], key=lambda Item: Item.contentTitle)
|
||||
itemlist.append(item_pag)
|
||||
else:
|
||||
itemlist = sorted(itemlist, key=lambda Item: Item.contentTitle)
|
||||
|
||||
return itemlist
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
logger.info()
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == 'peliculas':
|
||||
item.url = HOST + "/ultimas-y-actualizadas"
|
||||
elif categoria == 'infantiles':
|
||||
item.url = HOST + "/search/?q=&genre%5B%5D=animation"
|
||||
else:
|
||||
return []
|
||||
|
||||
itemlist = peliculas(item)
|
||||
if itemlist[-1].title == ">> Página siguiente":
|
||||
itemlist.pop()
|
||||
|
||||
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
url_next_page = ""
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||
|
||||
patron = '<article class.*?'
|
||||
patron += '<a href="([^"]+)">.*?'
|
||||
patron += '<img src="([^"]+)".*?'
|
||||
patron += '<aside class="item-control down">(.*?)</aside>.*?'
|
||||
patron += '<small class="pull-right text-muted">([^<]+)</small>.*?'
|
||||
patron += '<h2 class.*?>([^<]+)</h2>'
|
||||
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
# Paginacion
|
||||
if item.next_page != 'b':
|
||||
if len(matches) > 30:
|
||||
url_next_page = item.url
|
||||
matches = matches[:30]
|
||||
next_page = 'b'
|
||||
else:
|
||||
matches = matches[30:]
|
||||
next_page = 'a'
|
||||
patron_next_page = 'Anteriores</a> <a href="([^"]+)" class="btn btn-default ".*?Siguiente'
|
||||
matches_next_page = re.compile(patron_next_page, re.DOTALL).findall(data)
|
||||
if len(matches_next_page) > 0:
|
||||
url_next_page = matches_next_page[0]
|
||||
|
||||
for scrapedurl, scrapedthumbnail, idiomas, year, scrapedtitle in matches:
|
||||
patronidiomas = "<img src='([^']+)'"
|
||||
matchesidiomas = re.compile(patronidiomas, re.DOTALL).findall(idiomas)
|
||||
|
||||
idiomas_disponibles = []
|
||||
for idioma in matchesidiomas:
|
||||
if idioma.endswith("la_la.png"):
|
||||
idiomas_disponibles.append("LAT")
|
||||
elif idioma.endswith("en_en.png"):
|
||||
idiomas_disponibles.append("VO")
|
||||
elif idioma.endswith("en_es.png"):
|
||||
idiomas_disponibles.append("VOSE")
|
||||
elif idioma.endswith("es_es.png"):
|
||||
idiomas_disponibles.append("ESP")
|
||||
|
||||
if idiomas_disponibles:
|
||||
idiomas_disponibles = "[" + "/".join(idiomas_disponibles) + "]"
|
||||
|
||||
contentTitle = scrapertoolsV2.decodeHtmlentities(scrapedtitle.strip())
|
||||
title = "%s %s" % (contentTitle, idiomas_disponibles)
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=scrapedurl,
|
||||
thumbnail=scrapedthumbnail, contentTitle=contentTitle,
|
||||
infoLabels={"year": year}, text_color=color1))
|
||||
|
||||
# Obtenemos los datos basicos de todas las peliculas mediante multihilos
|
||||
tmdb.set_infoLabels(itemlist)
|
||||
|
||||
# Si es necesario añadir paginacion
|
||||
if url_next_page:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel, action="peliculas", title=">> Página siguiente", thumbnail=thumbnail_host,
|
||||
url=url_next_page, next_page=next_page, folder=True, text_color=color3, text_bold=True))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def menu_buscar_contenido(item):
|
||||
logger.info(item)
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
patron = '<select name="' + item.extra + '(.*?)</select>'
|
||||
data = scrapertoolsV2.get_match(data, patron)
|
||||
|
||||
# Extrae las entradas
|
||||
patron = "<option value='([^']+)'>([^<]+)</option>"
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
itemlist = []
|
||||
for scrapedvalue, scrapedtitle in matches:
|
||||
thumbnail = ""
|
||||
|
||||
if item.extra == 'genre':
|
||||
if scrapedtitle.strip() in ['Documental', 'Short', 'News']:
|
||||
continue
|
||||
|
||||
url = HOST + "/search/?q=&genre%5B%5D=" + scrapedvalue
|
||||
filename = scrapedtitle.lower().replace(' ', '%20')
|
||||
if filename == "ciencia%20ficción":
|
||||
filename = "ciencia%20ficcion"
|
||||
thumbnail = "https://raw.githubusercontent.com/master-1970/resources/master/images/genres/4/verdes/%s.png" \
|
||||
% filename
|
||||
|
||||
elif item.extra == 'year':
|
||||
url = HOST + "/search/?q=&year=" + scrapedvalue
|
||||
thumbnail = item.thumbnail
|
||||
else:
|
||||
# http://www.yaske.ro/search/?q=&quality%5B%5D=c9
|
||||
# http://www.yaske.ro/search/?q=&audio%5B%5D=es
|
||||
url = HOST + "/search/?q=&" + item.extra + "%5B%5D=" + scrapedvalue
|
||||
thumbnail = item.thumbnail
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action="peliculas", title=scrapedtitle, url=url, text_color=color1,
|
||||
thumbnail=thumbnail, contentType='movie', folder=True, viewmode="movie_with_plot"))
|
||||
|
||||
if item.extra in ['genre', 'audio', 'year']:
|
||||
return sorted(itemlist, key=lambda i: i.title.lower(), reverse=item.extra == 'year')
|
||||
else:
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.info()
|
||||
itemlist = list()
|
||||
sublist = list()
|
||||
|
||||
# Descarga la página
|
||||
data = httptools.downloadpage(item.url).data
|
||||
|
||||
if not item.plot:
|
||||
item.plot = scrapertoolsV2.find_single_match(data, '>Sinopsis</dt> <dd>([^<]+)</dd>')
|
||||
item.plot = scrapertoolsV2.decodeHtmlentities(item.plot)
|
||||
|
||||
patron = '<option value="([^"]+)"[^>]+'
|
||||
patron += '>([^<]+).*?</i>([^<]+)'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
for url, idioma, calidad in matches:
|
||||
if 'yaske' in url:
|
||||
data = httptools.downloadpage(url).data
|
||||
url_enc = scrapertoolsV2.find_single_match(data, "eval.*?'(.*?)'")
|
||||
url_dec = base64.b64decode(url_enc)
|
||||
url = scrapertoolsV2.find_single_match(url_dec, 'iframe src="(.*?)"')
|
||||
sublist.append(item.clone(action="play", url=url, folder=False, text_color=color1, quality=calidad.strip(),
|
||||
language=idioma.strip()))
|
||||
|
||||
sublist = servertools.get_servers_itemlist(sublist, lambda i: "Ver en %s %s" % (i.server, i.quality), True)
|
||||
|
||||
# Añadir servidores encontrados, agrupandolos por idioma
|
||||
for k in ["Español", "Latino", "Subtitulado", "Ingles"]:
|
||||
lista_idioma = filter(lambda i: i.language == k, sublist)
|
||||
if lista_idioma:
|
||||
itemlist.append(Item(channel=item.channel, title=k, fanart=item.fanart, folder=False,
|
||||
text_color=color2, text_bold=True, thumbnail=thumbnail_host))
|
||||
itemlist.extend(lista_idioma)
|
||||
|
||||
# Insertar items "Buscar trailer" y "Añadir a la videoteca"
|
||||
if itemlist and item.extra != "library":
|
||||
title = "%s [Buscar trailer]" % (item.contentTitle)
|
||||
itemlist.insert(0, item.clone(channel="trailertools", action="buscartrailer",
|
||||
text_color=color3, title=title, viewmode="list"))
|
||||
|
||||
if config.get_videolibrary_support():
|
||||
itemlist.append(Item(channel=item.channel, title="Añadir película a la videoteca",
|
||||
action="add_pelicula_to_library", url=item.url, text_color="green",
|
||||
contentTitle=item.contentTitle, extra="library", thumbnail=thumbnail_host))
|
||||
|
||||
return itemlist
|
||||
|
||||
4
plugin.video.alfa/channelselector.py
Executable file → Normal file
4
plugin.video.alfa/channelselector.py
Executable file → Normal file
@@ -62,11 +62,11 @@ def getchanneltypes():
|
||||
logger.info()
|
||||
|
||||
# Lista de categorias
|
||||
channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "torrent", "latino"]
|
||||
channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "direct", "torrent", "latino"]
|
||||
dict_types_lang = {'movie': config.get_localized_string(30122), 'tvshow': config.get_localized_string(30123),
|
||||
'anime': config.get_localized_string(30124), 'documentary': config.get_localized_string(30125),
|
||||
'vos': config.get_localized_string(30136), 'adult': config.get_localized_string(30126),
|
||||
'latino': config.get_localized_string(30127)}
|
||||
'latino': config.get_localized_string(30127), 'direct': config.get_localized_string(30137)}
|
||||
|
||||
if config.get_setting("adult_mode") != 0:
|
||||
channel_types.append("adult")
|
||||
|
||||
@@ -127,14 +127,13 @@ def save_movie(item):
|
||||
|
||||
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").lower().encode("utf8")
|
||||
|
||||
subcarpetas = os.listdir(MOVIES_PATH)
|
||||
|
||||
for c in subcarpetas:
|
||||
code = scrapertools.find_single_match(c, '\[(.*?)\]')
|
||||
if code and code in item.infoLabels['code']:
|
||||
path = filetools.join(MOVIES_PATH, c)
|
||||
_id = code
|
||||
break
|
||||
for raiz, subcarpetas, ficheros in filetools.walk(MOVIES_PATH):
|
||||
for c in subcarpetas:
|
||||
code = scrapertools.find_single_match(c, '\[(.*?)\]')
|
||||
if code and code in item.infoLabels['code']:
|
||||
path = filetools.join(raiz, c)
|
||||
_id = code
|
||||
break
|
||||
|
||||
if not path:
|
||||
# Crear carpeta
|
||||
@@ -248,14 +247,13 @@ def save_tvshow(item, episodelist):
|
||||
|
||||
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").lower().encode("utf8")
|
||||
|
||||
subcarpetas = os.listdir(TVSHOWS_PATH)
|
||||
|
||||
for c in subcarpetas:
|
||||
code = scrapertools.find_single_match(c, '\[(.*?)\]')
|
||||
if code and code in item.infoLabels['code']:
|
||||
path = filetools.join(TVSHOWS_PATH, c)
|
||||
_id = code
|
||||
break
|
||||
for raiz, subcarpetas, ficheros in filetools.walk(TVSHOWS_PATH):
|
||||
for c in subcarpetas:
|
||||
code = scrapertools.find_single_match(c, '\[(.*?)\]')
|
||||
if code and code in item.infoLabels['code']:
|
||||
path = filetools.join(raiz, c)
|
||||
_id = code
|
||||
break
|
||||
|
||||
if not path:
|
||||
path = filetools.join(TVSHOWS_PATH, ("%s [%s]" % (base_name, _id)).strip())
|
||||
@@ -348,7 +346,7 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
news_in_playcounts = {}
|
||||
|
||||
# Listamos todos los ficheros de la serie, asi evitamos tener que comprobar si existe uno por uno
|
||||
ficheros = os.listdir(path)
|
||||
raiz, carpetas_series, ficheros = filetools.walk(path).next()
|
||||
ficheros = [filetools.join(path, f) for f in ficheros]
|
||||
|
||||
# Silent es para no mostrar progreso (para videolibrary_service)
|
||||
|
||||
1
plugin.video.alfa/resources/language/Catalan/strings.xml
Executable file → Normal file
1
plugin.video.alfa/resources/language/Catalan/strings.xml
Executable file → Normal file
@@ -135,6 +135,7 @@
|
||||
<string id="30124">Anime</string>
|
||||
<string id="30125">Documentals</string>
|
||||
<string id="30126">Adults</string>
|
||||
<string id="30137">Gvideo</string>
|
||||
<string id="30127">Llatí</string>
|
||||
<string id="30128">Cerca de tràilers</string>
|
||||
<string id="30129">Adult</string>
|
||||
|
||||
1
plugin.video.alfa/resources/language/English/strings.xml
Executable file → Normal file
1
plugin.video.alfa/resources/language/English/strings.xml
Executable file → Normal file
@@ -138,6 +138,7 @@
|
||||
<string id="30125">Documentaries</string>
|
||||
<string id="30136">Original version</string>
|
||||
<string id="30126">Adult</string>
|
||||
<string id="30137">Gvideo</string>
|
||||
<string id="30127">Latin</string>
|
||||
<string id="30128">Search Trailers</string>
|
||||
<string id="30129">Adult</string>
|
||||
|
||||
1
plugin.video.alfa/resources/language/Italian/strings.xml
Executable file → Normal file
1
plugin.video.alfa/resources/language/Italian/strings.xml
Executable file → Normal file
@@ -137,6 +137,7 @@
|
||||
<string id="30125">Documentari</string>
|
||||
<string id="30136">Versioni originali</string>
|
||||
<string id="30126">Adulti</string>
|
||||
<string id="30137">Gvideo</string>
|
||||
<string id="30127">Latino</string>
|
||||
<string id="30128">Cerca trailer</string>
|
||||
<string id="30129">Adulto</string>
|
||||
|
||||
1
plugin.video.alfa/resources/language/Spanish (mexico)/strings.xml
Executable file → Normal file
1
plugin.video.alfa/resources/language/Spanish (mexico)/strings.xml
Executable file → Normal file
@@ -137,6 +137,7 @@
|
||||
<string id="30125">Documentales</string>
|
||||
<string id="30126">Adultos</string>
|
||||
<string id="30136">Versión original</string>
|
||||
<string id="30137">Gvideo</string>
|
||||
<string id="30127">Latino</string>
|
||||
<string id="30128">Buscador de Trailers</string>
|
||||
<string id="30129">Adultos</string>
|
||||
|
||||
1
plugin.video.alfa/resources/language/Spanish/strings.xml
Executable file → Normal file
1
plugin.video.alfa/resources/language/Spanish/strings.xml
Executable file → Normal file
@@ -137,6 +137,7 @@
|
||||
<string id="30125">Documentales</string>
|
||||
<string id="30126">Adultos</string>
|
||||
<string id="30136">Versión original</string>
|
||||
<string id="30137">Gvideo</string>
|
||||
<string id="30127">Latino</string>
|
||||
<string id="30128">Buscador de Trailers</string>
|
||||
<string id="30129">Adultos</string>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -12,6 +12,10 @@
|
||||
{
|
||||
"pattern": "(?s)https://youtube.googleapis.com.*?docid=([^(?:&|\")]+)",
|
||||
"url": "http://docs.google.com/get_video_info?docid=\\1"
|
||||
},
|
||||
{
|
||||
"pattern": "(?s)https://drive.google.com/file/d/([^/]+)/preview",
|
||||
"url": "http://docs.google.com/get_video_info?docid=\\1"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -45,4 +49,4 @@
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -85,9 +85,10 @@ def check_for_update(overwrite=True):
|
||||
heading = 'Actualizando videoteca....'
|
||||
p_dialog = platformtools.dialog_progress_bg('alfa', heading)
|
||||
p_dialog.update(0, '')
|
||||
show_list = []
|
||||
|
||||
import glob
|
||||
show_list = glob.glob(filetools.join(videolibrarytools.TVSHOWS_PATH, u'/*/tvshow.nfo'))
|
||||
for path, folders, files in filetools.walk(library.TVSHOWS_PATH):
|
||||
show_list.extend([filetools.join(path, f) for f in files if f == "tvshow.nfo"])
|
||||
|
||||
if show_list:
|
||||
t = float(100) / len(show_list)
|
||||
|
||||
Reference in New Issue
Block a user