Launcher: evita bloqueo en Kodi en "Ajuste de tasa refresco de pantalla"
Kodi se bloqueaba en el pseudo "play" del vídeo "subtitle". Hay que poner un "sleep(0.5)" antes del Stop
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
"id": "domain_name",
|
"id": "domain_name",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"label": "URL actual de la Web Mejor Torrent",
|
"label": "URL actual de la Web Mejor Torrent",
|
||||||
"default": "http://www.mejortorrent.org/",
|
"default": "http://www.mejortorrent.tv/",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": true
|
"visible": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ list_servers = ['torrent']
|
|||||||
|
|
||||||
channel = "mejortorrent"
|
channel = "mejortorrent"
|
||||||
|
|
||||||
host = 'http://www.mejortorrent.org/'
|
host = 'http://www.mejortorrent.tv/'
|
||||||
|
host_sufix = '.tv'
|
||||||
#host = config.get_setting('domain_name', channel)
|
#host = config.get_setting('domain_name', channel)
|
||||||
|
|
||||||
categoria = channel.capitalize()
|
categoria = channel.capitalize()
|
||||||
@@ -296,8 +297,8 @@ def listado(item):
|
|||||||
|
|
||||||
item_local.title = scrapertools.get_match(scrapedurl, patron_enlace)
|
item_local.title = scrapertools.get_match(scrapedurl, patron_enlace)
|
||||||
item_local.title = item_local.title.replace("-", " ")
|
item_local.title = item_local.title.replace("-", " ")
|
||||||
item_local.url = urlparse.urljoin(item_local.url, scrapedurl)
|
item_local.url = verificar_url(urlparse.urljoin(item_local.url, scrapedurl))
|
||||||
item_local.thumbnail = host + urllib.quote(scrapedthumbnail)
|
item_local.thumbnail = verificar_url(host + urllib.quote(scrapedthumbnail))
|
||||||
item_local.contentThumbnail = item_local.thumbnail
|
item_local.contentThumbnail = item_local.thumbnail
|
||||||
item_local.infoLabels['year'] = '-' # Al no saber el año, le ponemos "-" y TmDB lo calcula automáticamente
|
item_local.infoLabels['year'] = '-' # Al no saber el año, le ponemos "-" y TmDB lo calcula automáticamente
|
||||||
|
|
||||||
@@ -660,7 +661,7 @@ def listado_busqueda(item):
|
|||||||
item_local.quality = scrapertools.remove_htmltags(scrapedinfo).decode('iso-8859-1').encode('utf8')
|
item_local.quality = scrapertools.remove_htmltags(scrapedinfo).decode('iso-8859-1').encode('utf8')
|
||||||
item_local.quality = item_local.quality.replace("(", "").replace(")", "").replace("[", "").replace("]", "").replace("Documental", "").replace("documental", "")
|
item_local.quality = item_local.quality.replace("(", "").replace(")", "").replace("[", "").replace("]", "").replace("Documental", "").replace("documental", "")
|
||||||
|
|
||||||
item_local.url = urlparse.urljoin(item.url, scrapedurl)
|
item_local.url = verificar_url(urlparse.urljoin(item.url, scrapedurl))
|
||||||
|
|
||||||
#Preparamos la información básica para TMDB
|
#Preparamos la información básica para TMDB
|
||||||
if "/serie-" in scrapedurl or "/doc-" in scrapedurl:
|
if "/serie-" in scrapedurl or "/doc-" in scrapedurl:
|
||||||
@@ -829,10 +830,10 @@ def findvideos(item):
|
|||||||
for scrapedurl in matches:
|
for scrapedurl in matches:
|
||||||
#Generamos una copia de Item para trabajar sobre ella
|
#Generamos una copia de Item para trabajar sobre ella
|
||||||
item_local = item.clone()
|
item_local = item.clone()
|
||||||
url = urlparse.urljoin(item.url, scrapedurl)
|
url = verificar_url(urlparse.urljoin(item.url, scrapedurl))
|
||||||
|
|
||||||
# Localiza el .torrent en el siguiente link
|
# Localiza el .torrent en el siguiente link
|
||||||
if not item.post and not item.armagedon: # Si no es llamada con Post, hay que bajar un nivel más
|
if not item.post and not item.armagedon: # Si no es llamada con Post, hay que bajar un nivel más
|
||||||
try:
|
try:
|
||||||
torrent_data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(url).data)
|
torrent_data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(url).data)
|
||||||
except: #error
|
except: #error
|
||||||
@@ -849,15 +850,15 @@ def findvideos(item):
|
|||||||
if item.videolibray_emergency_urls: #Si es llamado desde creación de Videoteca...
|
if item.videolibray_emergency_urls: #Si es llamado desde creación de Videoteca...
|
||||||
return item #Devolvemos el Item de la llamada
|
return item #Devolvemos el Item de la llamada
|
||||||
else:
|
else:
|
||||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||||
|
|
||||||
#logger.debug(torrent_data)
|
#logger.debug(torrent_data)
|
||||||
if not item.armagedon:
|
if not item.armagedon:
|
||||||
item_local.url = scrapertools.get_match(torrent_data, ">Pincha.*?<a href='(.*?\/uploads\/torrents\/\w+\/.*?\.torrent)'")
|
item_local.url = scrapertools.get_match(torrent_data, ">Pincha.*?<a href='(.*?\/uploads\/torrents\/\w+\/.*?\.torrent)'")
|
||||||
item_local.url = urlparse.urljoin(url, item_local.url)
|
item_local.url = verificar_url(urlparse.urljoin(url, item_local.url))
|
||||||
|
|
||||||
elif not item.armagedon:
|
elif not item.armagedon:
|
||||||
item_local.url = url # Ya teníamos el link desde el primer nivel (documentales)
|
item_local.url = url # Ya teníamos el link desde el primer nivel (documentales)
|
||||||
item_local.url = item_local.url.replace(" ", "%20")
|
item_local.url = item_local.url.replace(" ", "%20")
|
||||||
|
|
||||||
if item.armagedon and item.emergency_urls and not item.videolibray_emergency_urls:
|
if item.armagedon and item.emergency_urls and not item.videolibray_emergency_urls:
|
||||||
@@ -867,10 +868,10 @@ def findvideos(item):
|
|||||||
del item.emergency_urls[0][0]
|
del item.emergency_urls[0][0]
|
||||||
if not item.armagedon and item.emergency_urls and not item.videolibray_emergency_urls:
|
if not item.armagedon and item.emergency_urls and not item.videolibray_emergency_urls:
|
||||||
if len(item.emergency_urls[0]):
|
if len(item.emergency_urls[0]):
|
||||||
item_local.torrent_alt = item.emergency_urls[0][0] #Guardamos la primera url del .Torrent ALTERNATIVA
|
item_local.torrent_alt = item.emergency_urls[0][0] #Guardamos la primera url del .Torrent ALTERNATIVA
|
||||||
|
|
||||||
if item.videolibray_emergency_urls:
|
if item.videolibray_emergency_urls:
|
||||||
item.emergency_urls[0].append(item_local.url) #Salvamnos la url...
|
item.emergency_urls[0].verificar_url(append(item_local.url)) #Salvamnos la url...
|
||||||
|
|
||||||
# Poner la calidad, si es necesario
|
# Poner la calidad, si es necesario
|
||||||
if not item_local.quality:
|
if not item_local.quality:
|
||||||
@@ -1003,7 +1004,7 @@ def episodios(item):
|
|||||||
item_local.title = ''
|
item_local.title = ''
|
||||||
item_local.context = "['buscar_trailer']"
|
item_local.context = "['buscar_trailer']"
|
||||||
|
|
||||||
item_local.url = urlparse.urljoin(host, scrapedurl)
|
item_local.url = verificar_url(urlparse.urljoin(host, scrapedurl))
|
||||||
|
|
||||||
scrapedtitle = re.sub('\r\n', '', scrapedtitle).decode('iso-8859-1').encode('utf8').strip()
|
scrapedtitle = re.sub('\r\n', '', scrapedtitle).decode('iso-8859-1').encode('utf8').strip()
|
||||||
if scrapedtitle.endswith('.'):
|
if scrapedtitle.endswith('.'):
|
||||||
@@ -1030,7 +1031,7 @@ def episodios(item):
|
|||||||
else: #Se prepara el Post para documentales
|
else: #Se prepara el Post para documentales
|
||||||
item_local.contentSeason = 1
|
item_local.contentSeason = 1
|
||||||
item_local.contentEpisodeNumber = 1
|
item_local.contentEpisodeNumber = 1
|
||||||
item_local.url = host + "/secciones.php?sec=descargas&ap=contar_varios"
|
item_local.url = verificar_url(host + "/secciones.php?sec=descargas&ap=contar_varios")
|
||||||
item_local.post = urllib.urlencode({name: value, "total_capis": total_capis, "tabla": tabla, "titulo": titulo_post})
|
item_local.post = urllib.urlencode({name: value, "total_capis": total_capis, "tabla": tabla, "titulo": titulo_post})
|
||||||
|
|
||||||
if year:
|
if year:
|
||||||
@@ -1050,6 +1051,15 @@ def episodios(item):
|
|||||||
item, itemlist = generictools.post_tmdb_episodios(item, itemlist)
|
item, itemlist = generictools.post_tmdb_episodios(item, itemlist)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def verificar_url(url):
|
||||||
|
if '.com' in url or '.net' in url or '.org' in url:
|
||||||
|
url = url.replace('.com', '.tv').replace('.net', '.tv').replace('.org', '.tv')
|
||||||
|
url = url.replace('torrents/tmp/torrent.php?table=peliculas/&name=', 'torrents/peliculas/')
|
||||||
|
url = url.replace('torrents/tmp/torrent.php?table=series/&name=', 'torrents/series/')
|
||||||
|
url = url.replace('torrents/tmp/torrent.php?table=documentales/&name=', 'torrents/documentales/')
|
||||||
|
return url
|
||||||
|
|
||||||
|
|
||||||
def actualizar_titulos(item):
|
def actualizar_titulos(item):
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import urlparse
|
|||||||
import datetime
|
import datetime
|
||||||
import ast
|
import ast
|
||||||
import random
|
import random
|
||||||
|
import traceback
|
||||||
|
|
||||||
from channelselector import get_thumb
|
from channelselector import get_thumb
|
||||||
from core import httptools
|
from core import httptools
|
||||||
@@ -700,8 +701,12 @@ def listado(item):
|
|||||||
|
|
||||||
#Guardamos el resto de variables del vídeo
|
#Guardamos el resto de variables del vídeo
|
||||||
item_local.url = scrapedurl
|
item_local.url = scrapedurl
|
||||||
|
if not item_local.url.startswith("http"): #Si le falta el http.: lo ponemos
|
||||||
|
item_local.url = scrapertools.find_single_match(item_local.channel_host, '(\w+:)//') + item_local.url
|
||||||
item_local.thumbnail = scrapedthumbnail
|
item_local.thumbnail = scrapedthumbnail
|
||||||
item_local.contentThumbnail = scrapedthumbnail
|
if not item_local.thumbnail.startswith("http"): #Si le falta el http.: lo ponemos
|
||||||
|
item_local.thumbnail = scrapertools.find_single_match(item_local.channel_host, '(\w+:)//') + item_local.thumbnail
|
||||||
|
item_local.contentThumbnail = item_local.thumbnail
|
||||||
|
|
||||||
#Guardamos el año que puede venir en la url, por si luego no hay resultados desde TMDB
|
#Guardamos el año que puede venir en la url, por si luego no hay resultados desde TMDB
|
||||||
year = ''
|
year = ''
|
||||||
@@ -1008,7 +1013,7 @@ def listado_busqueda(item):
|
|||||||
if not data_serie: #Si no ha logrado encontrar nada, salimos
|
if not data_serie: #Si no ha logrado encontrar nada, salimos
|
||||||
title_subs += ["ERR"]
|
title_subs += ["ERR"]
|
||||||
|
|
||||||
elif item_local.channel_alt: #Si ha habido fail-over, lo comento
|
elif item_local.channel_alt: #Si ha habido fail-over, lo comento
|
||||||
url = url.replace(item_local.channel_alt, item_local.category.lower())
|
url = url.replace(item_local.channel_alt, item_local.category.lower())
|
||||||
title_subs += ["ALT"]
|
title_subs += ["ALT"]
|
||||||
|
|
||||||
@@ -1029,8 +1034,10 @@ def listado_busqueda(item):
|
|||||||
title_subs += ["Episodio %sx%s" % (scrapertools.find_single_match(url, '\/temp.*?-(\d+)-?\/cap.*?-(\d+(?:-al-\d+)?)-?\/'))]
|
title_subs += ["Episodio %sx%s" % (scrapertools.find_single_match(url, '\/temp.*?-(\d+)-?\/cap.*?-(\d+(?:-al-\d+)?)-?\/'))]
|
||||||
url = item_local.url
|
url = item_local.url
|
||||||
except:
|
except:
|
||||||
pass
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
|
#logger.debug(item_local.url)
|
||||||
|
|
||||||
if item.extra == "novedades" and "/serie" in url:
|
if item.extra == "novedades" and "/serie" in url:
|
||||||
if not item_local.url or episodio_serie == 0:
|
if not item_local.url or episodio_serie == 0:
|
||||||
item_local.url = url
|
item_local.url = url
|
||||||
@@ -1204,8 +1211,12 @@ def listado_busqueda(item):
|
|||||||
|
|
||||||
#Guardamos el resto de variables del vídeo
|
#Guardamos el resto de variables del vídeo
|
||||||
item_local.url = url
|
item_local.url = url
|
||||||
|
if not item_local.url.startswith("http"): #Si le falta el http.: lo ponemos
|
||||||
|
item_local.url = scrapertools.find_single_match(item_local.channel_host, '(\w+:)//') + item_local.url
|
||||||
item_local.thumbnail = scrapedthumbnail
|
item_local.thumbnail = scrapedthumbnail
|
||||||
item_local.contentThumbnail = scrapedthumbnail
|
if not item_local.thumbnail.startswith("http"): #Si le falta el http.: lo ponemos
|
||||||
|
item_local.thumbnail = scrapertools.find_single_match(item_local.channel_host, '(\w+:)//') + item_local.thumbnail
|
||||||
|
item_local.contentThumbnail = item_local.thumbnail
|
||||||
|
|
||||||
#Guardamos el año que puede venir en la url, por si luego no hay resultados desde TMDB
|
#Guardamos el año que puede venir en la url, por si luego no hay resultados desde TMDB
|
||||||
try:
|
try:
|
||||||
@@ -2019,7 +2030,12 @@ def episodios(item):
|
|||||||
|
|
||||||
item_local = item.clone() #Creamos copia local de Item por episodio
|
item_local = item.clone() #Creamos copia local de Item por episodio
|
||||||
item_local.url = url
|
item_local.url = url
|
||||||
item_local.contentThumbnail = thumb
|
if not item_local.url.startswith("http"): #Si le falta el http.: lo ponemos
|
||||||
|
item_local.url = scrapertools.find_single_match(item_local.channel_host, '(\w+:)//') + item_local.url
|
||||||
|
item_local.thumbnail = thumb
|
||||||
|
if not item_local.thumbnail.startswith("http"): #Si le falta el http.: lo ponemos
|
||||||
|
item_local.thumbnail = scrapertools.find_single_match(item_local.channel_host, '(\w+:)//') + item_local.thumbnail
|
||||||
|
item_local.contentThumbnail = item_local.thumbnail
|
||||||
estado = True #Buena calidad de datos por defecto
|
estado = True #Buena calidad de datos por defecto
|
||||||
|
|
||||||
if "<span" in info: # new style
|
if "<span" in info: # new style
|
||||||
|
|||||||
@@ -1,476 +1,478 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# XBMC Launcher (xbmc / kodi)
|
# XBMC Launcher (xbmc / kodi)
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import urllib2
|
import urllib2
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from core import channeltools
|
from core import channeltools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core import servertools
|
from core import servertools
|
||||||
from core import videolibrarytools
|
from core import videolibrarytools
|
||||||
from core import trakt_tools
|
from core import trakt_tools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
from platformcode import platformtools
|
from platformcode import platformtools
|
||||||
from platformcode.logger import WebErrorException
|
from platformcode.logger import WebErrorException
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
""" Primera funcion que se ejecuta al entrar en el plugin.
|
""" Primera funcion que se ejecuta al entrar en el plugin.
|
||||||
Dentro de esta funcion deberian ir todas las llamadas a las
|
Dentro de esta funcion deberian ir todas las llamadas a las
|
||||||
funciones que deseamos que se ejecuten nada mas abrir el plugin.
|
funciones que deseamos que se ejecuten nada mas abrir el plugin.
|
||||||
"""
|
"""
|
||||||
logger.info()
|
logger.info()
|
||||||
#config.set_setting('show_once', True)
|
#config.set_setting('show_once', True)
|
||||||
# Test if all the required directories are created
|
# Test if all the required directories are created
|
||||||
config.verify_directories_created()
|
config.verify_directories_created()
|
||||||
|
|
||||||
|
|
||||||
def run(item=None):
|
def run(item=None):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
if not item:
|
if not item:
|
||||||
# Extract item from sys.argv
|
# Extract item from sys.argv
|
||||||
if sys.argv[2]:
|
if sys.argv[2]:
|
||||||
item = Item().fromurl(sys.argv[2])
|
item = Item().fromurl(sys.argv[2])
|
||||||
|
|
||||||
# If no item, this is mainlist
|
# If no item, this is mainlist
|
||||||
else:
|
else:
|
||||||
if config.get_setting("start_page"):
|
if config.get_setting("start_page"):
|
||||||
|
|
||||||
if not config.get_setting("custom_start"):
|
if not config.get_setting("custom_start"):
|
||||||
category = config.get_setting("category").lower()
|
category = config.get_setting("category").lower()
|
||||||
item = Item(channel="news", action="novedades", extra=category, mode = 'silent')
|
item = Item(channel="news", action="novedades", extra=category, mode = 'silent')
|
||||||
else:
|
else:
|
||||||
from channels import side_menu
|
from channels import side_menu
|
||||||
item= Item()
|
item= Item()
|
||||||
item = side_menu.check_user_home(item)
|
item = side_menu.check_user_home(item)
|
||||||
item.start = True;
|
item.start = True;
|
||||||
else:
|
else:
|
||||||
item = Item(channel="channelselector", action="getmainlist", viewmode="movie")
|
item = Item(channel="channelselector", action="getmainlist", viewmode="movie")
|
||||||
if not config.get_setting('show_once'):
|
if not config.get_setting('show_once'):
|
||||||
from platformcode import xbmc_videolibrary
|
from platformcode import xbmc_videolibrary
|
||||||
xbmc_videolibrary.ask_set_content(1)
|
xbmc_videolibrary.ask_set_content(1)
|
||||||
config.set_setting('show_once', True)
|
config.set_setting('show_once', True)
|
||||||
|
|
||||||
logger.info(item.tostring())
|
logger.info(item.tostring())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# If item has no action, stops here
|
# If item has no action, stops here
|
||||||
if item.action == "":
|
if item.action == "":
|
||||||
logger.info("Item sin accion")
|
logger.info("Item sin accion")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Action for main menu in channelselector
|
# Action for main menu in channelselector
|
||||||
elif item.action == "getmainlist":
|
elif item.action == "getmainlist":
|
||||||
import channelselector
|
import channelselector
|
||||||
|
|
||||||
itemlist = channelselector.getmainlist()
|
itemlist = channelselector.getmainlist()
|
||||||
|
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|
||||||
# Action for channel types on channelselector: movies, series, etc.
|
# Action for channel types on channelselector: movies, series, etc.
|
||||||
elif item.action == "getchanneltypes":
|
elif item.action == "getchanneltypes":
|
||||||
import channelselector
|
import channelselector
|
||||||
itemlist = channelselector.getchanneltypes()
|
itemlist = channelselector.getchanneltypes()
|
||||||
|
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|
||||||
# Action for channel listing on channelselector
|
# Action for channel listing on channelselector
|
||||||
elif item.action == "filterchannels":
|
elif item.action == "filterchannels":
|
||||||
import channelselector
|
import channelselector
|
||||||
itemlist = channelselector.filterchannels(item.channel_type)
|
itemlist = channelselector.filterchannels(item.channel_type)
|
||||||
|
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|
||||||
# Special action for playing a video from the library
|
# Special action for playing a video from the library
|
||||||
elif item.action == "play_from_library":
|
elif item.action == "play_from_library":
|
||||||
play_from_library(item)
|
play_from_library(item)
|
||||||
return
|
return
|
||||||
|
|
||||||
elif item.action == "keymap":
|
elif item.action == "keymap":
|
||||||
from platformcode import keymaptools
|
from platformcode import keymaptools
|
||||||
if item.open:
|
if item.open:
|
||||||
return keymaptools.open_shortcut_menu()
|
return keymaptools.open_shortcut_menu()
|
||||||
else:
|
else:
|
||||||
return keymaptools.set_key()
|
return keymaptools.set_key()
|
||||||
|
|
||||||
elif item.action == "script":
|
elif item.action == "script":
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
if tmdb.drop_bd():
|
if tmdb.drop_bd():
|
||||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60011), time=2000, sound=False)
|
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60011), time=2000, sound=False)
|
||||||
|
|
||||||
# Action in certain channel specified in "action" and "channel" parameters
|
# Action in certain channel specified in "action" and "channel" parameters
|
||||||
else:
|
else:
|
||||||
|
|
||||||
# Entry point for a channel is the "mainlist" action, so here we check parental control
|
# Entry point for a channel is the "mainlist" action, so here we check parental control
|
||||||
if item.action == "mainlist":
|
if item.action == "mainlist":
|
||||||
|
|
||||||
|
|
||||||
# Parental control
|
# Parental control
|
||||||
# If it is an adult channel, and user has configured pin, asks for it
|
# If it is an adult channel, and user has configured pin, asks for it
|
||||||
if channeltools.is_adult(item.channel) and config.get_setting("adult_request_password"):
|
if channeltools.is_adult(item.channel) and config.get_setting("adult_request_password"):
|
||||||
tecleado = platformtools.dialog_input("", config.get_localized_string(60334), True)
|
tecleado = platformtools.dialog_input("", config.get_localized_string(60334), True)
|
||||||
if tecleado is None or tecleado != config.get_setting("adult_password"):
|
if tecleado is None or tecleado != config.get_setting("adult_password"):
|
||||||
return
|
return
|
||||||
|
|
||||||
# # Actualiza el canal individual
|
# # Actualiza el canal individual
|
||||||
# if (item.action == "mainlist" and item.channel != "channelselector" and
|
# if (item.action == "mainlist" and item.channel != "channelselector" and
|
||||||
# config.get_setting("check_for_channel_updates") == True):
|
# config.get_setting("check_for_channel_updates") == True):
|
||||||
# from core import updater
|
# from core import updater
|
||||||
# updater.update_channel(item.channel)
|
# updater.update_channel(item.channel)
|
||||||
|
|
||||||
# Checks if channel exists
|
# Checks if channel exists
|
||||||
channel_file = os.path.join(config.get_runtime_path(),
|
channel_file = os.path.join(config.get_runtime_path(),
|
||||||
'channels', item.channel + ".py")
|
'channels', item.channel + ".py")
|
||||||
logger.info("channel_file=%s" % channel_file)
|
logger.info("channel_file=%s" % channel_file)
|
||||||
|
|
||||||
channel = None
|
channel = None
|
||||||
|
|
||||||
if os.path.exists(channel_file):
|
if os.path.exists(channel_file):
|
||||||
try:
|
try:
|
||||||
channel = __import__('channels.%s' % item.channel, None,
|
channel = __import__('channels.%s' % item.channel, None,
|
||||||
None, ["channels.%s" % item.channel])
|
None, ["channels.%s" % item.channel])
|
||||||
except ImportError:
|
except ImportError:
|
||||||
exec "import channels." + item.channel + " as channel"
|
exec "import channels." + item.channel + " as channel"
|
||||||
|
|
||||||
logger.info("Running channel %s | %s" % (channel.__name__, channel.__file__))
|
logger.info("Running channel %s | %s" % (channel.__name__, channel.__file__))
|
||||||
|
|
||||||
# Special play action
|
# Special play action
|
||||||
if item.action == "play":
|
if item.action == "play":
|
||||||
#define la info para trakt
|
#define la info para trakt
|
||||||
try:
|
try:
|
||||||
trakt_tools.set_trakt_info(item)
|
trakt_tools.set_trakt_info(item)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
logger.info("item.action=%s" % item.action.upper())
|
logger.info("item.action=%s" % item.action.upper())
|
||||||
# logger.debug("item_toPlay: " + "\n" + item.tostring('\n'))
|
# logger.debug("item_toPlay: " + "\n" + item.tostring('\n'))
|
||||||
|
|
||||||
# First checks if channel has a "play" function
|
# First checks if channel has a "play" function
|
||||||
if hasattr(channel, 'play'):
|
if hasattr(channel, 'play'):
|
||||||
logger.info("Executing channel 'play' method")
|
logger.info("Executing channel 'play' method")
|
||||||
itemlist = channel.play(item)
|
itemlist = channel.play(item)
|
||||||
b_favourite = item.isFavourite
|
b_favourite = item.isFavourite
|
||||||
# Play should return a list of playable URLS
|
# Play should return a list of playable URLS
|
||||||
if len(itemlist) > 0 and isinstance(itemlist[0], Item):
|
if len(itemlist) > 0 and isinstance(itemlist[0], Item):
|
||||||
item = itemlist[0]
|
item = itemlist[0]
|
||||||
if b_favourite:
|
if b_favourite:
|
||||||
item.isFavourite = True
|
item.isFavourite = True
|
||||||
platformtools.play_video(item)
|
platformtools.play_video(item)
|
||||||
|
|
||||||
# Permitir varias calidades desde play en el canal
|
# Permitir varias calidades desde play en el canal
|
||||||
elif len(itemlist) > 0 and isinstance(itemlist[0], list):
|
elif len(itemlist) > 0 and isinstance(itemlist[0], list):
|
||||||
item.video_urls = itemlist
|
item.video_urls = itemlist
|
||||||
platformtools.play_video(item)
|
platformtools.play_video(item)
|
||||||
|
|
||||||
# If not, shows user an error message
|
# If not, shows user an error message
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(60339))
|
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(60339))
|
||||||
|
|
||||||
# If player don't have a "play" function, not uses the standard play from platformtools
|
# If player don't have a "play" function, not uses the standard play from platformtools
|
||||||
else:
|
else:
|
||||||
logger.info("Executing core 'play' method")
|
logger.info("Executing core 'play' method")
|
||||||
platformtools.play_video(item)
|
platformtools.play_video(item)
|
||||||
|
|
||||||
# Special action for findvideos, where the plugin looks for known urls
|
# Special action for findvideos, where the plugin looks for known urls
|
||||||
elif item.action == "findvideos":
|
elif item.action == "findvideos":
|
||||||
|
|
||||||
# First checks if channel has a "findvideos" function
|
# First checks if channel has a "findvideos" function
|
||||||
if hasattr(channel, 'findvideos'):
|
if hasattr(channel, 'findvideos'):
|
||||||
itemlist = getattr(channel, item.action)(item)
|
itemlist = getattr(channel, item.action)(item)
|
||||||
itemlist = servertools.filter_servers(itemlist)
|
itemlist = servertools.filter_servers(itemlist)
|
||||||
|
|
||||||
# If not, uses the generic findvideos function
|
# If not, uses the generic findvideos function
|
||||||
else:
|
else:
|
||||||
logger.info("No channel 'findvideos' method, "
|
logger.info("No channel 'findvideos' method, "
|
||||||
"executing core method")
|
"executing core method")
|
||||||
itemlist = servertools.find_video_items(item)
|
itemlist = servertools.find_video_items(item)
|
||||||
|
|
||||||
if config.get_setting("max_links", "videolibrary") != 0:
|
if config.get_setting("max_links", "videolibrary") != 0:
|
||||||
itemlist = limit_itemlist(itemlist)
|
itemlist = limit_itemlist(itemlist)
|
||||||
|
|
||||||
from platformcode import subtitletools
|
from platformcode import subtitletools
|
||||||
subtitletools.saveSubtitleName(item)
|
subtitletools.saveSubtitleName(item)
|
||||||
|
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|
||||||
# Special action for adding a movie to the library
|
# Special action for adding a movie to the library
|
||||||
elif item.action == "add_pelicula_to_library":
|
elif item.action == "add_pelicula_to_library":
|
||||||
videolibrarytools.add_movie(item)
|
videolibrarytools.add_movie(item)
|
||||||
|
|
||||||
# Special action for adding a serie to the library
|
# Special action for adding a serie to the library
|
||||||
elif item.action == "add_serie_to_library":
|
elif item.action == "add_serie_to_library":
|
||||||
videolibrarytools.add_tvshow(item, channel)
|
videolibrarytools.add_tvshow(item, channel)
|
||||||
|
|
||||||
# Special action for downloading all episodes from a serie
|
# Special action for downloading all episodes from a serie
|
||||||
elif item.action == "download_all_episodes":
|
elif item.action == "download_all_episodes":
|
||||||
from channels import downloads
|
from channels import downloads
|
||||||
item.action = item.extra
|
item.action = item.extra
|
||||||
del item.extra
|
del item.extra
|
||||||
downloads.save_download(item)
|
downloads.save_download(item)
|
||||||
|
|
||||||
# Special action for searching, first asks for the words then call the "search" function
|
# Special action for searching, first asks for the words then call the "search" function
|
||||||
elif item.action == "search":
|
elif item.action == "search":
|
||||||
logger.info("item.action=%s" % item.action.upper())
|
logger.info("item.action=%s" % item.action.upper())
|
||||||
|
|
||||||
last_search = ""
|
last_search = ""
|
||||||
last_search_active = config.get_setting("last_search", "search")
|
last_search_active = config.get_setting("last_search", "search")
|
||||||
if last_search_active:
|
if last_search_active:
|
||||||
try:
|
try:
|
||||||
current_saved_searches_list = list(config.get_setting("saved_searches_list", "search"))
|
current_saved_searches_list = list(config.get_setting("saved_searches_list", "search"))
|
||||||
last_search = current_saved_searches_list[0]
|
last_search = current_saved_searches_list[0]
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
tecleado = platformtools.dialog_input(last_search)
|
tecleado = platformtools.dialog_input(last_search)
|
||||||
if tecleado is not None:
|
if tecleado is not None:
|
||||||
if last_search_active and not tecleado.startswith("http"):
|
if last_search_active and not tecleado.startswith("http"):
|
||||||
from channels import search
|
from channels import search
|
||||||
search.save_search(tecleado)
|
search.save_search(tecleado)
|
||||||
|
|
||||||
itemlist = channel.search(item, tecleado)
|
itemlist = channel.search(item, tecleado)
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|
||||||
# For all other actions
|
# For all other actions
|
||||||
else:
|
else:
|
||||||
logger.info("Executing channel '%s' method" % item.action)
|
logger.info("Executing channel '%s' method" % item.action)
|
||||||
itemlist = getattr(channel, item.action)(item)
|
itemlist = getattr(channel, item.action)(item)
|
||||||
if config.get_setting('trakt_sync'):
|
if config.get_setting('trakt_sync'):
|
||||||
token_auth = config.get_setting("token_trakt", "trakt")
|
token_auth = config.get_setting("token_trakt", "trakt")
|
||||||
if not token_auth:
|
if not token_auth:
|
||||||
trakt_tools.auth_trakt()
|
trakt_tools.auth_trakt()
|
||||||
else:
|
else:
|
||||||
import xbmc
|
import xbmc
|
||||||
if not xbmc.getCondVisibility('System.HasAddon(script.trakt)') and config.get_setting(
|
if not xbmc.getCondVisibility('System.HasAddon(script.trakt)') and config.get_setting(
|
||||||
'install_trakt'):
|
'install_trakt'):
|
||||||
trakt_tools.ask_install_script()
|
trakt_tools.ask_install_script()
|
||||||
itemlist = trakt_tools.trakt_check(itemlist)
|
itemlist = trakt_tools.trakt_check(itemlist)
|
||||||
else:
|
else:
|
||||||
config.set_setting('install_trakt', True)
|
config.set_setting('install_trakt', True)
|
||||||
|
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|
||||||
except urllib2.URLError, e:
|
except urllib2.URLError, e:
|
||||||
import traceback
|
import traceback
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
# Grab inner and third party errors
|
# Grab inner and third party errors
|
||||||
if hasattr(e, 'reason'):
|
if hasattr(e, 'reason'):
|
||||||
logger.error("Razon del error, codigo: %s | Razon: %s" % (str(e.reason[0]), str(e.reason[1])))
|
logger.error("Razon del error, codigo: %s | Razon: %s" % (str(e.reason[0]), str(e.reason[1])))
|
||||||
texto = config.get_localized_string(30050) # "No se puede conectar con el sitio web"
|
texto = config.get_localized_string(30050) # "No se puede conectar con el sitio web"
|
||||||
platformtools.dialog_ok("alfa", texto)
|
platformtools.dialog_ok("alfa", texto)
|
||||||
|
|
||||||
# Grab server response errors
|
# Grab server response errors
|
||||||
elif hasattr(e, 'code'):
|
elif hasattr(e, 'code'):
|
||||||
logger.error("Codigo de error HTTP : %d" % e.code)
|
logger.error("Codigo de error HTTP : %d" % e.code)
|
||||||
# "El sitio web no funciona correctamente (error http %d)"
|
# "El sitio web no funciona correctamente (error http %d)"
|
||||||
platformtools.dialog_ok("alfa", config.get_localized_string(30051) % e.code)
|
platformtools.dialog_ok("alfa", config.get_localized_string(30051) % e.code)
|
||||||
except WebErrorException, e:
|
except WebErrorException, e:
|
||||||
import traceback
|
import traceback
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
patron = 'File "' + os.path.join(config.get_runtime_path(), "channels", "").replace("\\",
|
patron = 'File "' + os.path.join(config.get_runtime_path(), "channels", "").replace("\\",
|
||||||
"\\\\") + '([^.]+)\.py"'
|
"\\\\") + '([^.]+)\.py"'
|
||||||
canal = scrapertools.find_single_match(traceback.format_exc(), patron)
|
canal = scrapertools.find_single_match(traceback.format_exc(), patron)
|
||||||
|
|
||||||
platformtools.dialog_ok(
|
platformtools.dialog_ok(
|
||||||
config.get_localized_string(59985) + canal,
|
config.get_localized_string(59985) + canal,
|
||||||
config.get_localized_string(60013) %(e))
|
config.get_localized_string(60013) %(e))
|
||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
patron = 'File "' + os.path.join(config.get_runtime_path(), "channels", "").replace("\\",
|
patron = 'File "' + os.path.join(config.get_runtime_path(), "channels", "").replace("\\",
|
||||||
"\\\\") + '([^.]+)\.py"'
|
"\\\\") + '([^.]+)\.py"'
|
||||||
canal = scrapertools.find_single_match(traceback.format_exc(), patron)
|
canal = scrapertools.find_single_match(traceback.format_exc(), patron)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import xbmc
|
import xbmc
|
||||||
if config.get_platform(True)['num_version'] < 14:
|
if config.get_platform(True)['num_version'] < 14:
|
||||||
log_name = "xbmc.log"
|
log_name = "xbmc.log"
|
||||||
else:
|
else:
|
||||||
log_name = "kodi.log"
|
log_name = "kodi.log"
|
||||||
log_message = config.get_localized_string(50004) + xbmc.translatePath("special://logpath") + log_name
|
log_message = config.get_localized_string(50004) + xbmc.translatePath("special://logpath") + log_name
|
||||||
except:
|
except:
|
||||||
log_message = ""
|
log_message = ""
|
||||||
|
|
||||||
if canal:
|
if canal:
|
||||||
platformtools.dialog_ok(
|
platformtools.dialog_ok(
|
||||||
config.get_localized_string(60087) %canal,
|
config.get_localized_string(60087) %canal,
|
||||||
config.get_localized_string(60014),
|
config.get_localized_string(60014),
|
||||||
log_message)
|
log_message)
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok(
|
platformtools.dialog_ok(
|
||||||
config.get_localized_string(60038),
|
config.get_localized_string(60038),
|
||||||
config.get_localized_string(60015),
|
config.get_localized_string(60015),
|
||||||
log_message)
|
log_message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def reorder_itemlist(itemlist):
|
def reorder_itemlist(itemlist):
|
||||||
logger.info()
|
logger.info()
|
||||||
# logger.debug("Inlet itemlist size: %i" % len(itemlist))
|
# logger.debug("Inlet itemlist size: %i" % len(itemlist))
|
||||||
|
|
||||||
new_list = []
|
new_list = []
|
||||||
mod_list = []
|
mod_list = []
|
||||||
not_mod_list = []
|
not_mod_list = []
|
||||||
|
|
||||||
modified = 0
|
modified = 0
|
||||||
not_modified = 0
|
not_modified = 0
|
||||||
|
|
||||||
to_change = [[config.get_localized_string(60335), '[V]'],
|
to_change = [[config.get_localized_string(60335), '[V]'],
|
||||||
[config.get_localized_string(60336), '[D]']]
|
[config.get_localized_string(60336), '[D]']]
|
||||||
|
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
old_title = unicode(item.title, "utf8").lower().encode("utf8")
|
old_title = unicode(item.title, "utf8").lower().encode("utf8")
|
||||||
for before, after in to_change:
|
for before, after in to_change:
|
||||||
if before in item.title:
|
if before in item.title:
|
||||||
item.title = item.title.replace(before, after)
|
item.title = item.title.replace(before, after)
|
||||||
break
|
break
|
||||||
|
|
||||||
new_title = unicode(item.title, "utf8").lower().encode("utf8")
|
new_title = unicode(item.title, "utf8").lower().encode("utf8")
|
||||||
if old_title != new_title:
|
if old_title != new_title:
|
||||||
mod_list.append(item)
|
mod_list.append(item)
|
||||||
modified += 1
|
modified += 1
|
||||||
else:
|
else:
|
||||||
not_mod_list.append(item)
|
not_mod_list.append(item)
|
||||||
not_modified += 1
|
not_modified += 1
|
||||||
|
|
||||||
# logger.debug("OLD: %s | NEW: %s" % (old_title, new_title))
|
# logger.debug("OLD: %s | NEW: %s" % (old_title, new_title))
|
||||||
|
|
||||||
new_list.extend(mod_list)
|
new_list.extend(mod_list)
|
||||||
new_list.extend(not_mod_list)
|
new_list.extend(not_mod_list)
|
||||||
|
|
||||||
logger.info("Titulos modificados:%i | No modificados:%i" % (modified, not_modified))
|
logger.info("Titulos modificados:%i | No modificados:%i" % (modified, not_modified))
|
||||||
|
|
||||||
if len(new_list) == 0:
|
if len(new_list) == 0:
|
||||||
new_list = itemlist
|
new_list = itemlist
|
||||||
|
|
||||||
# logger.debug("Outlet itemlist size: %i" % len(new_list))
|
# logger.debug("Outlet itemlist size: %i" % len(new_list))
|
||||||
return new_list
|
return new_list
|
||||||
|
|
||||||
|
|
||||||
def limit_itemlist(itemlist):
|
def limit_itemlist(itemlist):
|
||||||
logger.info()
|
logger.info()
|
||||||
# logger.debug("Inlet itemlist size: %i" % len(itemlist))
|
# logger.debug("Inlet itemlist size: %i" % len(itemlist))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
opt = config.get_setting("max_links", "videolibrary")
|
opt = config.get_setting("max_links", "videolibrary")
|
||||||
if opt == 0:
|
if opt == 0:
|
||||||
new_list = itemlist
|
new_list = itemlist
|
||||||
else:
|
else:
|
||||||
i_max = 30 * opt
|
i_max = 30 * opt
|
||||||
new_list = itemlist[:i_max]
|
new_list = itemlist[:i_max]
|
||||||
|
|
||||||
# logger.debug("Outlet itemlist size: %i" % len(new_list))
|
# logger.debug("Outlet itemlist size: %i" % len(new_list))
|
||||||
return new_list
|
return new_list
|
||||||
except:
|
except:
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def play_from_library(item):
|
def play_from_library(item):
|
||||||
"""
|
"""
|
||||||
Los .strm al reproducirlos desde kodi, este espera que sea un archivo "reproducible" asi que no puede contener
|
Los .strm al reproducirlos desde kodi, este espera que sea un archivo "reproducible" asi que no puede contener
|
||||||
más items, como mucho se puede colocar un dialogo de seleccion.
|
más items, como mucho se puede colocar un dialogo de seleccion.
|
||||||
Esto lo solucionamos "engañando a kodi" y haciendole creer que se ha reproducido algo, asi despues mediante
|
Esto lo solucionamos "engañando a kodi" y haciendole creer que se ha reproducido algo, asi despues mediante
|
||||||
"Container.Update()" cargamos el strm como si un item desde dentro del addon se tratara, quitando todas
|
"Container.Update()" cargamos el strm como si un item desde dentro del addon se tratara, quitando todas
|
||||||
las limitaciones y permitiendo reproducir mediante la funcion general sin tener que crear nuevos métodos para
|
las limitaciones y permitiendo reproducir mediante la funcion general sin tener que crear nuevos métodos para
|
||||||
la videoteca.
|
la videoteca.
|
||||||
@type item: item
|
@type item: item
|
||||||
@param item: elemento con información
|
@param item: elemento con información
|
||||||
"""
|
"""
|
||||||
logger.info()
|
logger.info()
|
||||||
#logger.debug("item: \n" + item.tostring('\n'))
|
#logger.debug("item: \n" + item.tostring('\n'))
|
||||||
|
|
||||||
import xbmcgui
|
import xbmcgui
|
||||||
import xbmcplugin
|
import xbmcplugin
|
||||||
import xbmc
|
import xbmc
|
||||||
# Intentamos reproducir una imagen (esto no hace nada y ademas no da error)
|
from time import sleep
|
||||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True,
|
|
||||||
xbmcgui.ListItem(
|
# Intentamos reproducir una imagen (esto no hace nada y ademas no da error)
|
||||||
path=os.path.join(config.get_runtime_path(), "resources", "subtitle.mp4")))
|
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True,
|
||||||
|
xbmcgui.ListItem(
|
||||||
# Por si acaso la imagen hiciera (en futuras versiones) le damos a stop para detener la reproduccion
|
path=os.path.join(config.get_runtime_path(), "resources", "subtitle.mp4")))
|
||||||
xbmc.Player().stop()
|
|
||||||
|
# Por si acaso la imagen hiciera (en futuras versiones) le damos a stop para detener la reproduccion
|
||||||
# modificamos el action (actualmente la videoteca necesita "findvideos" ya que es donde se buscan las fuentes
|
sleep(0.5) ### Si no se pone esto se bloquea Kodi
|
||||||
item.action = "findvideos"
|
xbmc.Player().stop()
|
||||||
|
|
||||||
window_type = config.get_setting("window_type", "videolibrary")
|
# modificamos el action (actualmente la videoteca necesita "findvideos" ya que es donde se buscan las fuentes
|
||||||
|
item.action = "findvideos"
|
||||||
# y volvemos a lanzar kodi
|
|
||||||
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
|
window_type = config.get_setting("window_type", "videolibrary")
|
||||||
# Ventana convencional
|
|
||||||
xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")")
|
# y volvemos a lanzar kodi
|
||||||
|
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
|
||||||
else:
|
# Ventana convencional
|
||||||
# Ventana emergente
|
xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")")
|
||||||
from channels import videolibrary
|
|
||||||
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(70004))
|
else:
|
||||||
p_dialog.update(0, '')
|
# Ventana emergente
|
||||||
|
from channels import videolibrary
|
||||||
itemlist = videolibrary.findvideos(item)
|
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(70004))
|
||||||
|
p_dialog.update(0, '')
|
||||||
|
|
||||||
while platformtools.is_playing():
|
itemlist = videolibrary.findvideos(item)
|
||||||
# Ventana convencional
|
|
||||||
from time import sleep
|
|
||||||
sleep(5)
|
while platformtools.is_playing():
|
||||||
p_dialog.update(50, '')
|
# Ventana convencional
|
||||||
|
sleep(5)
|
||||||
'''# Se filtran los enlaces segun la lista negra
|
p_dialog.update(50, '')
|
||||||
if config.get_setting('filter_servers', "servers"):
|
|
||||||
itemlist = servertools.filter_servers(itemlist)'''
|
'''# Se filtran los enlaces segun la lista negra
|
||||||
|
if config.get_setting('filter_servers', "servers"):
|
||||||
# Se limita la cantidad de enlaces a mostrar
|
itemlist = servertools.filter_servers(itemlist)'''
|
||||||
if config.get_setting("max_links", "videolibrary") != 0:
|
|
||||||
itemlist = limit_itemlist(itemlist)
|
# Se limita la cantidad de enlaces a mostrar
|
||||||
|
if config.get_setting("max_links", "videolibrary") != 0:
|
||||||
# Se "limpia" ligeramente la lista de enlaces
|
itemlist = limit_itemlist(itemlist)
|
||||||
if config.get_setting("replace_VD", "videolibrary") == 1:
|
|
||||||
itemlist = reorder_itemlist(itemlist)
|
# Se "limpia" ligeramente la lista de enlaces
|
||||||
|
if config.get_setting("replace_VD", "videolibrary") == 1:
|
||||||
|
itemlist = reorder_itemlist(itemlist)
|
||||||
import time
|
|
||||||
p_dialog.update(100, '')
|
|
||||||
time.sleep(0.5)
|
import time
|
||||||
p_dialog.close()
|
p_dialog.update(100, '')
|
||||||
|
time.sleep(0.5)
|
||||||
|
p_dialog.close()
|
||||||
if len(itemlist) > 0:
|
|
||||||
while not xbmc.Monitor().abortRequested():
|
|
||||||
# El usuario elige el mirror
|
if len(itemlist) > 0:
|
||||||
opciones = []
|
while not xbmc.Monitor().abortRequested():
|
||||||
for item in itemlist:
|
# El usuario elige el mirror
|
||||||
opciones.append(item.title)
|
opciones = []
|
||||||
|
for item in itemlist:
|
||||||
# Se abre la ventana de seleccion
|
opciones.append(item.title)
|
||||||
if (item.contentSerieName != "" and
|
|
||||||
item.contentSeason != "" and
|
# Se abre la ventana de seleccion
|
||||||
item.contentEpisodeNumber != ""):
|
if (item.contentSerieName != "" and
|
||||||
cabecera = ("%s - %sx%s -- %s" %
|
item.contentSeason != "" and
|
||||||
(item.contentSerieName,
|
item.contentEpisodeNumber != ""):
|
||||||
item.contentSeason,
|
cabecera = ("%s - %sx%s -- %s" %
|
||||||
item.contentEpisodeNumber,
|
(item.contentSerieName,
|
||||||
config.get_localized_string(30163)))
|
item.contentSeason,
|
||||||
else:
|
item.contentEpisodeNumber,
|
||||||
cabecera = config.get_localized_string(30163)
|
config.get_localized_string(30163)))
|
||||||
|
else:
|
||||||
seleccion = platformtools.dialog_select(cabecera, opciones)
|
cabecera = config.get_localized_string(30163)
|
||||||
|
|
||||||
if seleccion == -1:
|
seleccion = platformtools.dialog_select(cabecera, opciones)
|
||||||
return
|
|
||||||
else:
|
if seleccion == -1:
|
||||||
item = videolibrary.play(itemlist[seleccion])[0]
|
return
|
||||||
platformtools.play_video(item)
|
else:
|
||||||
|
item = videolibrary.play(itemlist[seleccion])[0]
|
||||||
from channels import autoplay
|
platformtools.play_video(item)
|
||||||
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel):
|
|
||||||
break
|
from channels import autoplay
|
||||||
|
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel):
|
||||||
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user