Merge remote-tracking branch 'origin/master'

This commit is contained in:
Intel1
2018-09-19 08:17:36 -05:00
35 changed files with 2275 additions and 368 deletions

View File

@@ -516,7 +516,7 @@ def set_context_commands(item, parent_item):
from_action=item.action).tourl())))
# Añadir a Alfavoritos (Mis enlaces)
if item.channel not in ["favorites", "videolibrary", "help", ""] and parent_item.channel != "favorites":
context_commands.append(('[COLOR blue]Guardar enlace[/COLOR]', "XBMC.RunPlugin(%s?%s)" %
context_commands.append(('[COLOR blue]%s[/COLOR]' % config.get_localized_string(70557), "XBMC.RunPlugin(%s?%s)" %
(sys.argv[0], item.clone(channel="alfavorites", action="addFavourite",
from_channel=item.channel,
from_action=item.action).tourl())))
@@ -538,7 +538,7 @@ def set_context_commands(item, parent_item):
mediatype = 'tv'
else:
mediatype = item.contentType
context_commands.append(("[COLOR yellow]Buscar Similares[/COLOR]", "XBMC.Container.Update (%s?%s)" % (
context_commands.append(("[COLOR yellow]%s[/COLOR]" % config.get_localized_string(70561), "XBMC.Container.Update (%s?%s)" % (
sys.argv[0], item.clone(channel='search', action='discover_list', search_type='list', page='1',
list_type='%s/%s/similar' % (mediatype,item.infoLabels['tmdb_id'])).tourl())))
@@ -1044,6 +1044,8 @@ def torrent_client_installed(show_tuple=False):
def play_torrent(item, xlistitem, mediaurl):
logger.info()
import time
# Opciones disponibles para Reproducir torrents
torrent_options = list()
torrent_options.append(["Cliente interno (necesario libtorrent)"])
@@ -1066,28 +1068,32 @@ def play_torrent(item, xlistitem, mediaurl):
# Plugins externos
if seleccion > 1:
#### Compatibilidad con Kodi 18: evita cuelgues/cancelaciones cuando el .torrent se lanza desde pantalla convencional
if xbmc.getCondVisibility('Window.IsMedia'):
xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, xlistitem) #Preparamos el entorno para evutar error Kod1 18
time.sleep(1) #Dejamos que se ejecute
mediaurl = urllib.quote_plus(item.url)
if ("quasar" in torrent_options[seleccion][1] or "elementum" in torrent_options[seleccion][1]) and item.infoLabels['tmdb_id']: #Llamada con más parámetros para completar el título
if item.contentType == 'episode' and "elementum" not in torrent_options[seleccion][1]:
mediaurl += "&episode=%s&library=&season=%s&show=%s&tmdb=%s&type=episode" % (item.infoLabels['episode'], item.infoLabels['season'], item.infoLabels['tmdb_id'], item.infoLabels['tmdb_id'])
elif item.contentType == 'movie':
mediaurl += "&library=&tmdb=%s&type=movie" % (item.infoLabels['tmdb_id'])
xbmc.executebuiltin("PlayMedia(" + torrent_options[seleccion][1] % mediaurl + ")")
if "quasar" in torrent_options[seleccion][1] or "elementum" in torrent_options[seleccion][1]: #Seleccionamos que clientes torrent soportamos
if item.strm_path: #Sólo si es de Videoteca
import time
time_limit = time.time() + 150 #Marcamos el timepo máx. de buffering
while not is_playing() and time.time() < time_limit: #Esperamos mientra buffera
time.sleep(5) #Repetimos cada intervalo
#logger.debug(str(time_limit))
if is_playing(): #Ha terminado de bufferar o ha cancelado
from platformcode import xbmc_videolibrary
xbmc_videolibrary.mark_auto_as_watched(item) #Marcamos como visto al terminar
#logger.debug("Llamado el marcado")
#else:
#logger.debug("Video cancelado o timeout")
xbmc.executebuiltin("PlayMedia(" + torrent_options[seleccion][1] % mediaurl + ")")
#Seleccionamos que clientes torrent soportamos para el marcado de vídeos vistos
if "quasar" in torrent_options[seleccion][1] or "elementum" in torrent_options[seleccion][1]:
time_limit = time.time() + 150 #Marcamos el timepo máx. de buffering
while not is_playing() and time.time() < time_limit: #Esperamos mientra buffera
time.sleep(5) #Repetimos cada intervalo
#logger.debug(str(time_limit))
if item.strm_path and is_playing(): #Sólo si es de Videoteca
from platformcode import xbmc_videolibrary
xbmc_videolibrary.mark_auto_as_watched(item) #Marcamos como visto al terminar
#logger.debug("Llamado el marcado")
if seleccion == 1:
from platformcode import mct