fixed
This commit is contained in:
@@ -79,19 +79,9 @@ def start(itemlist, item):
|
|||||||
:return: intenta autoreproducir, en caso de fallar devuelve el itemlist que recibio en un principio
|
:return: intenta autoreproducir, en caso de fallar devuelve el itemlist que recibio en un principio
|
||||||
'''
|
'''
|
||||||
logger.info()
|
logger.info()
|
||||||
for videoitem in itemlist:
|
logger.debug('item inicial %s' % item)
|
||||||
#Nos dice de donde viene si del addon o videolibrary
|
|
||||||
if item.contentChannel=='videolibrary':
|
|
||||||
videoitem.contentEpisodeNumber=item.contentEpisodeNumber
|
|
||||||
videoitem.contentPlot=item.contentPlot
|
|
||||||
videoitem.contentSeason=item.contentSeason
|
|
||||||
videoitem.contentSerieName=item.contentSerieName
|
|
||||||
videoitem.contentTitle=item.contentTitle
|
|
||||||
videoitem.contentType=item.contentType
|
|
||||||
videoitem.episode_id=item.episode_id
|
|
||||||
#videoitem.infoLabels=item.infoLabels
|
|
||||||
videoitem.thumbnail=item.thumbnail
|
|
||||||
#videoitem.title=item.title
|
|
||||||
if not config.is_xbmc():
|
if not config.is_xbmc():
|
||||||
#platformtools.dialog_notification('AutoPlay ERROR', 'Sólo disponible para XBMC/Kodi')
|
#platformtools.dialog_notification('AutoPlay ERROR', 'Sólo disponible para XBMC/Kodi')
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -245,9 +235,10 @@ def start(itemlist, item):
|
|||||||
platformtools.stop_video()
|
platformtools.stop_video()
|
||||||
|
|
||||||
for autoplay_elem in autoplay_list:
|
for autoplay_elem in autoplay_list:
|
||||||
|
play_item = Item
|
||||||
if not platformtools.is_playing() and not played:
|
if not platformtools.is_playing() and not played:
|
||||||
videoitem = autoplay_elem['videoitem']
|
videoitem = autoplay_elem['videoitem']
|
||||||
|
logger.debug('videoitem %s' % videoitem)
|
||||||
if videoitem.server not in max_intentos_servers:
|
if videoitem.server not in max_intentos_servers:
|
||||||
max_intentos_servers[videoitem.server] = max_intentos
|
max_intentos_servers[videoitem.server] = max_intentos
|
||||||
|
|
||||||
@@ -274,24 +265,23 @@ def start(itemlist, item):
|
|||||||
else:
|
else:
|
||||||
videoitem = resolved_item[0]
|
videoitem = resolved_item[0]
|
||||||
|
|
||||||
# si no directamente reproduce y marca como visto
|
# Si no directamente reproduce y marca como visto
|
||||||
videoitem.contentChannel='videolibrary'
|
|
||||||
import importlib
|
# Verifica si el item viene de la videoteca
|
||||||
actual_server="servers."+videoitem.server
|
|
||||||
i = importlib.import_module(actual_server)
|
|
||||||
#from servers import streamango
|
|
||||||
try:
|
try:
|
||||||
testv=i.test_video_exists(videoitem.url)
|
if item.contentChannel =='videolibrary':
|
||||||
logger.info(testv)
|
# Marca como visto
|
||||||
|
from platformcode import xbmc_videolibrary
|
||||||
|
xbmc_videolibrary.mark_auto_as_watched(item)
|
||||||
|
# Rellena el video con los datos del item principal y reproduce
|
||||||
|
play_item = item.clone(url=videoitem)
|
||||||
|
platformtools.play_video(play_item.url, autoplay=True)
|
||||||
|
else:
|
||||||
|
# Si no viene de la videoteca solo reproduce
|
||||||
|
platformtools.play_video(videoitem, autoplay=True)
|
||||||
except:
|
except:
|
||||||
testv=(True,'')
|
pass
|
||||||
logger.debug("La funcion no existe en el conector "+videoitem.server)
|
|
||||||
testvideo=list(testv)
|
|
||||||
if testvideo[0]==True:
|
|
||||||
from platformcode import xbmc_videolibrary
|
|
||||||
xbmc_videolibrary.mark_auto_as_watched(item)
|
|
||||||
#platformtools.play_video(videoitem)
|
|
||||||
launcher.run(videoitem)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if platformtools.is_playing():
|
if platformtools.is_playing():
|
||||||
@@ -310,6 +300,9 @@ def start(itemlist, item):
|
|||||||
if not platformtools.dialog_yesno("AutoPlay", text,
|
if not platformtools.dialog_yesno("AutoPlay", text,
|
||||||
"¿Desea ignorar todos los enlaces de este servidor?"):
|
"¿Desea ignorar todos los enlaces de este servidor?"):
|
||||||
max_intentos_servers[videoitem.server] = max_intentos
|
max_intentos_servers[videoitem.server] = max_intentos
|
||||||
|
logger.debug('elem: %s list %s' % (autoplay_list.index(autoplay_elem),autoplay_list[-1]))
|
||||||
|
if autoplay_elem == autoplay_list[-1]:
|
||||||
|
platformtools.dialog_notification('AutoPlay', 'No hubo enlaces funcionales')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_notification('AutoPlay No Fue Posible', 'No Hubo Coincidencias')
|
platformtools.dialog_notification('AutoPlay No Fue Posible', 'No Hubo Coincidencias')
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ def findvideos(item):
|
|||||||
"http://filescdn.com/": "filescdn",
|
"http://filescdn.com/": "filescdn",
|
||||||
"https://www.yourupload.com/watch/": "yourupload",
|
"https://www.yourupload.com/watch/": "yourupload",
|
||||||
"http://www.cinecalidad.to/protect/gdredirect.php?l=": "directo",
|
"http://www.cinecalidad.to/protect/gdredirect.php?l=": "directo",
|
||||||
"https://openload.co/embed/": "openload"
|
"https://openload.co/embed/": "openload",
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info()
|
logger.info()
|
||||||
@@ -298,7 +298,7 @@ def findvideos(item):
|
|||||||
server = server_id.lower()
|
server = server_id.lower()
|
||||||
thumbnail = item.thumbnail
|
thumbnail = item.thumbnail
|
||||||
if server_id == 'TVM':
|
if server_id == 'TVM':
|
||||||
server = 'thevideo.me'
|
server = 'thevideome'
|
||||||
url = server_url[server_id] + video_id + '.html'
|
url = server_url[server_id] + video_id + '.html'
|
||||||
else:
|
else:
|
||||||
url = server_url[server_id] + video_id
|
url = server_url[server_id] + video_id
|
||||||
|
|||||||
@@ -761,7 +761,10 @@ def play(item):
|
|||||||
videoitem.channel = item.channel
|
videoitem.channel = item.channel
|
||||||
|
|
||||||
# Marcar como visto
|
# Marcar como visto
|
||||||
checkseen(item)
|
try:
|
||||||
|
checkseen(item)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ def episodios(item):
|
|||||||
# obtener el numero total de episodios
|
# obtener el numero total de episodios
|
||||||
total_episode = 0
|
total_episode = 0
|
||||||
|
|
||||||
patron_caps = '<li><span>Capitulo ([^"]+)\:<\/span><[^"]+"(.+?)">([^"]+)<[^"]+<\/li>'
|
patron_caps = '<li><span>Capitulo (\d+).*?</span><a href="(.*?)">(.*?)</a></li>'
|
||||||
matches = scrapertools.find_multiple_matches(data, patron_caps)
|
matches = scrapertools.find_multiple_matches(data, patron_caps)
|
||||||
# data_info = scrapertools.find_single_match(data, '<div class="info">.+?<\/div><\/div>')
|
# data_info = scrapertools.find_single_match(data, '<div class="info">.+?<\/div><\/div>')
|
||||||
patron_info = '<img src="([^"]+)">.+?</span>(.*?)</p>.*?<h2>Reseña:</h2><p>(.*?)</p>'
|
patron_info = '<img src="([^"]+)">.+?</span>(.*?)</p>.*?<h2>Reseña:</h2><p>(.*?)</p>'
|
||||||
|
|||||||
@@ -503,7 +503,7 @@ def is_playing():
|
|||||||
return xbmc.Player().isPlaying()
|
return xbmc.Player().isPlaying()
|
||||||
|
|
||||||
|
|
||||||
def play_video(item, strm=False, force_direct=False):
|
def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||||
logger.info()
|
logger.info()
|
||||||
# logger.debug(item.tostring('\n'))
|
# logger.debug(item.tostring('\n'))
|
||||||
|
|
||||||
@@ -523,7 +523,7 @@ def play_video(item, strm=False, force_direct=False):
|
|||||||
logger.info("default_action=%s" % default_action)
|
logger.info("default_action=%s" % default_action)
|
||||||
|
|
||||||
# Abre el diálogo de selección para ver las opciones disponibles
|
# Abre el diálogo de selección para ver las opciones disponibles
|
||||||
opciones, video_urls, seleccion, salir = get_dialogo_opciones(item, default_action, strm)
|
opciones, video_urls, seleccion, salir = get_dialogo_opciones(item, default_action, strm, autoplay)
|
||||||
if salir:
|
if salir:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -669,7 +669,7 @@ def handle_wait(time_to_wait, title, text):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_dialogo_opciones(item, default_action, strm):
|
def get_dialogo_opciones(item, default_action, strm, autoplay):
|
||||||
logger.info()
|
logger.info()
|
||||||
# logger.debug(item.tostring('\n'))
|
# logger.debug(item.tostring('\n'))
|
||||||
from core import servertools
|
from core import servertools
|
||||||
@@ -690,6 +690,7 @@ def get_dialogo_opciones(item, default_action, strm):
|
|||||||
|
|
||||||
# Extrae las URL de los vídeos, y si no puedes verlo te dice el motivo
|
# Extrae las URL de los vídeos, y si no puedes verlo te dice el motivo
|
||||||
# Permitir varias calidades para server "directo"
|
# Permitir varias calidades para server "directo"
|
||||||
|
|
||||||
if item.video_urls:
|
if item.video_urls:
|
||||||
video_urls, puedes, motivo = item.video_urls, True, ""
|
video_urls, puedes, motivo = item.video_urls, True, ""
|
||||||
else:
|
else:
|
||||||
@@ -730,22 +731,24 @@ def get_dialogo_opciones(item, default_action, strm):
|
|||||||
|
|
||||||
# Si no puedes ver el vídeo te informa
|
# Si no puedes ver el vídeo te informa
|
||||||
else:
|
else:
|
||||||
if item.server != "":
|
logger.debug('no puedes verlo :P')
|
||||||
if "<br/>" in motivo:
|
if not autoplay:
|
||||||
dialog_ok("No puedes ver ese vídeo porque...", motivo.split("<br/>")[0], motivo.split("<br/>")[1],
|
if item.server != "":
|
||||||
item.url)
|
if "<br/>" in motivo:
|
||||||
|
dialog_ok("No puedes ver ese vídeo porque...", motivo.split("<br/>")[0], motivo.split("<br/>")[1],
|
||||||
|
item.url)
|
||||||
|
else:
|
||||||
|
dialog_ok("No puedes ver ese vídeo porque...", motivo, item.url)
|
||||||
else:
|
else:
|
||||||
dialog_ok("No puedes ver ese vídeo porque...", motivo, item.url)
|
dialog_ok("No puedes ver ese vídeo porque...", "El servidor donde está alojado no está",
|
||||||
else:
|
"soportado en alfa todavía", item.url)
|
||||||
dialog_ok("No puedes ver ese vídeo porque...", "El servidor donde está alojado no está",
|
|
||||||
"soportado en alfa todavía", item.url)
|
|
||||||
|
|
||||||
if item.channel == "favorites":
|
if item.channel == "favorites":
|
||||||
# "Quitar de favoritos"
|
# "Quitar de favoritos"
|
||||||
opciones.append(config.get_localized_string(30154))
|
opciones.append(config.get_localized_string(30154))
|
||||||
|
|
||||||
if len(opciones) == 0:
|
if len(opciones) == 0:
|
||||||
error = True
|
error = True
|
||||||
|
|
||||||
return opciones, video_urls, seleccion, error
|
return opciones, video_urls, seleccion, error
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user