This commit is contained in:
alfa-addon
2018-01-24 18:42:41 -05:00
parent 40ea972180
commit 97c15da679
5 changed files with 49 additions and 50 deletions

View File

@@ -79,19 +79,9 @@ def start(itemlist, item):
:return: intenta autoreproducir, en caso de fallar devuelve el itemlist que recibio en un principio
'''
logger.info()
for videoitem in itemlist:
#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
logger.debug('item inicial %s' % item)
if not config.is_xbmc():
#platformtools.dialog_notification('AutoPlay ERROR', 'Sólo disponible para XBMC/Kodi')
return itemlist
@@ -245,9 +235,10 @@ def start(itemlist, item):
platformtools.stop_video()
for autoplay_elem in autoplay_list:
play_item = Item
if not platformtools.is_playing() and not played:
videoitem = autoplay_elem['videoitem']
logger.debug('videoitem %s' % videoitem)
if videoitem.server not in max_intentos_servers:
max_intentos_servers[videoitem.server] = max_intentos
@@ -274,24 +265,23 @@ def start(itemlist, item):
else:
videoitem = resolved_item[0]
# si no directamente reproduce y marca como visto
videoitem.contentChannel='videolibrary'
import importlib
actual_server="servers."+videoitem.server
i = importlib.import_module(actual_server)
#from servers import streamango
# Si no directamente reproduce y marca como visto
# Verifica si el item viene de la videoteca
try:
testv=i.test_video_exists(videoitem.url)
logger.info(testv)
if item.contentChannel =='videolibrary':
# 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:
testv=(True,'')
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)
pass
try:
if platformtools.is_playing():
@@ -310,6 +300,9 @@ def start(itemlist, item):
if not platformtools.dialog_yesno("AutoPlay", text,
"¿Desea ignorar todos los enlaces de este servidor?"):
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:
platformtools.dialog_notification('AutoPlay No Fue Posible', 'No Hubo Coincidencias')

View File

@@ -272,7 +272,7 @@ def findvideos(item):
"http://filescdn.com/": "filescdn",
"https://www.yourupload.com/watch/": "yourupload",
"http://www.cinecalidad.to/protect/gdredirect.php?l=": "directo",
"https://openload.co/embed/": "openload"
"https://openload.co/embed/": "openload",
}
logger.info()
@@ -298,7 +298,7 @@ def findvideos(item):
server = server_id.lower()
thumbnail = item.thumbnail
if server_id == 'TVM':
server = 'thevideo.me'
server = 'thevideome'
url = server_url[server_id] + video_id + '.html'
else:
url = server_url[server_id] + video_id

View File

@@ -761,7 +761,10 @@ def play(item):
videoitem.channel = item.channel
# Marcar como visto
checkseen(item)
try:
checkseen(item)
except:
pass
return itemlist

View File

@@ -95,7 +95,7 @@ def episodios(item):
# obtener el numero total de episodios
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)
# data_info = scrapertools.find_single_match(data, '<div class="info">.+?<\/div><\/div>')
patron_info = '<img src="([^"]+)">.+?</span>(.*?)</p>.*?<h2>Reseña:</h2><p>(.*?)</p>'

View File

@@ -503,7 +503,7 @@ def is_playing():
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.debug(item.tostring('\n'))
@@ -523,7 +523,7 @@ def play_video(item, strm=False, force_direct=False):
logger.info("default_action=%s" % default_action)
# 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:
return
@@ -669,7 +669,7 @@ def handle_wait(time_to_wait, title, text):
return True
def get_dialogo_opciones(item, default_action, strm):
def get_dialogo_opciones(item, default_action, strm, autoplay):
logger.info()
# logger.debug(item.tostring('\n'))
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
# Permitir varias calidades para server "directo"
if item.video_urls:
video_urls, puedes, motivo = item.video_urls, True, ""
else:
@@ -730,22 +731,24 @@ def get_dialogo_opciones(item, default_action, strm):
# Si no puedes ver el vídeo te informa
else:
if item.server != "":
if "<br/>" in motivo:
dialog_ok("No puedes ver ese vídeo porque...", motivo.split("<br/>")[0], motivo.split("<br/>")[1],
item.url)
logger.debug('no puedes verlo :P')
if not autoplay:
if item.server != "":
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:
dialog_ok("No puedes ver ese vídeo porque...", motivo, item.url)
else:
dialog_ok("No puedes ver ese vídeo porque...", "El servidor donde está alojado no está",
"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":
# "Quitar de favoritos"
opciones.append(config.get_localized_string(30154))
if item.channel == "favorites":
# "Quitar de favoritos"
opciones.append(config.get_localized_string(30154))
if len(opciones) == 0:
error = True
if len(opciones) == 0:
error = True
return opciones, video_urls, seleccion, error