update v1.5.1
This commit is contained in:
Executable → Regular
+22
-17
@@ -9,6 +9,8 @@ from core import logger
|
|||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
|
from core import servertools
|
||||||
|
|
||||||
|
|
||||||
tgenero = {"Drama": "https://s16.postimg.org/94sia332d/drama.png",
|
tgenero = {"Drama": "https://s16.postimg.org/94sia332d/drama.png",
|
||||||
u"Accción": "https://s3.postimg.org/y6o9puflv/accion.png",
|
u"Accción": "https://s3.postimg.org/y6o9puflv/accion.png",
|
||||||
@@ -225,6 +227,7 @@ def findvideos(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
templist = []
|
templist = []
|
||||||
|
video_list = []
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||||
patron = '<li data-quality=(.*?) data-lang=(.*?)><a href=(.*?) title=.*?'
|
patron = '<li data-quality=(.*?) data-lang=(.*?)><a href=(.*?) title=.*?'
|
||||||
@@ -236,9 +239,9 @@ def findvideos(item):
|
|||||||
language=lang,
|
language=lang,
|
||||||
url=url
|
url=url
|
||||||
))
|
))
|
||||||
|
logger.debug('templist: %s'%templist)
|
||||||
for videoitem in templist:
|
for videoitem in templist:
|
||||||
|
logger.debug('videoitem.language: %s'%videoitem.language)
|
||||||
data = httptools.downloadpage(videoitem.url).data
|
data = httptools.downloadpage(videoitem.url).data
|
||||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||||
id = scrapertools.find_single_match(data, 'var _SOURCE =.*?source:(.*?),')
|
id = scrapertools.find_single_match(data, 'var _SOURCE =.*?source:(.*?),')
|
||||||
@@ -247,24 +250,26 @@ def findvideos(item):
|
|||||||
sub = sub.replace('\\', '')
|
sub = sub.replace('\\', '')
|
||||||
else:
|
else:
|
||||||
sub = ''
|
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
|
data = httptools.downloadpage(new_url).data
|
||||||
|
|
||||||
patron = 'file":"(.*?)","label":"(.*?)","type":".*?"}'
|
url = scrapertools.find_single_match (data, '<iframe src="(.*?preview)"')
|
||||||
matches = matches = re.compile(patron, re.DOTALL).findall(data)
|
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':
|
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
@@ -275,7 +280,7 @@ def findvideos(item):
|
|||||||
extra="findvideos",
|
extra="findvideos",
|
||||||
contentTitle=item.contentTitle
|
contentTitle=item.contentTitle
|
||||||
))
|
))
|
||||||
return itemlist
|
return video_list
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(categoria):
|
||||||
|
|||||||
Executable → Regular
+3
-2
@@ -873,8 +873,9 @@ def overwrite_tools(item):
|
|||||||
p_dialog = platformtools.dialog_progress_bg('alfa', heading)
|
p_dialog = platformtools.dialog_progress_bg('alfa', heading)
|
||||||
p_dialog.update(0, '')
|
p_dialog.update(0, '')
|
||||||
|
|
||||||
import glob
|
show_list = []
|
||||||
show_list = glob.glob(filetools.join(videolibrarytools.TVSHOWS_PATH, u'/*/tvshow.nfo'))
|
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:
|
if show_list:
|
||||||
t = float(100) / len(show_list)
|
t = float(100) / len(show_list)
|
||||||
|
|||||||
Executable → Regular
+166
-157
@@ -1,6 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import glob
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from core import config
|
from core import config
|
||||||
@@ -36,53 +35,55 @@ def list_movies(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
for f in glob.glob(filetools.join(videolibrarytools.MOVIES_PATH, u'/*/*.nfo')):
|
for raiz, subcarpetas, ficheros in filetools.walk(videolibrarytools.MOVIES_PATH):
|
||||||
nfo_path = f
|
for f in ficheros:
|
||||||
head_nfo, new_item = videolibrarytools.read_nfo(nfo_path)
|
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.nfo = nfo_path
|
||||||
new_item.path = filetools.dirname(f)
|
new_item.path = raiz
|
||||||
new_item.thumbnail = new_item.contentThumbnail
|
new_item.thumbnail = new_item.contentThumbnail
|
||||||
new_item.text_color = "blue"
|
new_item.text_color = "blue"
|
||||||
|
|
||||||
if not filetools.exists(filetools.join(videolibrarytools.MOVIES_PATH, new_item.strm_path)):
|
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
|
# Si se ha eliminado el strm desde la bilbioteca de kodi, no mostrarlo
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Menu contextual: Marcar como visto/no visto
|
# Menu contextual: Marcar como visto/no visto
|
||||||
visto = new_item.library_playcounts.get(os.path.splitext(f)[0], 0)
|
visto = new_item.library_playcounts.get(os.path.splitext(f)[0], 0)
|
||||||
new_item.infoLabels["playcount"] = visto
|
new_item.infoLabels["playcount"] = visto
|
||||||
if visto > 0:
|
if visto > 0:
|
||||||
texto_visto = "Marcar película como no vista"
|
texto_visto = "Marcar película como no vista"
|
||||||
contador = 0
|
contador = 0
|
||||||
else:
|
else:
|
||||||
texto_visto = "Marcar película como vista"
|
texto_visto = "Marcar película como vista"
|
||||||
contador = 1
|
contador = 1
|
||||||
|
|
||||||
# Menu contextual: Eliminar serie/canal
|
# Menu contextual: Eliminar serie/canal
|
||||||
num_canales = len(new_item.library_urls)
|
num_canales = len(new_item.library_urls)
|
||||||
if "downloads" in new_item.library_urls:
|
if "downloads" in new_item.library_urls:
|
||||||
num_canales -= 1
|
num_canales -= 1
|
||||||
if num_canales > 1:
|
if num_canales > 1:
|
||||||
texto_eliminar = "Eliminar película/canal"
|
texto_eliminar = "Eliminar película/canal"
|
||||||
multicanal = True
|
multicanal = True
|
||||||
else:
|
else:
|
||||||
texto_eliminar = "Eliminar esta película"
|
texto_eliminar = "Eliminar esta película"
|
||||||
multicanal = False
|
multicanal = False
|
||||||
|
|
||||||
new_item.context = [{"title": texto_visto,
|
new_item.context = [{"title": texto_visto,
|
||||||
"action": "mark_content_as_watched",
|
"action": "mark_content_as_watched",
|
||||||
"channel": "videolibrary",
|
"channel": "videolibrary",
|
||||||
"playcount": contador},
|
"playcount": contador},
|
||||||
{"title": texto_eliminar,
|
{"title": texto_eliminar,
|
||||||
"action": "delete",
|
"action": "delete",
|
||||||
"channel": "videolibrary",
|
"channel": "videolibrary",
|
||||||
"multicanal": multicanal}]
|
"multicanal": multicanal}]
|
||||||
# ,{"title": "Cambiar contenido (PENDIENTE)",
|
# ,{"title": "Cambiar contenido (PENDIENTE)",
|
||||||
# "action": "",
|
# "action": "",
|
||||||
# "channel": "videolibrary"}]
|
# "channel": "videolibrary"}]
|
||||||
# logger.debug("new_item: " + new_item.tostring('\n'))
|
# logger.debug("new_item: " + new_item.tostring('\n'))
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
return sorted(itemlist, key=lambda it: it.title.lower())
|
return sorted(itemlist, key=lambda it: it.title.lower())
|
||||||
|
|
||||||
@@ -92,66 +93,68 @@ def list_tvshows(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
# Obtenemos todos los tvshow.nfo de la videoteca de SERIES recursivamente
|
# Obtenemos todos los tvshow.nfo de la videoteca de SERIES recursivamente
|
||||||
for f in glob.glob(filetools.join(videolibrarytools.TVSHOWS_PATH, u'/*/tvshow.nfo')):
|
for raiz, subcarpetas, ficheros in filetools.walk(videolibrarytools.TVSHOWS_PATH):
|
||||||
# logger.debug("file es %s" % f)
|
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)
|
# Menu contextual: Marcar como visto/no visto
|
||||||
item_tvshow.title = item_tvshow.contentTitle
|
visto = item_tvshow.library_playcounts.get(item_tvshow.contentTitle, 0)
|
||||||
item_tvshow.path = filetools.join(videolibrarytools.TVSHOWS_PATH, item_tvshow.path)
|
item_tvshow.infoLabels["playcount"] = visto
|
||||||
item_tvshow.nfo = f
|
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
|
# Menu contextual: Buscar automáticamente nuevos episodios o no
|
||||||
visto = item_tvshow.library_playcounts.get(item_tvshow.contentTitle, 0)
|
if item_tvshow.active and int(item_tvshow.active) > 0:
|
||||||
item_tvshow.infoLabels["playcount"] = visto
|
texto_update = "Buscar automáticamente nuevos episodios: Desactivar"
|
||||||
if visto > 0:
|
value = 0
|
||||||
texto_visto = "Marcar serie como no vista"
|
item_tvshow.text_color = "green"
|
||||||
contador = 0
|
else:
|
||||||
else:
|
texto_update = "Buscar automáticamente nuevos episodios: Activar"
|
||||||
texto_visto = "Marcar serie como vista"
|
value = 1
|
||||||
contador = 1
|
item_tvshow.text_color = "0xFFDF7401"
|
||||||
|
|
||||||
# Menu contextual: Buscar automáticamente nuevos episodios o no
|
# Menu contextual: Eliminar serie/canal
|
||||||
if item_tvshow.active and int(item_tvshow.active) > 0:
|
num_canales = len(item_tvshow.library_urls)
|
||||||
texto_update = "Buscar automáticamente nuevos episodios: Desactivar"
|
if "downloads" in item_tvshow.library_urls:
|
||||||
value = 0
|
num_canales -= 1
|
||||||
item_tvshow.text_color = "green"
|
if num_canales > 1:
|
||||||
else:
|
texto_eliminar = "Eliminar serie/canal"
|
||||||
texto_update = "Buscar automáticamente nuevos episodios: Activar"
|
multicanal = True
|
||||||
value = 1
|
else:
|
||||||
item_tvshow.text_color = "0xFFDF7401"
|
texto_eliminar = "Eliminar esta serie"
|
||||||
|
multicanal = False
|
||||||
|
|
||||||
# Menu contextual: Eliminar serie/canal
|
item_tvshow.context = [{"title": texto_visto,
|
||||||
num_canales = len(item_tvshow.library_urls)
|
"action": "mark_content_as_watched",
|
||||||
if "downloads" in item_tvshow.library_urls:
|
"channel": "videolibrary",
|
||||||
num_canales -= 1
|
"playcount": contador},
|
||||||
if num_canales > 1:
|
{"title": texto_update,
|
||||||
texto_eliminar = "Eliminar serie/canal"
|
"action": "mark_tvshow_as_updatable",
|
||||||
multicanal = True
|
"channel": "videolibrary",
|
||||||
else:
|
"active": value},
|
||||||
texto_eliminar = "Eliminar esta serie"
|
{"title": texto_eliminar,
|
||||||
multicanal = False
|
"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,
|
# logger.debug("item_tvshow:\n" + item_tvshow.tostring('\n'))
|
||||||
"action": "mark_content_as_watched",
|
itemlist.append(item_tvshow)
|
||||||
"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)
|
|
||||||
|
|
||||||
if itemlist:
|
if itemlist:
|
||||||
itemlist = sorted(itemlist, key=lambda it: it.title.lower())
|
itemlist = sorted(itemlist, key=lambda it: it.title.lower())
|
||||||
@@ -168,19 +171,18 @@ def get_seasons(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
dict_temp = {}
|
dict_temp = {}
|
||||||
|
|
||||||
|
raiz, carpetas_series, ficheros = filetools.walk(item.path).next()
|
||||||
|
|
||||||
# Menu contextual: Releer tvshow.nfo
|
# Menu contextual: Releer tvshow.nfo
|
||||||
head_nfo, item_nfo = videolibrarytools.read_nfo(item.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
|
if config.get_setting("no_pile_on_seasons", "videolibrary") == 2: # Siempre
|
||||||
return get_episodes(item)
|
return get_episodes(item)
|
||||||
|
|
||||||
for f in glob.glob1(item.path, u'*.json'):
|
for f in ficheros:
|
||||||
season = f.split('x')[0]
|
if f.endswith('.json'):
|
||||||
dict_temp[season] = "Temporada %s" % season
|
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
|
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)
|
return get_episodes(item)
|
||||||
@@ -231,54 +233,58 @@ def get_episodes(item):
|
|||||||
# logger.debug("item:\n" + item.tostring('\n'))
|
# logger.debug("item:\n" + item.tostring('\n'))
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
|
# Obtenemos los archivos de los episodios
|
||||||
|
raiz, carpetas_series, ficheros = filetools.walk(item.path).next()
|
||||||
|
|
||||||
# Menu contextual: Releer tvshow.nfo
|
# Menu contextual: Releer tvshow.nfo
|
||||||
head_nfo, item_nfo = videolibrarytools.read_nfo(item.nfo)
|
head_nfo, item_nfo = videolibrarytools.read_nfo(item.nfo)
|
||||||
|
|
||||||
# Crear un item en la lista para cada strm encontrado
|
# Crear un item en la lista para cada strm encontrado
|
||||||
for f in glob.glob1(item.path, u'*.strm'):
|
for i in ficheros:
|
||||||
season_episode = scrapertools.get_season_and_episode(f)
|
if i.endswith('.strm'):
|
||||||
if not season_episode:
|
season_episode = scrapertools.get_season_and_episode(i)
|
||||||
# El fichero no incluye el numero de temporada y episodio
|
if not season_episode:
|
||||||
continue
|
# El fichero no incluye el numero de temporada y episodio
|
||||||
season, episode = season_episode.split("x")
|
continue
|
||||||
# Si hay q filtrar por temporada, ignoramos los capitulos de otras temporadas
|
season, episode = season_episode.split("x")
|
||||||
if item.filtrar_season and int(season) != int(item.contentSeason):
|
# Si hay q filtrar por temporada, ignoramos los capitulos de otras temporadas
|
||||||
continue
|
if item.filtrar_season and int(season) != int(item.contentSeason):
|
||||||
|
continue
|
||||||
|
|
||||||
# Obtener los datos del season_episode.nfo
|
# Obtener los datos del season_episode.nfo
|
||||||
nfo_path = filetools.join(item.path, f).replace('.strm', '.nfo')
|
nfo_path = filetools.join(raiz, i).replace('.strm', '.nfo')
|
||||||
head_nfo, epi = videolibrarytools.read_nfo(nfo_path)
|
head_nfo, epi = videolibrarytools.read_nfo(nfo_path)
|
||||||
|
|
||||||
# Fijar el titulo del capitulo si es posible
|
# Fijar el titulo del capitulo si es posible
|
||||||
if epi.contentTitle:
|
if epi.contentTitle:
|
||||||
title_episodie = epi.contentTitle.strip()
|
title_episodie = epi.contentTitle.strip()
|
||||||
else:
|
else:
|
||||||
title_episodie = "Temporada %s Episodio %s" % \
|
title_episodie = "Temporada %s Episodio %s" % \
|
||||||
(epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2))
|
(epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2))
|
||||||
|
|
||||||
epi.contentTitle = "%sx%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.title = "%sx%s - %s" % (epi.contentSeason, str(epi.contentEpisodeNumber).zfill(2), title_episodie)
|
||||||
|
|
||||||
if item_nfo.library_filter_show:
|
if item_nfo.library_filter_show:
|
||||||
epi.library_filter_show = item_nfo.library_filter_show
|
epi.library_filter_show = item_nfo.library_filter_show
|
||||||
|
|
||||||
# Menu contextual: Marcar episodio como visto o no
|
# Menu contextual: Marcar episodio como visto o no
|
||||||
visto = item_nfo.library_playcounts.get(season_episode, 0)
|
visto = item_nfo.library_playcounts.get(season_episode, 0)
|
||||||
epi.infoLabels["playcount"] = visto
|
epi.infoLabels["playcount"] = visto
|
||||||
if visto > 0:
|
if visto > 0:
|
||||||
texto = "Marcar episodio como no visto"
|
texto = "Marcar episodio como no visto"
|
||||||
value = 0
|
value = 0
|
||||||
else:
|
else:
|
||||||
texto = "Marcar episodio como visto"
|
texto = "Marcar episodio como visto"
|
||||||
value = 1
|
value = 1
|
||||||
epi.context = [{"title": texto,
|
epi.context = [{"title": texto,
|
||||||
"action": "mark_content_as_watched",
|
"action": "mark_content_as_watched",
|
||||||
"channel": "videolibrary",
|
"channel": "videolibrary",
|
||||||
"playcount": value,
|
"playcount": value,
|
||||||
"nfo": item.nfo}]
|
"nfo": item.nfo}]
|
||||||
|
|
||||||
# logger.debug("epi:\n" + epi.tostring('\n'))
|
# logger.debug("epi:\n" + epi.tostring('\n'))
|
||||||
itemlist.append(epi)
|
itemlist.append(epi)
|
||||||
|
|
||||||
return sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber)))
|
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'))
|
# logger.debug("item:\n" + item.tostring('\n'))
|
||||||
|
|
||||||
# Obtener el diccionario de episodios marcados
|
# Obtener el diccionario de episodios marcados
|
||||||
tvshow_path = filetools.join(item.path, 'tvshow.nfo')
|
f = filetools.join(item.path, 'tvshow.nfo')
|
||||||
head_nfo, it = videolibrarytools.read_nfo(tvshow_path)
|
head_nfo, it = videolibrarytools.read_nfo(f)
|
||||||
if not hasattr(it, 'library_playcounts'):
|
if not hasattr(it, 'library_playcounts'):
|
||||||
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
|
# Marcamos cada uno de los episodios encontrados de esta temporada
|
||||||
episodios_marcados = 0
|
episodios_marcados = 0
|
||||||
for f in glob.glob1(item.path, u'*.strm'):
|
for i in ficheros:
|
||||||
# if f.endswith(".strm"):
|
if i.endswith(".strm"):
|
||||||
season_episode = scrapertools.get_season_and_episode(f)
|
season_episode = scrapertools.get_season_and_episode(i)
|
||||||
if not season_episode:
|
if not season_episode:
|
||||||
# El fichero no incluye el numero de temporada y episodio
|
# El fichero no incluye el numero de temporada y episodio
|
||||||
continue
|
continue
|
||||||
season, episode = season_episode.split("x")
|
season, episode = season_episode.split("x")
|
||||||
|
|
||||||
if int(item.contentSeason) == -1 or int(season) == int(item.contentSeason):
|
if int(item.contentSeason) == -1 or int(season) == int(item.contentSeason):
|
||||||
name_file = os.path.splitext(os.path.basename(f))[0]
|
name_file = os.path.splitext(os.path.basename(f))[0]
|
||||||
it.library_playcounts[name_file] = item.playcount
|
it.library_playcounts[name_file] = item.playcount
|
||||||
episodios_marcados += 1
|
episodios_marcados += 1
|
||||||
|
|
||||||
if episodios_marcados:
|
if episodios_marcados:
|
||||||
if int(item.contentSeason) == -1:
|
if int(item.contentSeason) == -1:
|
||||||
@@ -564,7 +573,7 @@ def mark_season_as_watched(item):
|
|||||||
it = check_tvshow_playcount(it, item.contentSeason)
|
it = check_tvshow_playcount(it, item.contentSeason)
|
||||||
|
|
||||||
# Guardamos los cambios en tvshow.nfo
|
# 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
|
item.infoLabels['playcount'] = item.playcount
|
||||||
|
|
||||||
if config.is_xbmc():
|
if config.is_xbmc():
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import base64
|
||||||
|
|
||||||
from core import channeltools
|
from core import channeltools
|
||||||
from core import config
|
from core import config
|
||||||
@@ -11,6 +12,7 @@ from core import servertools
|
|||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
|
|
||||||
|
|
||||||
HOST = 'http://www.yaske.ro'
|
HOST = 'http://www.yaske.ro'
|
||||||
parameters = channeltools.get_channel_parameters('yaske')
|
parameters = channeltools.get_channel_parameters('yaske')
|
||||||
fanart_host = parameters['fanart']
|
fanart_host = parameters['fanart']
|
||||||
@@ -229,6 +231,11 @@ def findvideos(item):
|
|||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for url, idioma, calidad in matches:
|
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(),
|
sublist.append(item.clone(action="play", url=url, folder=False, text_color=color1, quality=calidad.strip(),
|
||||||
language=idioma.strip()))
|
language=idioma.strip()))
|
||||||
|
|
||||||
|
|||||||
Executable → Regular
+2
-2
@@ -62,11 +62,11 @@ def getchanneltypes():
|
|||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
# Lista de categorias
|
# 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),
|
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),
|
'anime': config.get_localized_string(30124), 'documentary': config.get_localized_string(30125),
|
||||||
'vos': config.get_localized_string(30136), 'adult': config.get_localized_string(30126),
|
'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:
|
if config.get_setting("adult_mode") != 0:
|
||||||
channel_types.append("adult")
|
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")
|
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").lower().encode("utf8")
|
||||||
|
|
||||||
subcarpetas = os.listdir(MOVIES_PATH)
|
for raiz, subcarpetas, ficheros in filetools.walk(MOVIES_PATH):
|
||||||
|
for c in subcarpetas:
|
||||||
for c in subcarpetas:
|
code = scrapertools.find_single_match(c, '\[(.*?)\]')
|
||||||
code = scrapertools.find_single_match(c, '\[(.*?)\]')
|
if code and code in item.infoLabels['code']:
|
||||||
if code and code in item.infoLabels['code']:
|
path = filetools.join(raiz, c)
|
||||||
path = filetools.join(MOVIES_PATH, c)
|
_id = code
|
||||||
_id = code
|
break
|
||||||
break
|
|
||||||
|
|
||||||
if not path:
|
if not path:
|
||||||
# Crear carpeta
|
# Crear carpeta
|
||||||
@@ -248,14 +247,13 @@ def save_tvshow(item, episodelist):
|
|||||||
|
|
||||||
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").lower().encode("utf8")
|
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").lower().encode("utf8")
|
||||||
|
|
||||||
subcarpetas = os.listdir(TVSHOWS_PATH)
|
for raiz, subcarpetas, ficheros in filetools.walk(TVSHOWS_PATH):
|
||||||
|
for c in subcarpetas:
|
||||||
for c in subcarpetas:
|
code = scrapertools.find_single_match(c, '\[(.*?)\]')
|
||||||
code = scrapertools.find_single_match(c, '\[(.*?)\]')
|
if code and code in item.infoLabels['code']:
|
||||||
if code and code in item.infoLabels['code']:
|
path = filetools.join(raiz, c)
|
||||||
path = filetools.join(TVSHOWS_PATH, c)
|
_id = code
|
||||||
_id = code
|
break
|
||||||
break
|
|
||||||
|
|
||||||
if not path:
|
if not path:
|
||||||
path = filetools.join(TVSHOWS_PATH, ("%s [%s]" % (base_name, _id)).strip())
|
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 = {}
|
news_in_playcounts = {}
|
||||||
|
|
||||||
# Listamos todos los ficheros de la serie, asi evitamos tener que comprobar si existe uno por uno
|
# 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]
|
ficheros = [filetools.join(path, f) for f in ficheros]
|
||||||
|
|
||||||
# Silent es para no mostrar progreso (para videolibrary_service)
|
# Silent es para no mostrar progreso (para videolibrary_service)
|
||||||
|
|||||||
Executable → Regular
+1
@@ -135,6 +135,7 @@
|
|||||||
<string id="30124">Anime</string>
|
<string id="30124">Anime</string>
|
||||||
<string id="30125">Documentals</string>
|
<string id="30125">Documentals</string>
|
||||||
<string id="30126">Adults</string>
|
<string id="30126">Adults</string>
|
||||||
|
<string id="30137">Gvideo</string>
|
||||||
<string id="30127">Llatí</string>
|
<string id="30127">Llatí</string>
|
||||||
<string id="30128">Cerca de tràilers</string>
|
<string id="30128">Cerca de tràilers</string>
|
||||||
<string id="30129">Adult</string>
|
<string id="30129">Adult</string>
|
||||||
|
|||||||
Executable → Regular
+1
@@ -138,6 +138,7 @@
|
|||||||
<string id="30125">Documentaries</string>
|
<string id="30125">Documentaries</string>
|
||||||
<string id="30136">Original version</string>
|
<string id="30136">Original version</string>
|
||||||
<string id="30126">Adult</string>
|
<string id="30126">Adult</string>
|
||||||
|
<string id="30137">Gvideo</string>
|
||||||
<string id="30127">Latin</string>
|
<string id="30127">Latin</string>
|
||||||
<string id="30128">Search Trailers</string>
|
<string id="30128">Search Trailers</string>
|
||||||
<string id="30129">Adult</string>
|
<string id="30129">Adult</string>
|
||||||
|
|||||||
Executable → Regular
+1
@@ -137,6 +137,7 @@
|
|||||||
<string id="30125">Documentari</string>
|
<string id="30125">Documentari</string>
|
||||||
<string id="30136">Versioni originali</string>
|
<string id="30136">Versioni originali</string>
|
||||||
<string id="30126">Adulti</string>
|
<string id="30126">Adulti</string>
|
||||||
|
<string id="30137">Gvideo</string>
|
||||||
<string id="30127">Latino</string>
|
<string id="30127">Latino</string>
|
||||||
<string id="30128">Cerca trailer</string>
|
<string id="30128">Cerca trailer</string>
|
||||||
<string id="30129">Adulto</string>
|
<string id="30129">Adulto</string>
|
||||||
|
|||||||
Executable → Regular
+1
@@ -137,6 +137,7 @@
|
|||||||
<string id="30125">Documentales</string>
|
<string id="30125">Documentales</string>
|
||||||
<string id="30126">Adultos</string>
|
<string id="30126">Adultos</string>
|
||||||
<string id="30136">Versión original</string>
|
<string id="30136">Versión original</string>
|
||||||
|
<string id="30137">Gvideo</string>
|
||||||
<string id="30127">Latino</string>
|
<string id="30127">Latino</string>
|
||||||
<string id="30128">Buscador de Trailers</string>
|
<string id="30128">Buscador de Trailers</string>
|
||||||
<string id="30129">Adultos</string>
|
<string id="30129">Adultos</string>
|
||||||
|
|||||||
Executable → Regular
+1
@@ -137,6 +137,7 @@
|
|||||||
<string id="30125">Documentales</string>
|
<string id="30125">Documentales</string>
|
||||||
<string id="30126">Adultos</string>
|
<string id="30126">Adultos</string>
|
||||||
<string id="30136">Versión original</string>
|
<string id="30136">Versión original</string>
|
||||||
|
<string id="30137">Gvideo</string>
|
||||||
<string id="30127">Latino</string>
|
<string id="30127">Latino</string>
|
||||||
<string id="30128">Buscador de Trailers</string>
|
<string id="30128">Buscador de Trailers</string>
|
||||||
<string id="30129">Adultos</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=([^(?:&|\")]+)",
|
"pattern": "(?s)https://youtube.googleapis.com.*?docid=([^(?:&|\")]+)",
|
||||||
"url": "http://docs.google.com/get_video_info?docid=\\1"
|
"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"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -85,9 +85,10 @@ def check_for_update(overwrite=True):
|
|||||||
heading = 'Actualizando videoteca....'
|
heading = 'Actualizando videoteca....'
|
||||||
p_dialog = platformtools.dialog_progress_bg('alfa', heading)
|
p_dialog = platformtools.dialog_progress_bg('alfa', heading)
|
||||||
p_dialog.update(0, '')
|
p_dialog.update(0, '')
|
||||||
|
show_list = []
|
||||||
|
|
||||||
import glob
|
for path, folders, files in filetools.walk(library.TVSHOWS_PATH):
|
||||||
show_list = glob.glob(filetools.join(videolibrarytools.TVSHOWS_PATH, u'/*/tvshow.nfo'))
|
show_list.extend([filetools.join(path, f) for f in files if f == "tvshow.nfo"])
|
||||||
|
|
||||||
if show_list:
|
if show_list:
|
||||||
t = float(100) / len(show_list)
|
t = float(100) / len(show_list)
|
||||||
|
|||||||
Reference in New Issue
Block a user