diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index f2317d20..492da4c7 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,8 +19,7 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - » userscloud » hdfull - » peliculasgratis + » pelisplusco ¤ arreglos internos Navega con Kodi por páginas web para ver sus videos de manera fácil. diff --git a/plugin.video.alfa/channels/pelisplusco.json b/plugin.video.alfa/channels/pelisplusco.json index 646d455f..418c185a 100644 --- a/plugin.video.alfa/channels/pelisplusco.json +++ b/plugin.video.alfa/channels/pelisplusco.json @@ -19,9 +19,9 @@ "id": "include_in_global_search", "type": "bool", "label": "Incluir en busqueda global", - "default": false, - "enabled": false, - "visible": false + "default": true, + "enabled": true, + "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/pelisplusco.py b/plugin.video.alfa/channels/pelisplusco.py index d32165a6..21d1ffa1 100644 --- a/plugin.video.alfa/channels/pelisplusco.py +++ b/plugin.video.alfa/channels/pelisplusco.py @@ -7,14 +7,19 @@ import re import urllib from platformcode import logger from platformcode import config +from core import jsontools from core import scrapertools from core.item import Item from core import servertools from core import httptools from core import tmdb - host = 'http://pelisplus.co' +CHANNEL_HEADERS = [ + ["Host", host.replace("http://","")], + ["X-Requested-With", "XMLHttpRequest"] + ] + def mainlist(item): logger.info() @@ -55,8 +60,53 @@ def movie_menu(item): seccion='anios' )) + itemlist.append(item.clone(title="Buscar", + action="search", + url=host + "/suggest/?query=", + type="m", + seccion='buscar' + )) + return itemlist + +def search(item, texto): + logger.info() + if not item.type: + item.type = "m" + item.url = host + "/suggest/?query=" + item.url = item.url + texto + if texto != '': + return sub_search(item) + else: + return [] + + +def sub_search(item): + logger.info() + itemlist =[] + data = httptools.downloadpage(item.url, add_referer=True).data + dict_data = jsontools.load(data) + list =dict_data["data"] [item.type] + if item.type == "m": + action = "findvideos" + else: + action = "seasons" + for dict in list: + itemlist.append(item.clone(channel = item.channel, + action = action, + fulltitle = dict["title"], + show = dict["title"], + infoLabels={"year":dict["release_year"]}, + thumbnail = "http://static.pelisfox.tv/static/movie/" + dict["cover"], + title = dict["title"] + " (" + dict["release_year"] + ")", + url = host + dict["slug"] + )) + tmdb.set_infoLabels(itemlist) + return itemlist + + + def series_menu(item): logger.info() @@ -69,6 +119,13 @@ def series_menu(item): type='serie' )) + itemlist.append(item.clone(title="Buscar", + action="search", + url=host + "/suggest/?query=", + type="s", + seccion='buscar' + )) + return itemlist @@ -82,40 +139,34 @@ def get_source(url): def list_all (item): logger.info () itemlist = [] - - if item.type not in ['normal', 'seccion', 'serie']: - post = {'page':item.page, 'type':item.type,'id':item.id} - post = urllib.urlencode(post) - data =httptools.downloadpage(item.url, post=post).data - data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) - else: - data = get_source(item.url) - if item.type == 'serie' or item.type == 'recents': + if item.type in ['serie','recents']: contentType = 'serie' action = 'seasons' else: contentType = 'pelicula' action = 'findvideos' - - patron = 'item-%s>
(.*?)<\/p>(\d{4})<\/span>'%contentType - - matches = re.compile(patron,re.DOTALL).findall(data) - + if item.type not in ['normal', 'seccion', 'serie']: + post = {'page':item.page, 'type':item.type,'slug':item.slug,'id':item.id} + post = urllib.urlencode(post) + data =httptools.downloadpage(item.url, post=post, headers=CHANNEL_HEADERS).data + data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) + patron ='
(.*?)<\/p>(\d{4})<\/span>' + else: + data = get_source(item.url) + patron = 'item-%s>
(.*?)<\/p>(\d{4})'%contentType + matches = scrapertools.find_multiple_matches(data, patron) for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear in matches: url = host+scrapedurl+'p001/' thumbnail = scrapedthumbnail - plot= '' contentTitle=scrapedtitle title = contentTitle year = scrapedyear - fanart ='' - new_item=item.clone(action=action, title=title, url=url, thumbnail=thumbnail, - plot=plot, - fanart=fanart, + plot="", + fanart="", infoLabels ={'year':year} ) if contentType =='serie': @@ -141,13 +192,15 @@ def list_all (item): else: id ='' else: + if not item.page: + item.page = "1" page = str(int(item.page)+1) id = item.id if type =='recents': - type_pagination = '/series/pagination' + type_pagination = '/series/pagination/' else: - type_pagination = '/pagination' + type_pagination = '/pagination/' url = host+type_pagination @@ -164,29 +217,35 @@ def seccion(item): logger.info() itemlist = [] data = get_source(item.url) + page = "1" if item.seccion == 'generos': patron = '
  • <\/i>(.*?)<\/span>' type = 'genre' + pat = 'genero/' elif item.seccion == 'anios': patron = '
  • (\d{4})<\/a>' type = 'year' - matches = re.compile(patron, re.DOTALL).findall(data) + pat = 'peliculas-' + matches = scrapertools.find_multiple_matches(data, patron) for scrapedurl, scrapedtitle in matches: title = scrapedtitle if item.seccion == 'generos': cant = re.sub(r'.*?','',scrapedtitle) only_title = re.sub(r'<.*','',scrapedtitle).rstrip() title = only_title+' (%s)'%cant - url = host+scrapedurl - + slug = scrapertools.find_single_match(scrapedurl, "%s(.*?)/" %pat) + if item.seccion in ['generos', 'anios']: + url = host + "/pagination/" itemlist.append( - Item(channel=item.channel, - action="list_all", - title=title, + Item(action="list_all", + channel=item.channel, fulltitle=item.title, - url=url, - type = 'seccion' + page = "1", + slug = slug, + title=title, + type = type, + url=url )) # Paginacion diff --git a/plugin.video.alfa/core/trakt_tools.py b/plugin.video.alfa/core/trakt_tools.py index c88bd958..d9adf674 100644 --- a/plugin.video.alfa/core/trakt_tools.py +++ b/plugin.video.alfa/core/trakt_tools.py @@ -4,19 +4,23 @@ # -*- By the Alfa Develop Group -* import os + import xbmc from core import httptools -from core.item import Item -from platformcode.platformtools import logger, config from core import jsontools +from core.item import Item +from platformcode import config +from platformcode import logger +from threading import Thread client_id = "c40ba210716aee87f6a9ddcafafc56246909e5377b623b72c15909024448e89d" client_secret = "999164f25832341f0214453bb11c915adb18e9490d6b5e9a707963a5a1bee43e" + def auth_trakt(): item = Item() folder = (config.get_platform() == "plex") - item.folder=folder + item.folder = folder # Autentificación de cuenta Trakt headers = {'Content-Type': 'application/json', 'trakt-api-key': client_id, 'trakt-api-version': '2'} try: @@ -48,7 +52,6 @@ def auth_trakt(): def token_trakt(item): - from platformcode import platformtools headers = {'Content-Type': 'application/json', 'trakt-api-key': client_id, 'trakt-api-version': '2'} @@ -63,8 +66,6 @@ def token_trakt(item): data = jsontools.load(data) elif item.action == "token_trakt": url = "http://api-v2launch.trakt.tv/oauth/device/token" - post = {'code': item.device_code, 'client_id': client_id, 'client_secret': client_secret} - post = jsontools.dump(post) post = "code=%s&client_id=%s&client_secret=%s" % (item.device_code, client_id, client_secret) data = httptools.downloadpage(url, post, headers, replace_headers=True).data data = jsontools.load(data) @@ -72,7 +73,8 @@ def token_trakt(item): import time dialog_auth = platformtools.dialog_progress("Sincronizar con Trakt. No cierres esta ventana", "1. Entra en la siguiente url: %s" % item.verify_url, - "2. Ingresa este código en la página y acepta: %s" % item.user_code, + "2. Ingresa este código en la página y acepta: %s" + % item.user_code, "3. Espera a que se cierre esta ventana") # Generalmente cada 5 segundos se intenta comprobar si el usuario ha introducido el código @@ -80,7 +82,7 @@ def token_trakt(item): time.sleep(item.intervalo) try: if dialog_auth.iscanceled(): - config.set_setting("trakt_sync", 'false' ) + config.set_setting("trakt_sync", False) return url = "http://api-v2launch.trakt.tv/oauth/device/token" @@ -128,7 +130,6 @@ def token_trakt(item): def get_trakt_watched(id_type, mediatype, update=False): - logger.info() id_list = [] @@ -151,35 +152,36 @@ def get_trakt_watched(id_type, mediatype, update=False): if token_auth: try: token_auth = config.get_setting("token_trakt", "trakt") - headers = [['Content-Type', 'application/json'], ['trakt-api-key', client_id], ['trakt-api-version', '2']] + headers = [['Content-Type', 'application/json'], ['trakt-api-key', client_id], + ['trakt-api-version', '2']] if token_auth: headers.append(['Authorization', "Bearer %s" % token_auth]) url = "https://api.trakt.tv/sync/watched/%s" % mediatype - data = httptools.downloadpage(url, headers=headers, replace_headers=True).data - watched_dict = jsontools.load(data) + data = httptools.downloadpage(url, headers=headers, replace_headers=True).data + watched_dict = jsontools.load(data) - if mediatype == 'shows': + if mediatype == 'shows': - dict_show = dict() - for item in watched_dict: - temp =[] - id = str(item['show']['ids']['tmdb']) - season_dict=dict() - for season in item['seasons']: - ep=[] - number = str(season['number']) - #season_dict = dict() - for episode in season['episodes']: - ep.append(str(episode['number'])) - season_dict[number]=ep - temp.append(season_dict) - dict_show[id] = season_dict - id_dict=dict_show - return id_dict + dict_show = dict() + for item in watched_dict: + temp = [] + id_ = str(item['show']['ids']['tmdb']) + season_dict = dict() + for season in item['seasons']: + ep = [] + number = str(season['number']) + # season_dict = dict() + for episode in season['episodes']: + ep.append(str(episode['number'])) + season_dict[number] = ep + temp.append(season_dict) + dict_show[id_] = season_dict + id_dict = dict_show + return id_dict - elif mediatype == 'movies': - for item in watched_dict: - id_list.append(str(item['movie']['ids'][id_type])) + elif mediatype == 'movies': + for item in watched_dict: + id_list.append(str(item['movie']['ids'][id_type])) except: pass @@ -188,14 +190,14 @@ def get_trakt_watched(id_type, mediatype, update=False): def trakt_check(itemlist): id_result = '' - #check = u'\u221a' + # check = u'\u221a' check = 'v' get_sync_from_file() try: for item in itemlist: info = item.infoLabels - if info != '' and info['mediatype'] in ['movie', 'episode'] and item.channel !='videolibrary': + if info != '' and info['mediatype'] in ['movie', 'episode'] and item.channel != 'videolibrary': mediatype = 'movies' id_type = 'tmdb' @@ -206,12 +208,12 @@ def trakt_check(itemlist): if id_result == '': id_result = get_trakt_watched(id_type, mediatype) if info['mediatype'] == 'movie': - if info[id_type+'_id'] in id_result: - item.title ='[COLOR limegreen][%s][/COLOR] %s' % (check, item.title) + if info[id_type + '_id'] in id_result: + item.title = '[COLOR limegreen][%s][/COLOR] %s' % (check, item.title) - elif info['mediatype']=='episode': - if info[id_type+'_id'] in id_result: - id= info[id_type+'_id'] + elif info['mediatype'] == 'episode': + if info[id_type + '_id'] in id_result: + id = info[id_type + '_id'] if info['season'] != '' and info['episode'] != '': season = str(info['season']) @@ -223,38 +225,40 @@ def trakt_check(itemlist): if episode in season_watched: item.title = '[B][COLOR limegreen][[I]%s[/I]][/COLOR][/B] %s' % (check, - item.title) + item.title) else: break except: - pass + pass return itemlist + def get_sync_from_file(): logger.info() - sync_path = os.path.join(config.get_data_path(),'settings_channels' ,'trakt') + sync_path = os.path.join(config.get_data_path(), 'settings_channels', 'trakt') trakt_node = {} if os.path.exists(sync_path): trakt_node = jsontools.get_node_from_file('trakt', "TRAKT") - trakt_node['movies']=get_trakt_watched('tmdb', 'movies') - trakt_node['shows']=get_trakt_watched('tmdb', 'shows') + trakt_node['movies'] = get_trakt_watched('tmdb', 'movies') + trakt_node['shows'] = get_trakt_watched('tmdb', 'shows') jsontools.update_node(trakt_node, 'trakt', 'TRAKT') + def update_trakt_data(mediatype, trakt_data): logger.info() sync_path = os.path.join(config.get_data_path(), 'settings_channels', 'trakt') - trakt_node = {} if os.path.exists(sync_path): trakt_node = jsontools.get_node_from_file('trakt', "TRAKT") trakt_node[mediatype] = trakt_data jsontools.update_node(trakt_node, 'trakt', 'TRAKT') + def ask_install_script(): logger.info() - import xbmc + from platformcode import platformtools respuesta = platformtools.dialog_yesno("Alfa", "Puedes instalar el script de Trakt a continuacíon, " @@ -265,5 +269,24 @@ def ask_install_script(): xbmc.executebuiltin("InstallAddon(script.trakt)") return else: - config.set_setting('install_trakt','false') + config.set_setting('install_trakt', False) return + + +def wait_for_update_trakt(): + logger.info() + t = Thread(update_all) + t.setDaemon(True) + t.start() + t.isAlive() + +def update_all(): + from time import sleep + logger.info() + sleep(20) + while xbmc.Player().isPlaying(): + sleep(20) + for mediatype in ['movies', 'shows']: + trakt_data = get_trakt_watched('tmdb', mediatype, True) + update_trakt_data(mediatype, trakt_data) + diff --git a/plugin.video.alfa/platformcode/launcher.py b/plugin.video.alfa/platformcode/launcher.py index 6b61cea8..e9cc9317 100644 --- a/plugin.video.alfa/platformcode/launcher.py +++ b/plugin.video.alfa/platformcode/launcher.py @@ -63,56 +63,10 @@ def run(item=None): elif item.action == "getmainlist": import channelselector - # # Check for updates only on first screen - # if config.get_setting("check_for_plugin_updates") == True: - # logger.info("Check for plugin updates enabled") - # from core import updater - # - # try: - # config.set_setting("plugin_updates_available", 0) - # new_published_version_tag, number_of_updates = updater.get_available_updates() - # - # config.set_setting("plugin_updates_available", number_of_updates) - # itemlist = channelselector.getmainlist() - # - # if new_published_version_tag != "": - # platformtools.dialog_notification(new_published_version_tag + " disponible", - # "Ya puedes descargar la nueva versión del plugin\n" - # "desde el listado principal") - # - # itemlist = channelselector.getmainlist() - # itemlist.insert(0, Item(title="Descargar version " + new_published_version_tag, - # version=new_published_version_tag, channel="updater", - # action="update", - # thumbnail=channelselector.get_thumb("update.png"))) - # except: - # import traceback - # logger.error(traceback.format_exc()) - # platformtools.dialog_ok("No se puede conectar", "No ha sido posible comprobar", - # "si hay actualizaciones") - # logger.error("Fallo al verificar la actualización") - # config.set_setting("plugin_updates_available", 0) - # itemlist = channelselector.getmainlist() - # - # else: - # logger.info("Check for plugin updates disabled") - # config.set_setting("plugin_updates_available", 0) - # itemlist = channelselector.getmainlist() - itemlist = channelselector.getmainlist() platformtools.render_items(itemlist, item) - # # Action for updating plugin - # elif item.action == "update": - # - # from core import updater - # updater.update(item) - # config.set_setting("plugin_updates_available", 0) - # - # import xbmc - # xbmc.executebuiltin("Container.Refresh") - # Action for channel types on channelselector: movies, series, etc. elif item.action == "getchanneltypes": import channelselector @@ -277,11 +231,6 @@ def run(item=None): else: logger.info("Executing channel '%s' method" % item.action) itemlist = getattr(channel, item.action)(item) - # if item.start: - # menu_icon = get_thumb('menu.png') - # menu = Item(channel="channelselector", action="getmainlist", viewmode="movie", thumbnail=menu_icon, - # title='Menu') - # itemlist.insert(0, menu) if config.get_setting('trakt_sync'): token_auth = config.get_setting("token_trakt", "trakt") if not token_auth: @@ -293,7 +242,7 @@ def run(item=None): trakt_tools.ask_install_script() itemlist = trakt_tools.trakt_check(itemlist) else: - config.set_setting('install_trakt', 'true') + config.set_setting('install_trakt', True) platformtools.render_items(itemlist, item) diff --git a/plugin.video.alfa/platformcode/platformtools.py b/plugin.video.alfa/platformcode/platformtools.py index 16be8c87..fed81b09 100644 --- a/plugin.video.alfa/platformcode/platformtools.py +++ b/plugin.video.alfa/platformcode/platformtools.py @@ -16,31 +16,21 @@ import config import xbmc import xbmcgui import xbmcplugin -from core.item import Item -from core import scrapertools -from core import httptools -from core import jsontools -from platformcode import logger from channelselector import get_thumb from core import trakt_tools +from core.item import Item +from platformcode import logger -class XBMCPlayer( xbmc.Player ): +class XBMCPlayer(xbmc.Player): - def __init__( self, *args ): + def __init__(self, *args): pass - def onPlaybackEnded(self): - logger.info() - from time import sleep - sleep(20) - for mediatype in ['movies', 'shows']: - trakt_data = trakt_tools.get_trakt_watched('tmdb', mediatype, True) - trakt_tools.update_trakt_data(mediatype, trakt_data) - xbmc_player = XBMCPlayer() + def dialog_ok(heading, line1, line2="", line3=""): dialog = xbmcgui.Dialog() return dialog.ok(heading, line1, line2, line3) @@ -116,7 +106,6 @@ def render_items(itemlist, parent_item): """ # Si el itemlist no es un list salimos if not type(itemlist) == list: - return if parent_item.start: @@ -176,7 +165,6 @@ def render_items(itemlist, parent_item): listitem.setThumbnailImage(item.thumbnail) listitem.setProperty('fanart_image', fanart) - # No need it, use fanart instead # xbmcplugin.setPluginFanart(int(sys.argv[1]), os.path.join(config.get_runtime_path(), "fanart.jpg")) @@ -226,12 +214,11 @@ def render_items(itemlist, parent_item): if config.get_setting("forceview"): viewmode_id = get_viewmode_id(parent_item) xbmc.executebuiltin("Container.SetViewMode(%s)" % viewmode_id) - if parent_item.mode in ['silent', 'get_cached', 'set_cache','finish']: + if parent_item.mode in ['silent', 'get_cached', 'set_cache', 'finish']: xbmc.executebuiltin("Container.SetViewMode(500)") def get_viewmode_id(parent_item): - # viewmode_json habria q guardarlo en un archivo y crear un metodo para q el user fije sus preferencias en: # user_files, user_movies, user_tvshows, user_season y user_episodes. viewmode_json = {'skin.confluence': {'default_files': 50, @@ -388,7 +375,7 @@ def set_context_commands(item, parent_item): "XBMC.RunScript(script.extendedinfo,info=seasoninfo,%s)" % param)) elif item.contentType == "tvshow" and (item.infoLabels['tmdb_id'] or item.infoLabels['tvdb_id'] or - item.infoLabels['imdb_id'] or item.contentSerieName): + item.infoLabels['imdb_id'] or item.contentSerieName): param = "id =%s,tvdb_id=%s,imdb_id=%s,name=%s" \ % (item.infoLabels['tmdb_id'], item.infoLabels['tvdb_id'], item.infoLabels['imdb_id'], item.contentSerieName) @@ -396,14 +383,14 @@ def set_context_commands(item, parent_item): "XBMC.RunScript(script.extendedinfo,info=extendedtvinfo,%s)" % param)) elif item.contentType == "movie" and (item.infoLabels['tmdb_id'] or item.infoLabels['imdb_id'] or - item.contentTitle): + item.contentTitle): param = "id =%s,imdb_id=%s,name=%s" \ % (item.infoLabels['tmdb_id'], item.infoLabels['imdb_id'], item.contentTitle) context_commands.append(("ExtendedInfo", "XBMC.RunScript(script.extendedinfo,info=extendedinfo,%s)" % param)) # InfoPlus - if config.get_setting("infoplus") == True: + if config.get_setting("infoplus"): if item.infoLabels['tmdb_id'] or item.infoLabels['imdb_id'] or item.infoLabels['tvdb_id'] or \ (item.contentTitle and item.infoLabels["year"]) or item.contentSerieName: context_commands.append(("InfoPlus", "XBMC.RunPlugin(%s?%s)" % (sys.argv[0], item.clone( @@ -423,11 +410,11 @@ def set_context_commands(item, parent_item): (sys.argv[0], item.clone(channel="favorites", action="addFavourite", from_channel=item.channel, from_action=item.action).tourl()))) - #Buscar en otros canales - if item.contentType in ['movie','tvshow']and item.channel != 'search': + # Buscar en otros canales + if item.contentType in ['movie', 'tvshow'] and item.channel != 'search': # Buscar en otros canales - if item.contentSerieName!='': - item.wanted=item.contentSerieName + if item.contentSerieName != '': + item.wanted = item.contentSerieName else: item.wanted = item.contentTitle context_commands.append(("[COLOR yellow]Buscar en otros canales[/COLOR]", @@ -437,14 +424,14 @@ def set_context_commands(item, parent_item): from_channel=item.channel, contextual=True).tourl()))) - #Definir como Pagina de inicio + # Definir como Pagina de inicio if config.get_setting('start_page'): if item.action not in ['findvideos', 'play']: context_commands.insert(0, ("[COLOR 0xffccff00]Definir como pagina de inicio[/COLOR]", "XBMC.RunPlugin(%s?%s)" % ( - sys.argv[0], Item(channel='side_menu', - action="set_custom_start", - parent=item.tourl()).tourl()))) + sys.argv[0], Item(channel='side_menu', + action="set_custom_start", + parent=item.tourl()).tourl()))) if item.channel != "videolibrary": # Añadir Serie a la videoteca @@ -505,21 +492,17 @@ def set_context_commands(item, parent_item): context_commands.append(("Super Favourites Menu", "XBMC.RunScript(special://home/addons/plugin.program.super.favourites/LaunchSFMenu.py)")) - - context_commands = sorted(context_commands, key=lambda comand: comand[0]) # Menu Rapido - context_commands.insert(0,("[COLOR 0xffccff00][/COLOR]", - "XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(channel='side_menu', - action="open_menu", - parent=parent_item.tourl()).tourl( + context_commands.insert(0, ("[COLOR 0xffccff00][/COLOR]", + "XBMC.Container.Update (%s?%s)" % (sys.argv[0], Item(channel='side_menu', + action="open_menu", + parent=parent_item.tourl()).tourl( - )))) + )))) return context_commands - - def is_playing(): return xbmc_player.isPlaying() @@ -600,10 +583,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False): set_player(item, xlistitem, mediaurl, view, strm) - - def stop_video(): - from time import sleep xbmc_player.stop() @@ -787,7 +767,7 @@ def set_opcion(item, seleccion, opciones, video_urls): listitem = xbmcgui.ListItem(item.title) if config.get_platform(True)['num_version'] >= 16.0: - listitem.setArt({'icon':"DefaultVideo.png", 'thumb': item.thumbnail}) + listitem.setArt({'icon': "DefaultVideo.png", 'thumb': item.thumbnail}) else: listitem.setIconImage("DefaultVideo.png") listitem.setThumbnailImage(item.thumbnail) @@ -816,20 +796,6 @@ def set_opcion(item, seleccion, opciones, video_urls): favorites.addFavourite(item) salir = True - # "Añadir a videoteca": - elif opciones[seleccion] == config.get_localized_string(30161): - titulo = item.fulltitle - if titulo == "": - titulo = item.title - - new_item = item.clone(title=titulo, action="play_from_library", category="Cine", - fulltitle=item.fulltitle, channel=item.channel) - - from core import videolibrarytools - videolibrarytools.add_movie(new_item) - - salir = True - # "Buscar Trailer": elif opciones[seleccion] == config.get_localized_string(30162): config.set_setting("subtitulo", False) @@ -911,11 +877,11 @@ def set_player(item, xlistitem, mediaurl, view, strm): playlist.add(mediaurl, xlistitem) # Reproduce - #xbmc_player = xbmc_player + # xbmc_player = xbmc_player xbmc_player.play(playlist, xlistitem) - while xbmc_player.isPlaying(): - xbmc.sleep(200) - xbmc_player.onPlaybackEnded() + if config.get_setting('trakt_sync'): + trakt_tools.wait_for_update_trakt() + # elif config.get_setting("player_mode") == 1 or item.isPlayable: elif config.get_setting("player_mode") == 1: logger.info("mediaurl :" + mediaurl) @@ -1067,7 +1033,7 @@ def play_torrent(item, xlistitem, mediaurl): playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() playlist.add(videourl, xlistitem) - #xbmc_player = xbmc_player + # xbmc_player = xbmc_player xbmc_player.play(playlist) # Marcamos como reproducido para que no se vuelva a iniciar