[^<]+<[iframe|IFRAME].*?[src|SRC]="([^"]+)"'
+
+ patron = '<(?:iframe)?(?:IFRAME)?\s*(?:src)?(?:SRC)?="([^"]+)"'
matches = re.compile(patron, re.DOTALL).findall(data)
for url in matches:
diff --git a/plugin.video.alfa/channels/inkapelis.py b/plugin.video.alfa/channels/inkapelis.py
index ca8863cf..29d7bf2f 100755
--- a/plugin.video.alfa/channels/inkapelis.py
+++ b/plugin.video.alfa/channels/inkapelis.py
@@ -101,7 +101,7 @@ def generos(item):
matches = scrapertools.find_multiple_matches(data, '
(.*?)')
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))
elif (scrapedtitle != "Estrenos ") and (scrapedtitle != "Próximos Estrenos "):
itemlist.append(item.clone(action="entradas", title=scrapedtitle, url=scrapedurl))
diff --git a/plugin.video.alfa/channels/locopelis.json b/plugin.video.alfa/channels/locopelis.json
index 728a30dd..d5df7370 100755
--- a/plugin.video.alfa/channels/locopelis.json
+++ b/plugin.video.alfa/channels/locopelis.json
@@ -52,7 +52,7 @@
"default": 0,
"enabled": true,
"visible": true,
- "llvalues": [
+ "lvalues": [
"No filtrar",
"Latino",
"Español",
@@ -76,4 +76,4 @@
"visible": true
}
]
-}
\ No newline at end of file
+}
diff --git a/plugin.video.alfa/channels/search.py b/plugin.video.alfa/channels/search.py
index d9a05f5b..4ae621fc 100644
--- a/plugin.video.alfa/channels/search.py
+++ b/plugin.video.alfa/channels/search.py
@@ -222,7 +222,7 @@ def show_result(item):
if item.adult and config.get_setting("adult_request_password"):
# Solicitar contraseña
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 []
item.channel = item.__dict__.pop('from_channel')
diff --git a/plugin.video.alfa/channels/ver-peliculas.json b/plugin.video.alfa/channels/ver-peliculas.json
index a2436e87..ba3889f4 100644
--- a/plugin.video.alfa/channels/ver-peliculas.json
+++ b/plugin.video.alfa/channels/ver-peliculas.json
@@ -10,5 +10,16 @@
"categories": [
"movie",
"latino"
+ ],
+ "settings": [
+ {
+ "id": "modo_grafico",
+ "type": "bool",
+ "label": "Buscar información extra",
+ "default": true,
+ "enabled": true,
+ "visible": true
+ }
]
-}
\ No newline at end of file
+
+}
diff --git a/plugin.video.alfa/channels/ver-peliculas.py b/plugin.video.alfa/channels/ver-peliculas.py
index f3fdfdee..fcbd3059 100644
--- a/plugin.video.alfa/channels/ver-peliculas.py
+++ b/plugin.video.alfa/channels/ver-peliculas.py
@@ -14,9 +14,16 @@ from core import scrapertools
from core import servertools
from core.item import Item
from platformcode import config, logger
+from core import tmdb
+
+__channel__ = "ver-peliculas"
host = "http://ver-peliculas.org/"
+try:
+ __modo_grafico__ = config.get_setting('modo_grafico', __channel__)
+except:
+ __modo_grafico__ = True
def mainlist(item):
logger.info()
@@ -115,19 +122,22 @@ def listado(item):
logger.info()
itemlist = []
data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data)
- logger.debug(data)
+ # logger.debug(data)
pattern = ']+>(.*?)')
if pagination:
@@ -140,6 +150,13 @@ def listado(item):
url=url,
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, '([^<]+)
').strip()
+ item.fanart = scrapertools.find_single_match(data, '')
+
+
return itemlist
diff --git a/plugin.video.alfa/channels/x18hentai.py b/plugin.video.alfa/channels/x18hentai.py
index 5ed87510..b76e8605 100755
--- a/plugin.video.alfa/channels/x18hentai.py
+++ b/plugin.video.alfa/channels/x18hentai.py
@@ -6,8 +6,9 @@ from core import httptools
from core import scrapertools
from core.item import Item
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'],
['Referer', host]]
@@ -92,17 +93,58 @@ def episodios(item):
logger.info()
itemlist = []
data = httptools.downloadpage(item.url, headers=headers).data
- patron = '([^<]+)<\/td>. | ([^<]+)<\/td>. | ([^<]+)<\/td>. | ([^<]+)<\/td>. | Ver Capitulo<\/a><\/td>'
+ old_mode = scrapertools.find_single_match(data, ' | Censura<\/th>')
+ if old_mode:
+ patron = ' | (\d+)<\/td> | (.*?)<\/td> | (.*?)<\/td> | (.*?)<\/td> | 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:
- url = scrapedurl
- title = 'CAPITULO ' + scrapedcap + ' AUDIO: ' + scrapedaud + ' SUB:' + scrapedsub + ' ' + censura[scrapedcen]
- thumbnail = ''
- plot = ''
- fanart = ''
- itemlist.append(Item(channel=item.channel, action="findvideos", title=title, fulltitle=item.fulltitle, url=url,
- thumbnail=item.thumbnail, plot=plot))
+ for scrapedcap, scrapedaud, scrapedsub, scrapedcen, scrapedurl in matches:
+ url = scrapedurl
+ title = 'CAPITULO ' + scrapedcap + ' AUDIO: ' + scrapedaud + ' SUB:' + scrapedsub + ' ' + censura[scrapedcen]
+ thumbnail = ''
+ plot = ''
+ fanart = ''
+ itemlist.append(Item(channel=item.channel, action="findvideos", title=title, fulltitle=item.fulltitle, url=url,
+ thumbnail=item.thumbnail, plot=plot))
+ else:
+ patron = '<\/i>.*?(.\d+)<\/td> | MP4<\/td> | (.*?)<\/td>.*?'
+ patron +=''
+
+ 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
+
+def findvideos(item):
+ logger.info()
+
+ itemlist = []
+ data = httptools.downloadpage(item.url).data
+ gvideo = scrapertools.find_single_match(data,'')
+ 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
+
+
diff --git a/plugin.video.alfa/core/channeltools.py b/plugin.video.alfa/core/channeltools.py
index f6984f13..98235c24 100755
--- a/plugin.video.alfa/core/channeltools.py
+++ b/plugin.video.alfa/core/channeltools.py
@@ -138,17 +138,18 @@ def get_channel_parameters(channel_name):
def get_channel_json(channel_name):
# logger.info("channel_name=" + channel_name)
import filetools
+ channel_json = None
try:
channel_path = filetools.join(config.get_runtime_path(), "channels", channel_name + ".json")
- # logger.info("channel_data=" + channel_path)
- channel_json = jsontools.load(filetools.read(channel_path))
- # logger.info("channel_json= %s" % channel_json)
+ if filetools.isfile(channel_path):
+ # logger.info("channel_data=" + channel_path)
+ channel_json = jsontools.load(filetools.read(channel_path))
+ # logger.info("channel_json= %s" % channel_json)
except Exception, ex:
template = "An exception of type %s occured. Arguments:\n%r"
message = template % (type(ex).__name__, ex.args)
logger.error(" %s" % message)
- channel_json = None
return channel_json
@@ -187,10 +188,10 @@ def get_channel_setting(name, channel, default=None):
@param channel: nombre del canal
@type channel: str
@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'
- @rtype: El tipo del valor del parametro
+ @rtype: any
"""
file_settings = os.path.join(config.get_data_path(), "settings_channels", channel + "_data.json")
diff --git a/plugin.video.alfa/core/filetools.py b/plugin.video.alfa/core/filetools.py
index 4bfc111f..346307e5 100755
--- a/plugin.video.alfa/core/filetools.py
+++ b/plugin.video.alfa/core/filetools.py
@@ -446,7 +446,9 @@ def mkdir(path):
except:
logger.error("ERROR al crear el directorio: %s" % path)
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
else:
return True
diff --git a/plugin.video.alfa/core/scraper.py b/plugin.video.alfa/core/scraper.py
index 0e7b6760..1dcef673 100755
--- a/plugin.video.alfa/core/scraper.py
+++ b/plugin.video.alfa/core/scraper.py
@@ -188,7 +188,7 @@ def cuadro_completar(item):
'visible': True})
# 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",
custom_button={"visible": False}):
return True
diff --git a/plugin.video.alfa/core/servertools.py b/plugin.video.alfa/core/servertools.py
index ffd1698c..631101c8 100644
--- a/plugin.video.alfa/core/servertools.py
+++ b/plugin.video.alfa/core/servertools.py
@@ -565,10 +565,10 @@ def get_server_setting(name, server, default=None):
@param server: nombre del servidor
@type server: str
@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'
- @rtype: El tipo del valor del parametro
+ @rtype: any
"""
# Creamos la carpeta si no existe
diff --git a/plugin.video.alfa/core/versiontools.py b/plugin.video.alfa/core/versiontools.py
index 0469570c..0846b841 100755
--- a/plugin.video.alfa/core/versiontools.py
+++ b/plugin.video.alfa/core/versiontools.py
@@ -14,11 +14,11 @@ def get_current_plugin_version():
def get_current_plugin_version_tag():
- return "4.3.0-beta1"
+ return "1.7.0"
def get_current_plugin_date():
- return "30/06/2017"
+ return "22/08/2017"
def get_current_channels_version():
diff --git a/plugin.video.alfa/platformcode/config.py b/plugin.video.alfa/platformcode/config.py
index 47b19146..2ca5f15f 100644
--- a/plugin.video.alfa/platformcode/config.py
+++ b/plugin.video.alfa/platformcode/config.py
@@ -8,7 +8,6 @@ import re
import xbmc
import xbmcaddon
-import xbmcgui
PLUGIN_NAME = "alfa"
@@ -112,17 +111,11 @@ def open_settings():
# Cambio de contraseña
if settings_post['adult_aux_new_password1']:
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:
platformtools.dialog_ok("Canales para adultos",
- "Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden.",
- "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)
+ "Los campos 'Nueva contraseña' y 'Confirmar nueva contraseña' no coinciden."
+ , "Entre de nuevo en 'Preferencias' para cambiar la contraseña")
else:
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
# automaticamente si configurar la videoteca
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_tvshows", None) != settings_post.get("folder_tvshows", None):
+ 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):
verify_directories_created()
else:
@@ -156,13 +149,13 @@ def get_setting(name, channel="", server="", default=None):
"""
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'.
- 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
+ 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
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.
@param name: nombre del parametro
@@ -172,10 +165,10 @@ def get_setting(name, channel="", server="", default=None):
@param server: nombre del servidor
@type server: str
@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'
- @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)
# hack para devolver el tipo correspondiente
- settings_types = get_settings_types()
-
- if settings_types.get(name) in ['enum', 'number']:
- try:
- value = int(value)
- except Exception, ex:
- from platformcode import logger
- logger.error("Error al convertir '%s' de tipo 'enum','number' \n%s" % (name, ex))
-
- elif settings_types.get(name) == 'bool':
- value = value == 'true'
-
- elif name not in settings_types:
- try:
- if value in ['true', 'false']:
- 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
+ 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
+ return value
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)
else:
try:
- settings_types = get_settings_types()
-
- if settings_types.get(name) == 'bool':
+ if isinstance(value, bool):
if value:
- new_value = "true"
+ value = "true"
else:
- new_value = "false"
+ value = "false"
- elif settings_types.get(name):
- new_value = str(value)
+ elif isinstance(value, (int, long)):
+ 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__.setSetting(name, new_value)
+ __settings__.setSetting(name, value)
except Exception, ex:
from platformcode import logger
@@ -297,28 +267,6 @@ def set_setting(name, value, channel="", server=""):
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('
-
@@ -30,13 +29,6 @@
-
-
@@ -54,14 +46,6 @@
-
diff --git a/plugin.video.alfa/servers/flashx.py b/plugin.video.alfa/servers/flashx.py
old mode 100755
new mode 100644
index dcbb8765..e15d493c
--- a/plugin.video.alfa/servers/flashx.py
+++ b/plugin.video.alfa/servers/flashx.py
@@ -40,6 +40,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
pass
matches = scrapertools.find_multiple_matches(data, "")
+ m = ""
for n, m in enumerate(matches):
if m.startswith("eval"):
try:
diff --git a/plugin.video.alfa/servers/mp4upload.py b/plugin.video.alfa/servers/mp4upload.py
old mode 100755
new mode 100644
index 39b27a56..2efbcf56
--- a/plugin.video.alfa/servers/mp4upload.py
+++ b/plugin.video.alfa/servers/mp4upload.py
@@ -1,17 +1,23 @@
# -*- coding: utf-8 -*-
+import re
+
+from core import httptools
from core import scrapertools
+from lib import jsunpack
from platformcode import logger
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.info("(page_url='%s')" % page_url)
- data = scrapertools.cache_page(page_url)
- logger.info("data=" + data)
- media_url = scrapertools.find_single_match(data, '"file": "(.+?)"')
- logger.info("media_url=" + media_url)
- media_url = media_url.replace("?start=0", "")
+ data = re.sub(r"\n|\r|\t|\s{2}", "", httptools.downloadpage(page_url).data)
+
+ match = scrapertools.find_single_match(data, "")
+ data = jsunpack.unpack(match)
+ data = data.replace("\\'", "'")
+
+ media_url = scrapertools.find_single_match(data, '{type:"video/mp4",src:"([^"]+)"}')
logger.info("media_url=" + media_url)
video_urls = list()
diff --git a/plugin.video.alfa/servers/openload.py b/plugin.video.alfa/servers/openload.py
old mode 100755
new mode 100644
index 20726a4a..9baff26c
--- a/plugin.video.alfa/servers/openload.py
+++ b/plugin.video.alfa/servers/openload.py
@@ -52,7 +52,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
numeros = scrapertools.find_multiple_matches(data,
'_[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)\);')
-
+ idparse = scrapertools.find_single_match(data, "\^parseInt\('([0-9]+)'")
videourl = ""
for encode in var_encodes:
text_decode = ""
@@ -81,7 +81,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
if value3 < index1:
break
- value4 = value2 ^ decode1[j % (mult / 8)]
+ value4 = value2 ^ decode1[j % (mult / 8)] ^ int(idparse,8)
for n in numeros:
if not n.isdigit():
n = int(n, 16)
diff --git a/plugin.video.alfa/videolibrary_service.py b/plugin.video.alfa/videolibrary_service.py
index a6f57dee..1252fd80 100644
--- a/plugin.video.alfa/videolibrary_service.py
+++ b/plugin.video.alfa/videolibrary_service.py
@@ -235,12 +235,10 @@ if __name__ == "__main__":
import xbmc
# modo adulto:
- # Conversion de False y True al sitema actual 0: Nunca, 1:Siempre, 2:Solo hasta que se reinicie Kodi
- # y si es == 2 lo desactivamos.
- if config.get_setting("adult_mode") == False or config.get_setting("adult_mode") == 2:
+ # sistema actual 0: Nunca, 1:Siempre, 2:Solo hasta que se reinicie Kodi
+ # si es == 2 lo desactivamos.
+ if config.get_setting("adult_mode") == 2:
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]
wait = update_wait[int(config.get_setting("update_wait", "videolibrary"))]
|