Merge branch 'master' into Fixes
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
Debe ejecutar primero el archivo "script.py".
|
||||||
|
Una vez realizado el proceso podrá ejecutar como siempre "alfa.py" para iniciar el addon.
|
||||||
+9
-10
@@ -22,7 +22,7 @@ websocket_port = config.get_setting("websocket.port")
|
|||||||
myip = config.get_local_ip()
|
myip = config.get_local_ip()
|
||||||
|
|
||||||
|
|
||||||
def ThreadNameWrap(func):
|
def thread_name_wrap(func):
|
||||||
@wraps(func)
|
@wraps(func)
|
||||||
def bar(*args, **kw):
|
def bar(*args, **kw):
|
||||||
if "name" not in kw:
|
if "name" not in kw:
|
||||||
@@ -32,7 +32,7 @@ def ThreadNameWrap(func):
|
|||||||
return bar
|
return bar
|
||||||
|
|
||||||
|
|
||||||
threading.Thread.__init__ = ThreadNameWrap(threading.Thread.__init__)
|
threading.Thread.__init__ = thread_name_wrap(threading.Thread.__init__)
|
||||||
|
|
||||||
if sys.version_info < (2, 7, 11):
|
if sys.version_info < (2, 7, 11):
|
||||||
import ssl
|
import ssl
|
||||||
@@ -40,7 +40,7 @@ if sys.version_info < (2, 7, 11):
|
|||||||
ssl._create_default_https_context = ssl._create_unverified_context
|
ssl._create_default_https_context = ssl._create_unverified_context
|
||||||
|
|
||||||
|
|
||||||
def MostrarInfo():
|
def show_info():
|
||||||
os.system('cls' if os.name == 'nt' else 'clear')
|
os.system('cls' if os.name == 'nt' else 'clear')
|
||||||
print ("--------------------------------------------------------------------")
|
print ("--------------------------------------------------------------------")
|
||||||
print ("Alfa Iniciado")
|
print ("Alfa Iniciado")
|
||||||
@@ -54,7 +54,6 @@ def MostrarInfo():
|
|||||||
print ("Bookmark Path : " + config.get_setting("bookmarkpath"))
|
print ("Bookmark Path : " + config.get_setting("bookmarkpath"))
|
||||||
print ("Videolibrary Path : " + config.get_setting("videolibrarypath"))
|
print ("Videolibrary Path : " + config.get_setting("videolibrarypath"))
|
||||||
print ("--------------------------------------------------------------------")
|
print ("--------------------------------------------------------------------")
|
||||||
conexiones = []
|
|
||||||
controllers = platformtools.controllers
|
controllers = platformtools.controllers
|
||||||
for a in controllers:
|
for a in controllers:
|
||||||
try:
|
try:
|
||||||
@@ -68,8 +67,8 @@ def start():
|
|||||||
logger.info("server init...")
|
logger.info("server init...")
|
||||||
config.verify_directories_created()
|
config.verify_directories_created()
|
||||||
try:
|
try:
|
||||||
HTTPServer.start(MostrarInfo)
|
HTTPServer.start(show_info)
|
||||||
WebSocket.start(MostrarInfo)
|
WebSocket.start(show_info)
|
||||||
|
|
||||||
# Da por levantado el servicio
|
# Da por levantado el servicio
|
||||||
logger.info("--------------------------------------------------------------------")
|
logger.info("--------------------------------------------------------------------")
|
||||||
@@ -84,10 +83,10 @@ def start():
|
|||||||
logger.info("Bookmark Path : " + config.get_setting("bookmarkpath"))
|
logger.info("Bookmark Path : " + config.get_setting("bookmarkpath"))
|
||||||
logger.info("VideoLibrary Path : " + config.get_setting("videolibrarypath"))
|
logger.info("VideoLibrary Path : " + config.get_setting("videolibrarypath"))
|
||||||
logger.info("--------------------------------------------------------------------")
|
logger.info("--------------------------------------------------------------------")
|
||||||
MostrarInfo()
|
show_info()
|
||||||
|
|
||||||
start = True
|
flag = True
|
||||||
while start:
|
while flag:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
@@ -96,7 +95,7 @@ def start():
|
|||||||
print 'Deteniendo el servidor WebSocket...'
|
print 'Deteniendo el servidor WebSocket...'
|
||||||
WebSocket.stop()
|
WebSocket.stop()
|
||||||
print 'Alfa Detenido'
|
print 'Alfa Detenido'
|
||||||
start = False
|
flag = False
|
||||||
|
|
||||||
|
|
||||||
# Inicia el programa
|
# Inicia el programa
|
||||||
|
|||||||
@@ -5,13 +5,12 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import threading
|
import sys
|
||||||
|
|
||||||
PLATFORM_NAME = "mediaserver"
|
PLATFORM_NAME = "mediaserver"
|
||||||
PLUGIN_NAME = "alfa"
|
PLUGIN_NAME = "alfa"
|
||||||
|
|
||||||
settings_dic = {}
|
settings_dic = {}
|
||||||
settings_types = {}
|
|
||||||
adult_setting = {}
|
adult_setting = {}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,14 +51,14 @@ def get_system_platform():
|
|||||||
|
|
||||||
|
|
||||||
def open_settings():
|
def open_settings():
|
||||||
Opciones = []
|
options = []
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
settings = open(menufilepath, 'rb').read()
|
settings = open(menufilepath, 'rb').read()
|
||||||
xmldoc = minidom.parseString(settings)
|
xmldoc = minidom.parseString(settings)
|
||||||
for category in xmldoc.getElementsByTagName("category"):
|
for category in xmldoc.getElementsByTagName("category"):
|
||||||
for setting in category.getElementsByTagName("setting"):
|
for setting in category.getElementsByTagName("setting"):
|
||||||
Opciones.append(dict(setting.attributes.items() + [(u"category", category.getAttribute("label")),
|
options.append(dict(setting.attributes.items() + [(u"category", category.getAttribute("label")),
|
||||||
(u"value", get_setting(setting.getAttribute("id")))]))
|
(u"value", get_setting(setting.getAttribute("id")))]))
|
||||||
|
|
||||||
from platformcode import platformtools
|
from platformcode import platformtools
|
||||||
global adult_setting
|
global adult_setting
|
||||||
@@ -69,7 +68,7 @@ def open_settings():
|
|||||||
adult_mode = get_setting('adult_mode')
|
adult_mode = get_setting('adult_mode')
|
||||||
adult_request_password = get_setting('adult_request_password')
|
adult_request_password = get_setting('adult_request_password')
|
||||||
|
|
||||||
platformtools.open_settings(Opciones)
|
platformtools.open_settings(options)
|
||||||
|
|
||||||
# Hemos accedido a la seccion de Canales para adultos
|
# Hemos accedido a la seccion de Canales para adultos
|
||||||
if get_setting('adult_aux_intro_password'):
|
if get_setting('adult_aux_intro_password'):
|
||||||
@@ -82,22 +81,8 @@ def open_settings():
|
|||||||
set_setting('adult_password', get_setting('adult_aux_new_password1'))
|
set_setting('adult_password', get_setting('adult_aux_new_password1'))
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok("Canales para adultos",
|
platformtools.dialog_ok("Canales para adultos",
|
||||||
"Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden.",
|
"Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden."
|
||||||
"Entre de nuevo en 'Preferencias' para cambiar la contraseña")
|
, "Entre de nuevo en 'Preferencias' para cambiar la contraseña")
|
||||||
|
|
||||||
# Fijar adult_pin
|
|
||||||
adult_pin = ""
|
|
||||||
if get_setting("adult_request_password") == True:
|
|
||||||
adult_pin = get_setting("adult_password")
|
|
||||||
set_setting("adult_pin", adult_pin)
|
|
||||||
|
|
||||||
# Solo esta sesion:
|
|
||||||
id = threading.current_thread().name
|
|
||||||
if get_setting("adult_mode") == 2:
|
|
||||||
adult_setting[id] = True
|
|
||||||
set_setting("adult_mode", "0")
|
|
||||||
else:
|
|
||||||
adult_setting = {}
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok("Canales para adultos", "La contraseña no es correcta.",
|
platformtools.dialog_ok("Canales para adultos", "La contraseña no es correcta.",
|
||||||
@@ -112,24 +97,30 @@ def open_settings():
|
|||||||
set_setting('adult_aux_new_password2', '')
|
set_setting('adult_aux_new_password2', '')
|
||||||
|
|
||||||
|
|
||||||
def get_setting(name, channel="", server=""):
|
def get_setting(name, channel="", server="", default=None):
|
||||||
"""
|
"""
|
||||||
Retorna el valor de configuracion del parametro solicitado.
|
Retorna el valor de configuracion del parametro solicitado.
|
||||||
|
|
||||||
Devuelve el valor del parametro 'name' en la configuracion global o en la configuracion propia del canal 'channel'.
|
Devuelve el valor del parametro 'name' en la configuracion global, en la configuracion propia del canal 'channel'
|
||||||
|
o en la del servidor 'server'.
|
||||||
|
|
||||||
Si se especifica el nombre del canal busca en la ruta \addon_data\plugin.video.alfa\settings_channels el
|
Los parametros channel y server no deben usarse simultaneamente. Si se especifica el nombre del canal se devolvera
|
||||||
archivo channel_data.json y lee el valor del parametro 'name'. Si el archivo channel_data.json no existe busca en la
|
el resultado de llamar a channeltools.get_channel_setting(name, channel, default). Si se especifica el nombre del
|
||||||
carpeta channels el archivo channel.xml y crea un archivo channel_data.json antes de retornar el valor solicitado.
|
servidor se devolvera el resultado de llamar a servertools.get_channel_setting(name, server, default). Si no se
|
||||||
Si el parametro 'name' no existe en channel_data.json lo busca en la configuracion global y si ahi tampoco existe
|
especifica ninguno de los anteriores se devolvera el valor del parametro en la configuracion global si existe o
|
||||||
devuelve un str vacio.
|
el valor default en caso contrario.
|
||||||
|
|
||||||
Parametros:
|
@param name: nombre del parametro
|
||||||
name -- nombre del parametro
|
@type name: str
|
||||||
channel [opcional] -- nombre del canal
|
@param channel: nombre del canal
|
||||||
|
@type channel: str
|
||||||
|
@param server: nombre del servidor
|
||||||
|
@type server: str
|
||||||
|
@param default: valor devuelto en caso de que no exista el parametro name
|
||||||
|
@type default: any
|
||||||
|
|
||||||
Retorna:
|
@return: El valor del parametro 'name'
|
||||||
value -- El valor del parametro 'name'
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -138,7 +129,7 @@ def get_setting(name, channel="", server=""):
|
|||||||
|
|
||||||
# logger.info("config.get_setting reading channel setting '"+name+"' from channel json")
|
# logger.info("config.get_setting reading channel setting '"+name+"' from channel json")
|
||||||
from core import channeltools
|
from core import channeltools
|
||||||
value = channeltools.get_channel_setting(name, channel)
|
value = channeltools.get_channel_setting(name, channel, default)
|
||||||
# logger.info("config.get_setting -> '"+repr(value)+"'")
|
# logger.info("config.get_setting -> '"+repr(value)+"'")
|
||||||
|
|
||||||
return value
|
return value
|
||||||
@@ -146,7 +137,7 @@ def get_setting(name, channel="", server=""):
|
|||||||
elif server:
|
elif server:
|
||||||
# logger.info("config.get_setting reading server setting '"+name+"' from server json")
|
# logger.info("config.get_setting reading server setting '"+name+"' from server json")
|
||||||
from core import servertools
|
from core import servertools
|
||||||
value = servertools.get_server_setting(name, server)
|
value = servertools.get_server_setting(name, server, default)
|
||||||
# logger.info("config.get_setting -> '"+repr(value)+"'")
|
# logger.info("config.get_setting -> '"+repr(value)+"'")
|
||||||
|
|
||||||
return value
|
return value
|
||||||
@@ -155,31 +146,28 @@ def get_setting(name, channel="", server=""):
|
|||||||
else:
|
else:
|
||||||
# logger.info("config.get_setting reading main setting '"+name+"'")
|
# logger.info("config.get_setting reading main setting '"+name+"'")
|
||||||
global settings_dic
|
global settings_dic
|
||||||
value = settings_dic.get(name, "")
|
value = settings_dic.get(name, default)
|
||||||
|
if value == default:
|
||||||
if name == "adult_mode":
|
return value
|
||||||
global adult_setting
|
|
||||||
id = threading.current_thread().name
|
|
||||||
if adult_setting.get(id) == True:
|
|
||||||
value = "2"
|
|
||||||
|
|
||||||
|
# logger.info("config.get_setting -> '"+value+"'")
|
||||||
# hack para devolver el tipo correspondiente
|
# hack para devolver el tipo correspondiente
|
||||||
global settings_types
|
if value == "true":
|
||||||
|
return True
|
||||||
|
elif value == "false":
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
# special case return as str
|
||||||
|
if name in ["adult_password", "adult_aux_intro_password", "adult_aux_new_password1",
|
||||||
|
"adult_aux_new_password2"]:
|
||||||
|
return value
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
value = int(value)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
if settings_types.get(name) in ['enum', 'number']:
|
return value
|
||||||
value = int(value)
|
|
||||||
|
|
||||||
elif settings_types.get(name) == 'bool':
|
|
||||||
value = value == 'true'
|
|
||||||
|
|
||||||
elif not settings_types.has_key(name):
|
|
||||||
try:
|
|
||||||
t = eval(value)
|
|
||||||
value = t[0](t[1])
|
|
||||||
except:
|
|
||||||
value = None
|
|
||||||
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def set_setting(name, value, channel="", server=""):
|
def set_setting(name, value, channel="", server=""):
|
||||||
@@ -214,25 +202,16 @@ def set_setting(name, value, channel="", server=""):
|
|||||||
return servertools.set_server_setting(name, value, server)
|
return servertools.set_server_setting(name, value, server)
|
||||||
else:
|
else:
|
||||||
global settings_dic
|
global settings_dic
|
||||||
global settings_types
|
|
||||||
|
|
||||||
if settings_types.get(name) == 'bool':
|
if isinstance(value, bool):
|
||||||
if value:
|
if value:
|
||||||
new_value = "true"
|
value = "true"
|
||||||
else:
|
else:
|
||||||
new_value = "false"
|
value = "false"
|
||||||
|
elif isinstance(value, (int, long)):
|
||||||
elif settings_types.get(name):
|
value = str(value)
|
||||||
new_value = str(value)
|
|
||||||
|
|
||||||
else:
|
|
||||||
if isinstance(value, basestring):
|
|
||||||
new_value = "(%s, %s)" % (type(value).__name__, repr(value))
|
|
||||||
else:
|
|
||||||
new_value = "(%s, %s)" % (type(value).__name__, value)
|
|
||||||
|
|
||||||
settings_dic[name] = new_value
|
|
||||||
|
|
||||||
|
settings_dic[name] = value
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
# Crea un Nuevo XML vacio
|
# Crea un Nuevo XML vacio
|
||||||
new_settings = minidom.getDOMImplementation().createDocument(None, "settings", None)
|
new_settings = minidom.getDOMImplementation().createDocument(None, "settings", None)
|
||||||
@@ -339,11 +318,9 @@ def get_local_ip():
|
|||||||
|
|
||||||
def load_settings():
|
def load_settings():
|
||||||
global settings_dic
|
global settings_dic
|
||||||
global settings_types
|
|
||||||
defaults = {}
|
defaults = {}
|
||||||
from xml.etree import ElementTree
|
from xml.etree import ElementTree
|
||||||
|
|
||||||
encontrado = False
|
|
||||||
# Lee el archivo XML (si existe)
|
# Lee el archivo XML (si existe)
|
||||||
if os.path.exists(configfilepath):
|
if os.path.exists(configfilepath):
|
||||||
settings = open(configfilepath, 'rb').read()
|
settings = open(configfilepath, 'rb').read()
|
||||||
@@ -357,10 +334,9 @@ def load_settings():
|
|||||||
for target in category.findall("setting"):
|
for target in category.findall("setting"):
|
||||||
if target.get("id"):
|
if target.get("id"):
|
||||||
defaults[target.get("id")] = target.get("default")
|
defaults[target.get("id")] = target.get("default")
|
||||||
settings_types[target.get("id")] = target.get("type")
|
|
||||||
|
|
||||||
for key in defaults:
|
for key in defaults:
|
||||||
if not key in settings_dic:
|
if key not in settings_dic:
|
||||||
settings_dic[key] = defaults[key]
|
settings_dic[key] = defaults[key]
|
||||||
set_settings(settings_dic)
|
set_settings(settings_dic)
|
||||||
|
|
||||||
@@ -387,7 +363,14 @@ def set_settings(JsonRespuesta):
|
|||||||
# Fichero de configuración
|
# Fichero de configuración
|
||||||
menufilepath = os.path.join(get_runtime_path(), "resources", "settings.xml")
|
menufilepath = os.path.join(get_runtime_path(), "resources", "settings.xml")
|
||||||
configfilepath = os.path.join(get_data_path(), "settings.xml")
|
configfilepath = os.path.join(get_data_path(), "settings.xml")
|
||||||
if not os.path.exists(get_data_path()): os.mkdir(get_data_path())
|
if not os.path.exists(get_data_path()):
|
||||||
|
os.mkdir(get_data_path())
|
||||||
# Literales
|
# Literales
|
||||||
TRANSLATION_FILE_PATH = os.path.join(get_runtime_path(), "resources", "language", "Spanish", "strings.xml")
|
TRANSLATION_FILE_PATH = os.path.join(get_runtime_path(), "resources", "language", "Spanish", "strings.xml")
|
||||||
load_settings()
|
load_settings()
|
||||||
|
|
||||||
|
# modo adulto:
|
||||||
|
# sistema actual 0: Nunca, 1:Siempre, 2:Solo hasta que se reinicie sesión
|
||||||
|
# si es == 2 lo desactivamos.
|
||||||
|
if get_setting("adult_mode") == 2:
|
||||||
|
set_setting("adult_mode", 0)
|
||||||
|
|||||||
@@ -29,19 +29,20 @@ def start():
|
|||||||
def run(item):
|
def run(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
# Muestra el item en el log:
|
# Muestra el item en el log:
|
||||||
PrintItems(item)
|
print_items(item)
|
||||||
|
|
||||||
# Control Parental, comprueba si es adulto o no
|
# Control Parental, comprueba si es adulto o no
|
||||||
if item.action == "mainlist":
|
if item.action == "mainlist":
|
||||||
# Parental control
|
# Parental control
|
||||||
if channeltools.is_adult(item.channel) and config.get_setting("adult_pin") != "":
|
if channeltools.is_adult(item.channel) and config.get_setting("adult_request_password"):
|
||||||
tecleado = platformtools.dialog_input("", "Contraseña para canales de adultos", True)
|
tecleado = platformtools.dialog_input("", "Contraseña para canales de adultos", True)
|
||||||
if tecleado is None or tecleado != config.get_setting("adult_pin"):
|
if tecleado is None or tecleado != config.get_setting("adult_password"):
|
||||||
platformtools.render_items(None, item)
|
platformtools.render_items(None, item)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Importa el canal para el item, todo item debe tener un canal, sino sale de la función
|
# Importa el canal para el item, todo item debe tener un canal, sino sale de la función
|
||||||
if item.channel: channelmodule = ImportarCanal(item)
|
if item.channel:
|
||||||
|
channelmodule = import_channel(item)
|
||||||
|
|
||||||
# If item has no action, stops here
|
# If item has no action, stops here
|
||||||
if item.action == "":
|
if item.action == "":
|
||||||
@@ -153,13 +154,13 @@ def run(item):
|
|||||||
itemlist = [Item(title="No hay elementos para mostrar", thumbnail=get_thumb("error.png"))]
|
itemlist = [Item(title="No hay elementos para mostrar", thumbnail=get_thumb("error.png"))]
|
||||||
|
|
||||||
# Imprime en el log el resultado
|
# Imprime en el log el resultado
|
||||||
PrintItems(itemlist)
|
print_items(itemlist)
|
||||||
|
|
||||||
# Muestra los resultados en pantalla
|
# Muestra los resultados en pantalla
|
||||||
platformtools.render_items(itemlist, item)
|
platformtools.render_items(itemlist, item)
|
||||||
|
|
||||||
|
|
||||||
def ImportarCanal(item):
|
def import_channel(item):
|
||||||
channel = item.channel
|
channel = item.channel
|
||||||
channelmodule = ""
|
channelmodule = ""
|
||||||
if os.path.exists(os.path.join(config.get_runtime_path(), "channels", channel + ".py")):
|
if os.path.exists(os.path.join(config.get_runtime_path(), "channels", channel + ".py")):
|
||||||
@@ -171,7 +172,7 @@ def ImportarCanal(item):
|
|||||||
return channelmodule
|
return channelmodule
|
||||||
|
|
||||||
|
|
||||||
def PrintItems(itemlist):
|
def print_items(itemlist):
|
||||||
if type(itemlist) == list:
|
if type(itemlist) == list:
|
||||||
if len(itemlist) > 0:
|
if len(itemlist) > 0:
|
||||||
logger.info("Items devueltos")
|
logger.info("Items devueltos")
|
||||||
@@ -197,13 +198,13 @@ def add_pelicula_to_library(item):
|
|||||||
|
|
||||||
|
|
||||||
def add_serie_to_library(item):
|
def add_serie_to_library(item):
|
||||||
channel = ImportarCanal(item)
|
channel = import_channel(item)
|
||||||
videolibrarytools.add_tvshow(item, channel)
|
videolibrarytools.add_tvshow(item, channel)
|
||||||
|
|
||||||
|
|
||||||
def download_all_episodes(item, first_episode="", preferred_server="vidspot", filter_language=""):
|
def download_all_episodes(item, first_episode="", preferred_server="vidspot", filter_language=""):
|
||||||
logger.info("show=" + item.show)
|
logger.info("show=" + item.show)
|
||||||
channel = ImportarCanal(item)
|
channel = import_channel(item)
|
||||||
show_title = item.show
|
show_title = item.show
|
||||||
|
|
||||||
# Obtiene el listado desde el que se llamó
|
# Obtiene el listado desde el que se llamó
|
||||||
|
|||||||
@@ -16,15 +16,14 @@
|
|||||||
<setting id="server_stats" type="bool" label="Enviar estadisticas sobre el uso de servidores" default="true"/>
|
<setting id="server_stats" type="bool" label="Enviar estadisticas sobre el uso de servidores" default="true"/>
|
||||||
<setting type="sep"/>
|
<setting type="sep"/>
|
||||||
<setting label="Canales para adultos" type="lsep"/>
|
<setting label="Canales para adultos" type="lsep"/>
|
||||||
<setting id="adult_aux_intro_password" type="text" label="Contraseña:" option="hidden" default=""/>
|
<setting id="adult_aux_intro_password" type="text" label="Contraseña (por defecto 0000):" option="hidden" default=""/>
|
||||||
<setting id="adult_mode" type="enum" values="Nunca|Siempre|Solo para esta sesión" label="30002" enable="!eq(-1,)" default="0"/>
|
<setting id="adult_mode" type="enum" values="Nunca|Siempre|Solo para esta sesión" label="30002" enable="!eq(-1,)" default="0"/>
|
||||||
<setting id="adult_request_password" type="bool" label="Solicitar contraseña para abrir canal de adultos" enable="!eq(-1,0)+!eq(-2,)" default="true"/>
|
<setting id="adult_request_password" type="bool" label="Solicitar contraseña para abrir canales de adultos" enable="!eq(-1,0)+!eq(-2,)" default="true"/>
|
||||||
<setting id="adult_aux_new_password1" type="text" label="Nueva contraseña:" option="hidden" enable="!eq(-3,)" default=""/>
|
<setting id="adult_aux_new_password1" type="text" label="Nueva contraseña:" option="hidden" enable="!eq(-3,)" default=""/>
|
||||||
<setting id="adult_aux_new_password2" type="text" label="Confirmar nueva contraseña:" option="hidden" enable="!eq(-1,)" default=""/>
|
<setting id="adult_aux_new_password2" type="text" label="Confirmar nueva contraseña:" option="hidden" enable="!eq(-1,)" default=""/>
|
||||||
|
|
||||||
<!--<setting type="sep"/>-->
|
<!--<setting type="sep"/>-->
|
||||||
<!--<setting label="Actualizaciones" type="lsep"/>-->
|
<!--<setting label="Actualizaciones" type="lsep"/>-->
|
||||||
|
|
||||||
<!--<setting id="plugin_updates_available" type="number" label="Number of updates available" default="0" visible="false"/>-->
|
<!--<setting id="plugin_updates_available" type="number" label="Number of updates available" default="0" visible="false"/>-->
|
||||||
<!--<setting id="check_for_plugin_updates" type="bool" label="30001" default="true"/>-->
|
<!--<setting id="check_for_plugin_updates" type="bool" label="30001" default="true"/>-->
|
||||||
<!--<setting id="check_for_channel_updates" type="bool" label="30004" default="true"/>-->
|
<!--<setting id="check_for_channel_updates" type="bool" label="30004" default="true"/>-->
|
||||||
@@ -32,20 +31,14 @@
|
|||||||
|
|
||||||
<!-- Path downloads and subtitles -->
|
<!-- Path downloads and subtitles -->
|
||||||
<category label="30501">
|
<category label="30501">
|
||||||
<!--setting id="subtitulo" type="bool" label="30021" default="false"/>
|
<setting type="sep"/>
|
||||||
<setting id="subtitle_type" type="enum" lvalues="30432|30434|30433" label ="30431" enable ="eq(-1,true)" default="0"/>
|
|
||||||
<setting id="subtitlepath_folder" type="folder" source="" enable = "eq(-1,0)+eq(-2,true)" label="30435" default=""/>
|
|
||||||
<setting id="subtitlepath_file" type="file" source="" enable = "eq(-2,2)+eq(-3,true)" label="30436" default=""/>
|
|
||||||
<setting id="subtitlepath_keyboard" type="text" enable ="eq(-3,1)+eq(-4,true)" label="30437" default=""/>
|
|
||||||
|
|
||||||
<setting type="sep"/-->
|
|
||||||
<setting id="downloadpath" type="text" label="30017" default=""/>
|
<setting id="downloadpath" type="text" label="30017" default=""/>
|
||||||
<setting id="downloadlistpath" type="text" label="30018" default=""/>
|
<setting id="downloadlistpath" type="text" label="30018" default=""/>
|
||||||
<setting id="videolibrarypath" type="text" label="30067" default=""/>
|
<setting id="videolibrarypath" type="text" label="30067" default=""/>
|
||||||
|
|
||||||
<setting type="sep"/>
|
<setting type="sep"/>
|
||||||
<setting label="Nombre de carpetas" type="lsep"/>
|
<setting label="30131" type="lsep"/>
|
||||||
<setting id="folder_tvshows" type="text" label="Series" default="SERIES"/>
|
<setting id="folder_tvshows" type="text" label="Nombre de carpeta para 'Series'" default="SERIES"/>
|
||||||
<setting id="folder_movies" type="text" label="Peliculas" default="CINE"/>
|
<setting id="folder_movies" type="text" label="Nombre de carpeta para 'Peliculas'" default="CINE"/>
|
||||||
</category>
|
</category>
|
||||||
</settings>
|
</settings>
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
from platformcode import config, logger, platformtools
|
||||||
|
|
||||||
|
|
||||||
|
def conversion():
|
||||||
|
logger.info()
|
||||||
|
data = ""
|
||||||
|
|
||||||
|
try:
|
||||||
|
# do a backup
|
||||||
|
path_settings = os.path.join(config.get_data_path(), "settings.xml")
|
||||||
|
path_settings_backup = os.path.join(config.get_data_path(), "settings.backup.xml")
|
||||||
|
shutil.copy(path_settings, path_settings_backup)
|
||||||
|
|
||||||
|
# open file
|
||||||
|
f = open(path_settings, "r")
|
||||||
|
# copy = open(path_settings2, "w")
|
||||||
|
|
||||||
|
logger.info(" ---")
|
||||||
|
logger.info(" --- 1")
|
||||||
|
logger.info(" --- 2")
|
||||||
|
logger.info(" --- 3")
|
||||||
|
data_aux = ""
|
||||||
|
|
||||||
|
begin_tag = "<settings>\n"
|
||||||
|
end_tag = "</settings>\n"
|
||||||
|
|
||||||
|
adult_data = ' <setting id="adult_aux_intro_password" value="" />\n'
|
||||||
|
adult_data += ' <setting id="adult_aux_new_password1" value="" />\n'
|
||||||
|
adult_data += ' <setting id="adult_aux_new_password2" value="" />\n'
|
||||||
|
adult_data += ' <setting id="adult_mode" value="0" />\n'
|
||||||
|
adult_data += ' <setting id="adult_password" value="0000" />\n'
|
||||||
|
adult_data += ' <setting id="adult_request_password" value="false" />\n'
|
||||||
|
|
||||||
|
for line in f:
|
||||||
|
matches = re.findall('<setting id="([^"]*)" value="([^"]*)', line, re.DOTALL)
|
||||||
|
logger.info("macthes %s" % matches)
|
||||||
|
if not matches:
|
||||||
|
logger.info("no matches")
|
||||||
|
# for <settings></settings> tag
|
||||||
|
# data += line
|
||||||
|
else:
|
||||||
|
logger.info("Matches")
|
||||||
|
for _id, value in matches:
|
||||||
|
logger.info(" dentro del for")
|
||||||
|
logger.info(" _id:%s value:%s" % (_id, value))
|
||||||
|
|
||||||
|
if _id not in ["adult_aux_intro_password", "adult_aux_new_password1", "adult_aux_new_password2",
|
||||||
|
"adult_mode", "adult_password", "adult_request_password", "adult_pin"]:
|
||||||
|
logger.info(" linea %s" % line)
|
||||||
|
logger.info(" value %s" % value)
|
||||||
|
if value:
|
||||||
|
# logger.info(" type value!! %s" % type(value))
|
||||||
|
logger.info(" antes value!! %s" % value)
|
||||||
|
if "(str, " in value:
|
||||||
|
if "(str, '" in value:
|
||||||
|
value = value.replace("(str, '", "")
|
||||||
|
value = value.replace("')", "")
|
||||||
|
elif "(str, '":
|
||||||
|
value = value.replace("(str, '", "")
|
||||||
|
value = value.replace("')", "")
|
||||||
|
elif "(bool, " in value:
|
||||||
|
value = value.replace("(bool, ", "")
|
||||||
|
if value == "True)":
|
||||||
|
value = "true"
|
||||||
|
else:
|
||||||
|
value = "false"
|
||||||
|
value = value.replace('\\\\', '\\')
|
||||||
|
logger.info(" despues value!! %s" % value)
|
||||||
|
|
||||||
|
aux_line = '<setting id="%s" value="%s" />\n' % (_id, value)
|
||||||
|
logger.info(" aux_line %s" % aux_line)
|
||||||
|
data_aux += " " + aux_line
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
data = begin_tag + adult_data + data_aux + end_tag
|
||||||
|
|
||||||
|
copy_file = open(path_settings, "w")
|
||||||
|
copy_file.write(data)
|
||||||
|
copy_file.close()
|
||||||
|
|
||||||
|
while True:
|
||||||
|
import sys
|
||||||
|
logger.info("sys ve %s" % sys.version_info)
|
||||||
|
if sys.version_info > (3, 0):
|
||||||
|
value = input("Alfa\nCorregido un error en la seccion adultos, se ha reseteado la contrasena a por "
|
||||||
|
"defecto, tendra que cambiarla de nuevo si lo desea.\n Escriba 's', si lo ha entendido: ")
|
||||||
|
else:
|
||||||
|
value = raw_input("Alfa\nCorregido un error en la seccion adultos, se ha reseteado la contrasena a por "
|
||||||
|
"defecto, tendra que cambiarla de nuevo si lo desea.\n Escriba 's', si lo ha entendido: ")
|
||||||
|
logger.debug("value %s" % value)
|
||||||
|
if value.lower() == 's':
|
||||||
|
break
|
||||||
|
logger.info("En disclaimer clickó 'No'")
|
||||||
|
|
||||||
|
logger.info("En disclaimer clickó 'Si'")
|
||||||
|
|
||||||
|
except Exception, ex:
|
||||||
|
template = "An exception of type %s occured. Arguments:\n%r"
|
||||||
|
message = template % (type(ex).__name__, ex.args)
|
||||||
|
logger.info(message)
|
||||||
|
print("Alfa", "Error, en conversión")
|
||||||
|
logger.info("Datos a guardar %s" % data)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
conversion()
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.alfa" name="Alfa" version="1.5.4" provider-name="Alfa Addon">
|
<addon id="plugin.video.alfa" name="Alfa" version="1.7.0" provider-name="Alfa Addon">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="2.1.0"/>
|
<import addon="xbmc.python" version="2.1.0"/>
|
||||||
<import addon="script.module.libtorrent" optional="true"/>
|
<import addon="script.module.libtorrent" optional="true"/>
|
||||||
@@ -19,10 +19,11 @@
|
|||||||
</assets>
|
</assets>
|
||||||
<news>[B]Estos son los cambios para esta versión:[/B]
|
<news>[B]Estos son los cambios para esta versión:[/B]
|
||||||
[COLOR green][B]Arreglos[/B][/COLOR]
|
[COLOR green][B]Arreglos[/B][/COLOR]
|
||||||
[I]- streamix.cloud
|
[I]- arreglo sección adultos
|
||||||
- tvseriesdk
|
[I]- flashx
|
||||||
- newpct
|
- fixes internos[/I]
|
||||||
- fix internos[/I]
|
|
||||||
|
[COLOR green]Gracias a [COLOR yellow][B]msdos[/B][/COLOR] por su colaboración en esta versión[/COLOR]
|
||||||
</news>
|
</news>
|
||||||
<description lang="es">Navega con Kodi por páginas web para ver sus videos de manera fácil.</description>
|
<description lang="es">Navega con Kodi por páginas web para ver sus videos de manera fácil.</description>
|
||||||
<summary lang="en">Browse web pages using Kodi</summary>
|
<summary lang="en">Browse web pages using Kodi</summary>
|
||||||
|
|||||||
Executable → Regular
+1
-1
@@ -223,7 +223,7 @@ def episodios(item):
|
|||||||
item.plot = scrapertools.find_single_match(data, 'Description[^>]+><p>(.*?)</p>')
|
item.plot = scrapertools.find_single_match(data, 'Description[^>]+><p>(.*?)</p>')
|
||||||
|
|
||||||
matches = re.compile('href="([^"]+)"><figure><img class="[^"]+" data-original="([^"]+)".+?</h3>'
|
matches = re.compile('href="([^"]+)"><figure><img class="[^"]+" data-original="([^"]+)".+?</h3>'
|
||||||
'<p>(.*?)</p>', re.DOTALL).findall(data)
|
'\s*<p>(.*?)</p>', re.DOTALL).findall(data)
|
||||||
|
|
||||||
if matches:
|
if matches:
|
||||||
for url, thumb, title in matches:
|
for url, thumb, title in matches:
|
||||||
|
|||||||
@@ -381,10 +381,10 @@ def check_value(channel, itemlist):
|
|||||||
quality_list = channel_node['quality'] = list()
|
quality_list = channel_node['quality'] = list()
|
||||||
|
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
if item.server not in server_list:
|
if item.server not in server_list and item.server !='':
|
||||||
server_list.append(item.server)
|
server_list.append(item.server)
|
||||||
change = True
|
change = True
|
||||||
if item.quality not in quality_list:
|
if item.quality not in quality_list and item.quality !='':
|
||||||
quality_list.append(item.quality)
|
quality_list.append(item.quality)
|
||||||
change = True
|
change = True
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def lista(item):
|
|||||||
server="datoporn", fanart=scrapedthumbnail.replace("_t.jpg", ".jpg")))
|
server="datoporn", fanart=scrapedthumbnail.replace("_t.jpg", ".jpg")))
|
||||||
|
|
||||||
# Extrae la marca de siguiente página
|
# Extrae la marca de siguiente página
|
||||||
next_page = scrapertools.find_single_match(data, "<a href='([^']+)'>Next")
|
next_page = scrapertools.find_single_match(data, '<a href="([^"]+)">Next')
|
||||||
if next_page and itemlist:
|
if next_page and itemlist:
|
||||||
itemlist.append(item.clone(action="lista", title=">> Página Siguiente", url=next_page))
|
itemlist.append(item.clone(action="lista", title=">> Página Siguiente", url=next_page))
|
||||||
|
|
||||||
|
|||||||
@@ -61,30 +61,3 @@ def search(item, texto):
|
|||||||
return todas(item)
|
return todas(item)
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
|
||||||
logger.info()
|
|
||||||
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
|
||||||
patron = '<li.*?<a href="([^"]+)" target="_blank"><i class="icon-metro online"><\/i><span>Ver.*?<\/span><\/a> <\/li>'
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
|
||||||
for scrapedurl in matches:
|
|
||||||
title = item.title
|
|
||||||
url = scrapedurl
|
|
||||||
itemlist.append(item.clone(title=title, url=url, action="play"))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
item.url = item.url.replace(' ', '%20')
|
|
||||||
data = httptools.downloadpage(item.url, add_referer=True).data
|
|
||||||
url = scrapertools.find_single_match(data, '<iframe.*?src="([^"]+)".*?frameborder="0"')
|
|
||||||
itemlist = servertools.find_video_items(data=data)
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ def mainlist(item):
|
|||||||
itemlist = list()
|
itemlist = list()
|
||||||
itemlist.append(Item(channel=item.channel, action="series", title="Novedades",
|
itemlist.append(Item(channel=item.channel, action="series", title="Novedades",
|
||||||
url=urlparse.urljoin(CHANNEL_HOST, "archivos/h2/"), extra="novedades"))
|
url=urlparse.urljoin(CHANNEL_HOST, "archivos/h2/"), extra="novedades"))
|
||||||
itemlist.append(Item(channel=item.channel, action="letras", title="Por orden alfabético"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="generos", title="Por géneros", url=CHANNEL_HOST))
|
itemlist.append(Item(channel=item.channel, action="generos", title="Por géneros", url=CHANNEL_HOST))
|
||||||
itemlist.append(Item(channel=item.channel, action="series", title="Sin Censura",
|
itemlist.append(Item(channel=item.channel, action="series", title="Sin Censura",
|
||||||
url=urlparse.urljoin(CHANNEL_HOST, "archivos/sin-censura/")))
|
url=urlparse.urljoin(CHANNEL_HOST, "archivos/sin-censura/")))
|
||||||
@@ -25,20 +24,6 @@ def mainlist(item):
|
|||||||
url=urlparse.urljoin(CHANNEL_HOST, "archivos/hight-definition/")))
|
url=urlparse.urljoin(CHANNEL_HOST, "archivos/hight-definition/")))
|
||||||
itemlist.append(Item(channel=item.channel, action="series", title="Mejores Hentais",
|
itemlist.append(Item(channel=item.channel, action="series", title="Mejores Hentais",
|
||||||
url=urlparse.urljoin(CHANNEL_HOST, "archivos/ranking-hentai/")))
|
url=urlparse.urljoin(CHANNEL_HOST, "archivos/ranking-hentai/")))
|
||||||
itemlist.append(Item(channel=item.channel, action="search", title="Buscar",
|
|
||||||
url=urlparse.urljoin(CHANNEL_HOST, "?s=")))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def letras(item):
|
|
||||||
logger.info()
|
|
||||||
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
for letra in '0ABCDEFGHIJKLMNOPQRSTUVWXYZ':
|
|
||||||
itemlist.append(Item(channel=item.channel, action="series", title=letra,
|
|
||||||
url=urlparse.urljoin(CHANNEL_HOST, "/?s=letra-%s" % letra.replace("0", "num"))))
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -47,49 +32,34 @@ def generos(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url).data
|
data = re.sub(r"\n|\r|\t|\s{2}", "", httptools.downloadpage(item.url).data)
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}", "", data)
|
|
||||||
|
|
||||||
data = scrapertools.get_match(data, "<div class='cccon'>(.*?)</div><div id=\"myslides\">")
|
pattern = 'id="hentai2"><div[^>]+>(.*?)</div></div>'
|
||||||
patron = "<a.+? href='/([^']+)'>(.*?)</a>"
|
data = scrapertools.find_single_match(data, pattern)
|
||||||
|
|
||||||
|
patron = 'href="([^"]+)"[^>]+>(.*?)</a>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for url, title in matches:
|
||||||
title = scrapertools.entityunescape(scrapedtitle)
|
|
||||||
url = urlparse.urljoin(item.url, scrapedurl)
|
|
||||||
# logger.debug("title=[{0}], url=[{1}]".format(title, url))
|
# logger.debug("title=[{0}], url=[{1}]".format(title, url))
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="series", title=title, url=url))
|
itemlist.append(Item(channel=item.channel, action="series", title=title, url=url))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
|
||||||
logger.info()
|
|
||||||
if item.url == "":
|
|
||||||
item.url = urlparse.urljoin(CHANNEL_HOST, "animes/?buscar=")
|
|
||||||
texto = texto.replace(" ", "+")
|
|
||||||
item.url = "%s%s" % (item.url, texto)
|
|
||||||
|
|
||||||
try:
|
|
||||||
return series(item)
|
|
||||||
# Se captura la excepción, para no interrumpir al buscador global si un canal falla
|
|
||||||
except:
|
|
||||||
import sys
|
|
||||||
for line in sys.exc_info():
|
|
||||||
logger.error("%s" % line)
|
|
||||||
return []
|
|
||||||
|
|
||||||
|
|
||||||
def series(item):
|
def series(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = re.sub(r"\n|\r|\t|\s{2}", "", httptools.downloadpage(item.url).data)
|
||||||
|
|
||||||
patron = '<div class="post" id="post"[^<]+<center><h1 class="post-title entry-title"[^<]+<a href="([^"]+)">' \
|
pattern = "<div class='wp-pagenavi'>(.*?)</div>"
|
||||||
'(.*?)</a>[^<]+</h1></center>[^<]+<div[^<]+</div>[^<]+<div[^<]+<div.+?<img src="([^"]+)"'
|
pagination = scrapertools.find_single_match(data, pattern)
|
||||||
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
pattern = '<div class="col-xs-12 col-md-12 col-lg-9px-3"><ul>(.*?)</ul><div class="clearfix">'
|
||||||
|
data = scrapertools.find_single_match(data, pattern)
|
||||||
|
|
||||||
|
pattern = '<a href="([^"]+)".*?<img src="([^"]+)" title="([^"]+)"'
|
||||||
|
matches = re.compile(pattern, re.DOTALL).findall(data)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if item.extra == "novedades":
|
if item.extra == "novedades":
|
||||||
@@ -97,25 +67,20 @@ def series(item):
|
|||||||
else:
|
else:
|
||||||
action = "episodios"
|
action = "episodios"
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
for url, thumbnail, title in matches:
|
||||||
title = scrapertools.unescape(scrapedtitle)
|
|
||||||
fulltitle = title
|
fulltitle = title
|
||||||
url = urlparse.urljoin(item.url, scrapedurl)
|
|
||||||
thumbnail = urlparse.urljoin(item.url, scrapedthumbnail)
|
|
||||||
show = title
|
show = title
|
||||||
# logger.debug("title=[{0}], url=[{1}], thumbnail=[{2}]".format(title, url, thumbnail))
|
# logger.debug("title=[{0}], url=[{1}], thumbnail=[{2}]".format(title, url, thumbnail))
|
||||||
itemlist.append(Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumbnail,
|
itemlist.append(Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumbnail,
|
||||||
show=show, fulltitle=fulltitle, fanart=thumbnail, folder=True))
|
show=show, fulltitle=fulltitle, fanart=thumbnail, folder=True))
|
||||||
|
|
||||||
patron = '</span><a class="page larger" href="([^"]+)"'
|
if pagination:
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
page = scrapertools.find_single_match(pagination, '>Página\s*(\d+)\s*de\s*\d+<')
|
||||||
for match in matches:
|
pattern = 'href="([^"]+)">%s<' % (int(page) + 1)
|
||||||
if len(matches) > 0:
|
url_page = scrapertools.find_single_match(pagination, pattern)
|
||||||
scrapedurl = match
|
|
||||||
scrapedtitle = ">> Pagina Siguiente"
|
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="series", title=scrapedtitle, url=scrapedurl,
|
if url_page:
|
||||||
folder=True, viewmode="movies_with_plot"))
|
itemlist.append(Item(channel=item.channel, action="series", title=">> Página Siguiente", url=url_page))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -124,9 +89,11 @@ def episodios(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = re.sub(r"\n|\r|\t|\s{2}", "", httptools.downloadpage(item.url).data)
|
||||||
data = scrapertools.find_single_match(data, '<div class="listanime">(.*?)</div>')
|
pattern = '<div class="box-entry-title text-center">Lista de Capítulos</div>(.*?)</div></div>'
|
||||||
patron = '<a href="([^"]+)">([^<]+)</a>'
|
|
||||||
|
data = scrapertools.find_single_match(data, pattern)
|
||||||
|
patron = '<a href="([^"]+)"[^>]+>([^<]+)</a>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
@@ -136,10 +103,9 @@ def episodios(item):
|
|||||||
plot = item.plot
|
plot = item.plot
|
||||||
|
|
||||||
# logger.debug("title=[{0}], url=[{1}], thumbnail=[{2}]".format(title, url, thumbnail))
|
# logger.debug("title=[{0}], url=[{1}], thumbnail=[{2}]".format(title, url, thumbnail))
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url,
|
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url,
|
||||||
thumbnail=thumbnail, plot=plot, show=item.show, fulltitle="%s %s" % (item.show, title),
|
thumbnail=thumbnail, plot=plot, show=item.show, fulltitle="%s %s" % (item.show, title),
|
||||||
fanart=thumbnail, viewmode="movies_with_plot", folder=True))
|
fanart=thumbnail))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -148,7 +114,8 @@ def findvideos(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
patron = '<div id="tab\d".+?>[^<]+<[iframe|IFRAME].*?[src|SRC]="([^"]+)"'
|
|
||||||
|
patron = '<(?:iframe)?(?:IFRAME)?\s*(?:src)?(?:SRC)?="([^"]+)"'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for url in matches:
|
for url in matches:
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ def generos(item):
|
|||||||
matches = scrapertools.find_multiple_matches(data, '<li class="cat-item cat-item-.*?><a href="([^"]+)".*?>(.*?)<b>')
|
matches = scrapertools.find_multiple_matches(data, '<li class="cat-item cat-item-.*?><a href="([^"]+)".*?>(.*?)<b>')
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
if scrapedtitle == "Eroticas +18 " and config.get_setting("adult_mode") != "0":
|
if scrapedtitle == "Eroticas +18 " and config.get_setting("adult_mode") != 0:
|
||||||
itemlist.append(item.clone(action="eroticas", title=scrapedtitle, url=scrapedurl))
|
itemlist.append(item.clone(action="eroticas", title=scrapedtitle, url=scrapedurl))
|
||||||
elif (scrapedtitle != "Estrenos ") and (scrapedtitle != "Próximos Estrenos "):
|
elif (scrapedtitle != "Estrenos ") and (scrapedtitle != "Próximos Estrenos "):
|
||||||
itemlist.append(item.clone(action="entradas", title=scrapedtitle, url=scrapedurl))
|
itemlist.append(item.clone(action="entradas", title=scrapedtitle, url=scrapedurl))
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
"default": 0,
|
"default": 0,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": true,
|
"visible": true,
|
||||||
"llvalues": [
|
"lvalues": [
|
||||||
"No filtrar",
|
"No filtrar",
|
||||||
"Latino",
|
"Latino",
|
||||||
"Español",
|
"Español",
|
||||||
@@ -76,4 +76,4 @@
|
|||||||
"visible": true
|
"visible": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ def show_result(item):
|
|||||||
if item.adult and config.get_setting("adult_request_password"):
|
if item.adult and config.get_setting("adult_request_password"):
|
||||||
# Solicitar contraseña
|
# Solicitar contraseña
|
||||||
tecleado = platformtools.dialog_input("", "Contraseña para canales de adultos", True)
|
tecleado = platformtools.dialog_input("", "Contraseña para canales de adultos", True)
|
||||||
if tecleado is None or tecleado != config.get_setting("adult_pin"):
|
if tecleado is None or tecleado != config.get_setting("adult_password"):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
item.channel = item.__dict__.pop('from_channel')
|
item.channel = item.__dict__.pop('from_channel')
|
||||||
|
|||||||
@@ -10,5 +10,16 @@
|
|||||||
"categories": [
|
"categories": [
|
||||||
"movie",
|
"movie",
|
||||||
"latino"
|
"latino"
|
||||||
|
],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "modo_grafico",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Buscar información extra",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,9 +14,16 @@ from core import scrapertools
|
|||||||
from core import servertools
|
from core import servertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from core import tmdb
|
||||||
|
|
||||||
|
__channel__ = "ver-peliculas"
|
||||||
|
|
||||||
host = "http://ver-peliculas.org/"
|
host = "http://ver-peliculas.org/"
|
||||||
|
|
||||||
|
try:
|
||||||
|
__modo_grafico__ = config.get_setting('modo_grafico', __channel__)
|
||||||
|
except:
|
||||||
|
__modo_grafico__ = True
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
@@ -115,19 +122,22 @@ def listado(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data)
|
data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data)
|
||||||
logger.debug(data)
|
# logger.debug(data)
|
||||||
pattern = '<a href="([^"]+)"[^>]+><img (?:src)?(?:data-original)?="([^"]+)".*?alt="([^"]+)"'
|
pattern = '<a href="([^"]+)"[^>]+><img (?:src)?(?:data-original)?="([^"]+)".*?alt="([^"]+)"'
|
||||||
matches = re.compile(pattern, re.DOTALL).findall(data)
|
matches = re.compile(pattern, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for url, thumb, title in matches:
|
for url, thumb, title in matches:
|
||||||
title = title.replace("Película", "", 1)
|
year = scrapertools.find_single_match(url, '-(\d+)-online')
|
||||||
|
title = title.replace("Película", "", 1).partition(" /")[0].partition(":")[0]
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
action="findvideos",
|
action="findvideos",
|
||||||
title=title,
|
title=title,
|
||||||
|
infoLabels={"year": year},
|
||||||
url=url,
|
url=url,
|
||||||
thumbnail=thumb,
|
thumbnail=thumb,
|
||||||
contentTitle=title
|
contentTitle=title
|
||||||
))
|
))
|
||||||
|
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||||
|
|
||||||
pagination = scrapertools.find_single_match(data, '<ul class="pagination">(.*?)</ul>')
|
pagination = scrapertools.find_single_match(data, '<ul class="pagination">(.*?)</ul>')
|
||||||
if pagination:
|
if pagination:
|
||||||
@@ -140,6 +150,13 @@ def listado(item):
|
|||||||
url=url,
|
url=url,
|
||||||
thumbnail=get_thumb("next.png")))
|
thumbnail=get_thumb("next.png")))
|
||||||
|
|
||||||
|
for item in itemlist:
|
||||||
|
if item.infoLabels['plot'] == '':
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
item.plot = scrapertools.find_single_match(data, '<div class="desc">([^<]+)</div>').strip()
|
||||||
|
item.fanart = scrapertools.find_single_match(data, '<meta property="og:image" content="([^"]+)"/>')
|
||||||
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ from core import httptools
|
|||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
from core import servertools
|
||||||
|
|
||||||
host = 'http://www.18hentaionline.eu/'
|
host = 'http://www.18hentaionline.net/'
|
||||||
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
||||||
['Referer', host]]
|
['Referer', host]]
|
||||||
|
|
||||||
@@ -92,17 +93,58 @@ def episodios(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url, headers=headers).data
|
data = httptools.downloadpage(item.url, headers=headers).data
|
||||||
patron = '<td>([^<]+)<\/td>.<td>([^<]+)<\/td>.<td>([^<]+)<\/td>.<td>([^<]+)<\/td>.<td><a href="([^"]+)".*?>Ver Capitulo<\/a><\/td>'
|
old_mode = scrapertools.find_single_match(data, '<th>Censura<\/th>')
|
||||||
|
if old_mode:
|
||||||
|
patron = '<td>(\d+)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td><a href="(.*?)".*?>Ver Capitulo<\/a><\/td>'
|
||||||
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for scrapedcap, scrapedaud, scrapedsub, scrapedcen, scrapedurl in matches:
|
for scrapedcap, scrapedaud, scrapedsub, scrapedcen, scrapedurl in matches:
|
||||||
url = scrapedurl
|
url = scrapedurl
|
||||||
title = 'CAPITULO ' + scrapedcap + ' AUDIO: ' + scrapedaud + ' SUB:' + scrapedsub + ' ' + censura[scrapedcen]
|
title = 'CAPITULO ' + scrapedcap + ' AUDIO: ' + scrapedaud + ' SUB:' + scrapedsub + ' ' + censura[scrapedcen]
|
||||||
thumbnail = ''
|
thumbnail = ''
|
||||||
plot = ''
|
plot = ''
|
||||||
fanart = ''
|
fanart = ''
|
||||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, fulltitle=item.fulltitle, url=url,
|
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, fulltitle=item.fulltitle, url=url,
|
||||||
thumbnail=item.thumbnail, plot=plot))
|
thumbnail=item.thumbnail, plot=plot))
|
||||||
|
else:
|
||||||
|
patron = '<\/i>.*?(.\d+)<\/td><td style="text-align:center">MP4<\/td><td style="text-align:center">(.*?)<\/td>.*?'
|
||||||
|
patron +='<a class="dr-button" href="(.*?)" >'
|
||||||
|
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for scrapedcap, scrapedsub, scrapedurl in matches:
|
||||||
|
url = scrapedurl
|
||||||
|
if scrapedsub !='':
|
||||||
|
subs= scrapedsub
|
||||||
|
else:
|
||||||
|
sub = 'No'
|
||||||
|
title = 'CAPITULO %s SUB %s'%(scrapedcap, subs)
|
||||||
|
thumbnail = ''
|
||||||
|
plot = ''
|
||||||
|
fanart = ''
|
||||||
|
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, fulltitle=item.fulltitle, url=url,
|
||||||
|
thumbnail=item.thumbnail, plot=plot))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
gvideo = scrapertools.find_single_match(data,'<li rel="(http:\/\/www\.18hentaionline\.net\/ramus\/phar\.php\?vid=.*?)">')
|
||||||
|
headers = {'Host':'www.18hentaionline.net', 'Referer':item.url}
|
||||||
|
gvideo_data = httptools.downloadpage(gvideo, headers = headers).data
|
||||||
|
gvideo_url = scrapertools.find_single_match(gvideo_data, 'file: "(.*?)"')
|
||||||
|
server = 'directo'
|
||||||
|
new_item = (item.clone(url=gvideo_url, server=server))
|
||||||
|
itemlist.append(new_item)
|
||||||
|
itemlist.extend(servertools.find_video_items(data=data))
|
||||||
|
for videoitem in itemlist:
|
||||||
|
videoitem.channel = item.channel
|
||||||
|
videoitem.title = item.title+' (%s)'%videoitem.server
|
||||||
|
videoitem.action = 'play'
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -138,17 +138,18 @@ def get_channel_parameters(channel_name):
|
|||||||
def get_channel_json(channel_name):
|
def get_channel_json(channel_name):
|
||||||
# logger.info("channel_name=" + channel_name)
|
# logger.info("channel_name=" + channel_name)
|
||||||
import filetools
|
import filetools
|
||||||
|
channel_json = None
|
||||||
try:
|
try:
|
||||||
channel_path = filetools.join(config.get_runtime_path(), "channels", channel_name + ".json")
|
channel_path = filetools.join(config.get_runtime_path(), "channels", channel_name + ".json")
|
||||||
# logger.info("channel_data=" + channel_path)
|
if filetools.isfile(channel_path):
|
||||||
channel_json = jsontools.load(filetools.read(channel_path))
|
# logger.info("channel_data=" + channel_path)
|
||||||
# logger.info("channel_json= %s" % channel_json)
|
channel_json = jsontools.load(filetools.read(channel_path))
|
||||||
|
# logger.info("channel_json= %s" % channel_json)
|
||||||
|
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
template = "An exception of type %s occured. Arguments:\n%r"
|
template = "An exception of type %s occured. Arguments:\n%r"
|
||||||
message = template % (type(ex).__name__, ex.args)
|
message = template % (type(ex).__name__, ex.args)
|
||||||
logger.error(" %s" % message)
|
logger.error(" %s" % message)
|
||||||
channel_json = None
|
|
||||||
|
|
||||||
return channel_json
|
return channel_json
|
||||||
|
|
||||||
@@ -187,10 +188,10 @@ def get_channel_setting(name, channel, default=None):
|
|||||||
@param channel: nombre del canal
|
@param channel: nombre del canal
|
||||||
@type channel: str
|
@type channel: str
|
||||||
@param default: valor devuelto en caso de que no exista el parametro name
|
@param default: valor devuelto en caso de que no exista el parametro name
|
||||||
@type default: cualquiera
|
@type default: any
|
||||||
|
|
||||||
@return: El valor del parametro 'name'
|
@return: El valor del parametro 'name'
|
||||||
@rtype: El tipo del valor del parametro
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
file_settings = os.path.join(config.get_data_path(), "settings_channels", channel + "_data.json")
|
file_settings = os.path.join(config.get_data_path(), "settings_channels", channel + "_data.json")
|
||||||
|
|||||||
@@ -446,7 +446,9 @@ def mkdir(path):
|
|||||||
except:
|
except:
|
||||||
logger.error("ERROR al crear el directorio: %s" % path)
|
logger.error("ERROR al crear el directorio: %s" % path)
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
platformtools.dialog_notification("Error al crear el directorio", path)
|
# platformtools.dialog_notification("Error al crear el directorio", path)
|
||||||
|
platformtools.dialog_ok("Alfa", "[COLOR red][B]IMPORTANTE[/B][/COLOR] - Instale y Ejecute el script 'Fix version 1.7.0', que se encuentra en el repositorio de Alfa y "
|
||||||
|
"vuelva a entrar en el addon, [B]si no lo hace tendrá problemas[/B]")
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ def cuadro_completar(item):
|
|||||||
'visible': True})
|
'visible': True})
|
||||||
|
|
||||||
# logger.debug(dict_default)
|
# logger.debug(dict_default)
|
||||||
if platformtools.show_channel_settings(listado_controles, caption="Completar información", item=item,
|
if platformtools.show_channel_settings(list_controls=listado_controles, caption="Completar información", item=item,
|
||||||
callback="core.scraper.callback_cuadro_completar",
|
callback="core.scraper.callback_cuadro_completar",
|
||||||
custom_button={"visible": False}):
|
custom_button={"visible": False}):
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -565,10 +565,10 @@ def get_server_setting(name, server, default=None):
|
|||||||
@param server: nombre del servidor
|
@param server: nombre del servidor
|
||||||
@type server: str
|
@type server: str
|
||||||
@param default: valor devuelto en caso de que no exista el parametro name
|
@param default: valor devuelto en caso de que no exista el parametro name
|
||||||
@type default: cualquiera
|
@type default: any
|
||||||
|
|
||||||
@return: El valor del parametro 'name'
|
@return: El valor del parametro 'name'
|
||||||
@rtype: El tipo del valor del parametro
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Creamos la carpeta si no existe
|
# Creamos la carpeta si no existe
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ def get_current_plugin_version():
|
|||||||
|
|
||||||
|
|
||||||
def get_current_plugin_version_tag():
|
def get_current_plugin_version_tag():
|
||||||
return "4.3.0-beta1"
|
return "1.7.0"
|
||||||
|
|
||||||
|
|
||||||
def get_current_plugin_date():
|
def get_current_plugin_date():
|
||||||
return "30/06/2017"
|
return "22/08/2017"
|
||||||
|
|
||||||
|
|
||||||
def get_current_channels_version():
|
def get_current_channels_version():
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import re
|
|||||||
|
|
||||||
import xbmc
|
import xbmc
|
||||||
import xbmcaddon
|
import xbmcaddon
|
||||||
import xbmcgui
|
|
||||||
|
|
||||||
PLUGIN_NAME = "alfa"
|
PLUGIN_NAME = "alfa"
|
||||||
|
|
||||||
@@ -112,17 +111,11 @@ def open_settings():
|
|||||||
# Cambio de contraseña
|
# Cambio de contraseña
|
||||||
if settings_post['adult_aux_new_password1']:
|
if settings_post['adult_aux_new_password1']:
|
||||||
if settings_post['adult_aux_new_password1'] == settings_post['adult_aux_new_password2']:
|
if settings_post['adult_aux_new_password1'] == settings_post['adult_aux_new_password2']:
|
||||||
adult_password = set_setting('adult_password', settings_post['adult_aux_new_password1'])
|
set_setting('adult_password', settings_post['adult_aux_new_password1'])
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok("Canales para adultos",
|
platformtools.dialog_ok("Canales para adultos",
|
||||||
"Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden.",
|
"Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden."
|
||||||
"Entre de nuevo en 'Preferencias' para cambiar la contraseña")
|
, "Entre de nuevo en 'Preferencias' para cambiar la contraseña")
|
||||||
|
|
||||||
# Fijar adult_pin
|
|
||||||
adult_pin = ""
|
|
||||||
if settings_post["adult_request_password"] == True:
|
|
||||||
adult_pin = adult_password
|
|
||||||
set_setting("adult_pin", adult_pin)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_ok("Canales para adultos", "La contraseña no es correcta.",
|
platformtools.dialog_ok("Canales para adultos", "La contraseña no es correcta.",
|
||||||
@@ -140,8 +133,8 @@ def open_settings():
|
|||||||
# si se ha cambiado la ruta de la videoteca llamamos a comprobar directorios para que lo cree y pregunte
|
# si se ha cambiado la ruta de la videoteca llamamos a comprobar directorios para que lo cree y pregunte
|
||||||
# automaticamente si configurar la videoteca
|
# automaticamente si configurar la videoteca
|
||||||
if settings_pre.get("videolibrarypath", None) != settings_post.get("videolibrarypath", None) or \
|
if settings_pre.get("videolibrarypath", None) != settings_post.get("videolibrarypath", None) or \
|
||||||
settings_pre.get("folder_movies", None) != settings_post.get("folder_movies", None) or \
|
settings_pre.get("folder_movies", None) != settings_post.get("folder_movies", None) or \
|
||||||
settings_pre.get("folder_tvshows", None) != settings_post.get("folder_tvshows", None):
|
settings_pre.get("folder_tvshows", None) != settings_post.get("folder_tvshows", None):
|
||||||
verify_directories_created()
|
verify_directories_created()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -156,13 +149,13 @@ def get_setting(name, channel="", server="", default=None):
|
|||||||
"""
|
"""
|
||||||
Retorna el valor de configuracion del parametro solicitado.
|
Retorna el valor de configuracion del parametro solicitado.
|
||||||
|
|
||||||
Devuelve el valor del parametro 'name' en la configuracion global, en la configuracion propia del canal 'channel'
|
Devuelve el valor del parametro 'name' en la configuracion global, en la configuracion propia del canal 'channel'
|
||||||
o en la del servidor 'server'.
|
o en la del servidor 'server'.
|
||||||
|
|
||||||
Los parametros channel y server no deben usarse simultaneamente. Si se especifica el nombre del canal se devolvera
|
Los parametros channel y server no deben usarse simultaneamente. Si se especifica el nombre del canal se devolvera
|
||||||
el resultado de llamar a channeltools.get_channel_setting(name, channel, default). Si se especifica el nombre del
|
el resultado de llamar a channeltools.get_channel_setting(name, channel, default). Si se especifica el nombre del
|
||||||
servidor se devolvera el resultado de llamar a servertools.get_channel_setting(name, server, default). Si no se
|
servidor se devolvera el resultado de llamar a servertools.get_channel_setting(name, server, default). Si no se
|
||||||
especifica ninguno de los anteriores se devolvera el valor del parametro en la configuracion global si existe o
|
especifica ninguno de los anteriores se devolvera el valor del parametro en la configuracion global si existe o
|
||||||
el valor default en caso contrario.
|
el valor default en caso contrario.
|
||||||
|
|
||||||
@param name: nombre del parametro
|
@param name: nombre del parametro
|
||||||
@@ -172,10 +165,10 @@ def get_setting(name, channel="", server="", default=None):
|
|||||||
@param server: nombre del servidor
|
@param server: nombre del servidor
|
||||||
@type server: str
|
@type server: str
|
||||||
@param default: valor devuelto en caso de que no exista el parametro name
|
@param default: valor devuelto en caso de que no exista el parametro name
|
||||||
@type default: cualquiera
|
@type default: any
|
||||||
|
|
||||||
@return: El valor del parametro 'name'
|
@return: El valor del parametro 'name'
|
||||||
@rtype: El tipo del valor del parametro
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -206,35 +199,21 @@ def get_setting(name, channel="", server="", default=None):
|
|||||||
value = xbmc.translatePath(value)
|
value = xbmc.translatePath(value)
|
||||||
|
|
||||||
# hack para devolver el tipo correspondiente
|
# hack para devolver el tipo correspondiente
|
||||||
settings_types = get_settings_types()
|
if value == "true":
|
||||||
|
return True
|
||||||
if settings_types.get(name) in ['enum', 'number']:
|
elif value == "false":
|
||||||
try:
|
return False
|
||||||
value = int(value)
|
else:
|
||||||
except Exception, ex:
|
# special case return as str
|
||||||
from platformcode import logger
|
if name in ["adult_password", "adult_aux_intro_password", "adult_aux_new_password1",
|
||||||
logger.error("Error al convertir '%s' de tipo 'enum','number' \n%s" % (name, ex))
|
"adult_aux_new_password2"]:
|
||||||
|
return value
|
||||||
elif settings_types.get(name) == 'bool':
|
else:
|
||||||
value = value == 'true'
|
try:
|
||||||
|
value = int(value)
|
||||||
elif name not in settings_types:
|
except ValueError:
|
||||||
try:
|
pass
|
||||||
if value in ['true', 'false']:
|
return value
|
||||||
if value == 'true':
|
|
||||||
aux_val = True
|
|
||||||
else:
|
|
||||||
aux_val = False
|
|
||||||
value = bool(aux_val)
|
|
||||||
else:
|
|
||||||
t = eval(value)
|
|
||||||
value = t[0](t[1])
|
|
||||||
except Exception, ex:
|
|
||||||
from platformcode import logger
|
|
||||||
logger.error("Error al convertir '%s' se pasa como tipo 'None'\n%s" % (name, ex))
|
|
||||||
value = None
|
|
||||||
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def set_setting(name, value, channel="", server=""):
|
def set_setting(name, value, channel="", server=""):
|
||||||
@@ -269,25 +248,16 @@ def set_setting(name, value, channel="", server=""):
|
|||||||
return servertools.set_server_setting(name, value, server)
|
return servertools.set_server_setting(name, value, server)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
settings_types = get_settings_types()
|
if isinstance(value, bool):
|
||||||
|
|
||||||
if settings_types.get(name) == 'bool':
|
|
||||||
if value:
|
if value:
|
||||||
new_value = "true"
|
value = "true"
|
||||||
else:
|
else:
|
||||||
new_value = "false"
|
value = "false"
|
||||||
|
|
||||||
elif settings_types.get(name):
|
elif isinstance(value, (int, long)):
|
||||||
new_value = str(value)
|
value = str(value)
|
||||||
|
|
||||||
else:
|
__settings__.setSetting(name, value)
|
||||||
if isinstance(value, basestring):
|
|
||||||
new_value = "(%s, %s)" % (type(value).__name__, repr(value))
|
|
||||||
|
|
||||||
else:
|
|
||||||
new_value = "(%s, %s)" % (type(value).__name__, value)
|
|
||||||
|
|
||||||
__settings__.setSetting(name, new_value)
|
|
||||||
|
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
@@ -297,28 +267,6 @@ def set_setting(name, value, channel="", server=""):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
def get_settings_types():
|
|
||||||
"""
|
|
||||||
Devuelve un diccionario con los parametros (key) de la configuracion global y sus tipos (value)
|
|
||||||
|
|
||||||
:return: dict
|
|
||||||
"""
|
|
||||||
win10000 = xbmcgui.Window(10000)
|
|
||||||
settings_types = win10000.getProperty(PLUGIN_NAME + "_settings_types")
|
|
||||||
|
|
||||||
if not settings_types:
|
|
||||||
infile = open(os.path.join(get_runtime_path(), "resources", "settings.xml"))
|
|
||||||
data = infile.read()
|
|
||||||
infile.close()
|
|
||||||
|
|
||||||
matches = re.findall('<setting id="([^"]*)" type="([^"]*)', data)
|
|
||||||
settings_types = "{%s}" % ",".join("'%s': '%s'" % tup for tup in matches)
|
|
||||||
|
|
||||||
win10000.setProperty(PLUGIN_NAME + "_settings_types", settings_types)
|
|
||||||
|
|
||||||
return eval(settings_types)
|
|
||||||
|
|
||||||
|
|
||||||
def get_localized_string(code):
|
def get_localized_string(code):
|
||||||
dev = __language__(code)
|
dev = __language__(code)
|
||||||
|
|
||||||
@@ -448,7 +396,7 @@ def verify_directories_created():
|
|||||||
for f in files:
|
for f in files:
|
||||||
if not filetools.exists(filetools.join(default, folder, f)) or \
|
if not filetools.exists(filetools.join(default, folder, f)) or \
|
||||||
(filetools.getsize(filetools.join(default, folder, f)) !=
|
(filetools.getsize(filetools.join(default, folder, f)) !=
|
||||||
filetools.getsize(filetools.join(default, '720p', f))):
|
filetools.getsize(filetools.join(default, '720p', f))):
|
||||||
filetools.copy(filetools.join(default, '720p', f),
|
filetools.copy(filetools.join(default, '720p', f),
|
||||||
filetools.join(default, folder, f),
|
filetools.join(default, folder, f),
|
||||||
True)
|
True)
|
||||||
|
|||||||
@@ -129,9 +129,9 @@ def run(item=None):
|
|||||||
|
|
||||||
# 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_pin") != "":
|
if channeltools.is_adult(item.channel) and config.get_setting("adult_request_password"):
|
||||||
tecleado = platformtools.dialog_input("", "Contraseña para canales de adultos", True)
|
tecleado = platformtools.dialog_input("", "Contraseña para canales de adultos", True)
|
||||||
if tecleado is None or tecleado != config.get_setting("adult_pin"):
|
if tecleado is None or tecleado != config.get_setting("adult_password"):
|
||||||
return
|
return
|
||||||
|
|
||||||
# # Actualiza el canal individual
|
# # Actualiza el canal individual
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
<setting id="adult_aux_new_password1" type="text" label="Nueva contraseña:" option="hidden" enable="!eq(-3,)" default=""/>
|
<setting id="adult_aux_new_password1" type="text" label="Nueva contraseña:" option="hidden" enable="!eq(-3,)" default=""/>
|
||||||
<setting id="adult_aux_new_password2" type="text" label="Confirmar nueva contraseña:" option="hidden" enable="!eq(-1,)" default=""/>
|
<setting id="adult_aux_new_password2" type="text" label="Confirmar nueva contraseña:" option="hidden" enable="!eq(-1,)" default=""/>
|
||||||
|
|
||||||
|
|
||||||
<!--<setting type="sep"/>-->
|
<!--<setting type="sep"/>-->
|
||||||
<!--<setting label="Actualizaciones" type="lsep"/>-->
|
<!--<setting label="Actualizaciones" type="lsep"/>-->
|
||||||
<!--<setting id="plugin_updates_available" type="number" label="Number of updates available" default="0" visible="false"/>-->
|
<!--<setting id="plugin_updates_available" type="number" label="Number of updates available" default="0" visible="false"/>-->
|
||||||
@@ -30,13 +29,6 @@
|
|||||||
|
|
||||||
<!-- Path downloads and subtitles -->
|
<!-- Path downloads and subtitles -->
|
||||||
<category label="30501">
|
<category label="30501">
|
||||||
<!--setting id="subtitulo" type="bool" label="30021" default="false"/>
|
|
||||||
<setting id="subtitle_type" type="enum" lvalues="30432|30434|30433" label ="30431" enable ="eq(-1,true)" default="0"/>
|
|
||||||
<setting id="subtitlepath_folder" type="folder" source="" enable = "eq(-1,0)+eq(-2,true)" label="30435" default=""/>
|
|
||||||
<setting id="subtitlepath_file" type="file" source="" enable = "eq(-2,2)+eq(-3,true)" label="30436" default=""/>
|
|
||||||
<setting id="subtitlepath_keyboard" type="text" enable ="eq(-3,1)+eq(-4,true)" label="30437" default=""/>
|
|
||||||
<setting type="sep"/-->
|
|
||||||
|
|
||||||
<setting id="path_selection" type="enum" values="Escribir ruta|Examinar ruta" default="0" label="Tipo de ruta"/>
|
<setting id="path_selection" type="enum" values="Escribir ruta|Examinar ruta" default="0" label="Tipo de ruta"/>
|
||||||
<setting id="downloadpath" type="text" label="30017" default="" visible="eq(-1,0)"/>
|
<setting id="downloadpath" type="text" label="30017" default="" visible="eq(-1,0)"/>
|
||||||
<setting id="downloadpath" type="folder" label="30017" default="" visible="eq(-2,1)"/>
|
<setting id="downloadpath" type="folder" label="30017" default="" visible="eq(-2,1)"/>
|
||||||
@@ -54,14 +46,6 @@
|
|||||||
</category>
|
</category>
|
||||||
|
|
||||||
<category label="Otros"><!--30503 -->
|
<category label="Otros"><!--30503 -->
|
||||||
<!--
|
|
||||||
<setting label="Filtros" type="lsep"/>
|
|
||||||
<setting id="filter_servers" type="bool" label="30068" default="false"/>
|
|
||||||
|
|
||||||
<setting label="30071" type="lsep"/>
|
|
||||||
<setting id="whitelist" type="text" label="30069" enable="eq(-2,true)" default=""/>
|
|
||||||
<setting id="blacklist" type="text" label="30070" enable="eq(-3,true)" default=""/>
|
|
||||||
-->
|
|
||||||
<setting label="Info de películas/series en menú contextual" type="lsep"/>
|
<setting label="Info de películas/series en menú contextual" type="lsep"/>
|
||||||
<setting id="infoplus" type="bool" label="Mostrar opción Infoplus:" default="true"/>
|
<setting id="infoplus" type="bool" label="Mostrar opción Infoplus:" default="true"/>
|
||||||
<setting id="extended_info" type="bool" label="Mostrar opción ExtendedInfo (Necesario addon externo):" default="false"/>
|
<setting id="extended_info" type="bool" label="Mostrar opción ExtendedInfo (Necesario addon externo):" default="false"/>
|
||||||
|
|||||||
Executable → Regular
+1
@@ -40,6 +40,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
matches = scrapertools.find_multiple_matches(data, "<script type='text/javascript'>(.*?)</script>")
|
matches = scrapertools.find_multiple_matches(data, "<script type='text/javascript'>(.*?)</script>")
|
||||||
|
m = ""
|
||||||
for n, m in enumerate(matches):
|
for n, m in enumerate(matches):
|
||||||
if m.startswith("eval"):
|
if m.startswith("eval"):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Executable → Regular
+11
-5
@@ -1,17 +1,23 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from core import httptools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
|
from lib import jsunpack
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
|
||||||
|
|
||||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||||
logger.info("(page_url='%s')" % page_url)
|
logger.info("(page_url='%s')" % page_url)
|
||||||
|
|
||||||
data = scrapertools.cache_page(page_url)
|
data = re.sub(r"\n|\r|\t|\s{2}", "", httptools.downloadpage(page_url).data)
|
||||||
logger.info("data=" + data)
|
|
||||||
media_url = scrapertools.find_single_match(data, '"file": "(.+?)"')
|
match = scrapertools.find_single_match(data, "<script type='text/javascript'>(.*?)</script>")
|
||||||
logger.info("media_url=" + media_url)
|
data = jsunpack.unpack(match)
|
||||||
media_url = media_url.replace("?start=0", "")
|
data = data.replace("\\'", "'")
|
||||||
|
|
||||||
|
media_url = scrapertools.find_single_match(data, '{type:"video/mp4",src:"([^"]+)"}')
|
||||||
logger.info("media_url=" + media_url)
|
logger.info("media_url=" + media_url)
|
||||||
|
|
||||||
video_urls = list()
|
video_urls = list()
|
||||||
|
|||||||
Executable → Regular
+2
-2
@@ -52,7 +52,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
numeros = scrapertools.find_multiple_matches(data,
|
numeros = scrapertools.find_multiple_matches(data,
|
||||||
'_[A-f0-9]+x[A-f0-9]+\s*(?:=|\^)\s*([0-9]{4,}|0x[A-f0-9]{4,})')
|
'_[A-f0-9]+x[A-f0-9]+\s*(?:=|\^)\s*([0-9]{4,}|0x[A-f0-9]{4,})')
|
||||||
op1, op2 = scrapertools.find_single_match(data, '\(0x(\d),0x(\d)\);')
|
op1, op2 = scrapertools.find_single_match(data, '\(0x(\d),0x(\d)\);')
|
||||||
|
idparse = scrapertools.find_single_match(data, "\^parseInt\('([0-9]+)'")
|
||||||
videourl = ""
|
videourl = ""
|
||||||
for encode in var_encodes:
|
for encode in var_encodes:
|
||||||
text_decode = ""
|
text_decode = ""
|
||||||
@@ -81,7 +81,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
if value3 < index1:
|
if value3 < index1:
|
||||||
break
|
break
|
||||||
|
|
||||||
value4 = value2 ^ decode1[j % (mult / 8)]
|
value4 = value2 ^ decode1[j % (mult / 8)] ^ int(idparse,8)
|
||||||
for n in numeros:
|
for n in numeros:
|
||||||
if not n.isdigit():
|
if not n.isdigit():
|
||||||
n = int(n, 16)
|
n = int(n, 16)
|
||||||
|
|||||||
@@ -235,12 +235,10 @@ if __name__ == "__main__":
|
|||||||
import xbmc
|
import xbmc
|
||||||
|
|
||||||
# modo adulto:
|
# modo adulto:
|
||||||
# Conversion de False y True al sitema actual 0: Nunca, 1:Siempre, 2:Solo hasta que se reinicie Kodi
|
# sistema actual 0: Nunca, 1:Siempre, 2:Solo hasta que se reinicie Kodi
|
||||||
# y si es == 2 lo desactivamos.
|
# si es == 2 lo desactivamos.
|
||||||
if config.get_setting("adult_mode") == False or config.get_setting("adult_mode") == 2:
|
if config.get_setting("adult_mode") == 2:
|
||||||
config.set_setting("adult_mode", 0)
|
config.set_setting("adult_mode", 0)
|
||||||
elif config.get_setting("adult_mode") == True:
|
|
||||||
config.set_setting("adult_mode", 1)
|
|
||||||
|
|
||||||
update_wait = [0, 10000, 20000, 30000, 60000]
|
update_wait = [0, 10000, 20000, 30000, 60000]
|
||||||
wait = update_wait[int(config.get_setting("update_wait", "videolibrary"))]
|
wait = update_wait[int(config.get_setting("update_wait", "videolibrary"))]
|
||||||
|
|||||||
Reference in New Issue
Block a user