Merge remote-tracking branch 'alfa-addon/master'

This commit is contained in:
unknown
2017-09-16 22:44:21 -03:00
21 changed files with 471 additions and 480 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.alfa" name="Alfa" version="2.0.2" provider-name="Alfa Addon">
<addon id="plugin.video.alfa" name="Alfa" version="2.0.3" provider-name="Alfa Addon">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.libtorrent" optional="true"/>
@@ -19,15 +19,17 @@
</assets>
<news>[B]Estos son los cambios para esta versión:[/B]
[COLOR green][B]Canales agregados y arreglos[/B][/COLOR]
» anitoonstv » qserie
» cartoonlatino » repelis
» seriesblanco » seodiv
» serieslan » pelisplanet
» seriesmeme » pepecine
» peliscity » pelisporno
» okru » vimpleru
» hdfull » ecartelera
» seriesdanko » serieslatino
» seriesblanco » seriespapaya
» sipeliculas » torrentlocura
» ultrapeliculashd » verpelis
» ver-peliculas » verseriesonlinetv
» flashx » vixto
» fastplay » streamcherry
» rapidvideo » streamplay
¤ fix internos
[COLOR green]Gracias a [COLOR yellow]danielr460[/COLOR] por su colaboración en esta versión[/COLOR]
[COLOR green]Gracias a [COLOR yellow]msdos[/COLOR] y [COLOR yellow]m588416[/COLOR] por su colaboración en esta versión[/COLOR]
</news>
<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>

View File

@@ -111,6 +111,8 @@ def findvideos(item):
match = scrapertools.find_multiple_matches(bloque, '(?is)(?:iframe|script) .*?src="([^"]+)')
for url in match:
titulo = "Ver en: %s"
if "goo.gl" in url:
url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "")
if "youtube" in url:
titulo = "[COLOR = yellow]Ver trailer: %s[/COLOR]"
if "ad.js" in url or "script" in url:
@@ -123,7 +125,6 @@ def findvideos(item):
title = titulo,
fulltitle = item.fulltitle,
thumbnail = item.thumbnail,
server = "",
url = url
))
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())

View File

@@ -43,6 +43,10 @@ def show_option(channel, itemlist, text_color='yellow', thumbnail=None, fanart=N
:return:
'''
logger.info()
if not config.is_xbmc():
return itemlist
if thumbnail == None:
thumbnail = 'https://s7.postimg.org/65ooga04b/Auto_Play.png'
if fanart == None:
@@ -74,228 +78,231 @@ def start(itemlist, item):
:return: intenta autoreproducir, en caso de fallar devuelve el itemlist que recibio en un principio
'''
logger.info()
global autoplay_node
if not config.is_xbmc():
platformtools.dialog_notification('AutoPlay ERROR', 'Sólo disponible para XBMC/Kodi')
#platformtools.dialog_notification('AutoPlay ERROR', 'Sólo disponible para XBMC/Kodi')
return itemlist
else:
if not autoplay_node:
# Obtiene el nodo AUTOPLAY desde el json
autoplay_node = jsontools.get_node_from_file('autoplay', 'AUTOPLAY')
# Agrega servidores y calidades que no estaban listados a autoplay_node
new_options = check_value(item.channel, itemlist)
global autoplay_node
if not autoplay_node:
# Obtiene el nodo AUTOPLAY desde el json
autoplay_node = jsontools.get_node_from_file('autoplay', 'AUTOPLAY')
# Obtiene el nodo del canal desde autoplay_node
channel_node = autoplay_node.get(item.channel, {})
# Obtiene los ajustes des autoplay para este canal
settings_node = channel_node.get('settings', {})
if not item.channel in autoplay_node:
return itemlist
if settings_node['active']:
url_list_valid = []
autoplay_list = []
favorite_servers = []
favorite_quality = []
# Agrega servidores y calidades que no estaban listados a autoplay_node
new_options = check_value(item.channel, itemlist)
# Guarda el valor actual de "Accion y Player Mode" en preferencias
user_config_setting_action = config.get_setting("default_action")
user_config_setting_player = config.get_setting("player_mode")
# Habilita la accion "Ver en calidad alta" (si el servidor devuelve más de una calidad p.e. gdrive)
if user_config_setting_action != 2:
config.set_setting("default_action", 2)
if user_config_setting_player != 0:
config.set_setting("player_mode", 0)
# Obtiene el nodo del canal desde autoplay_node
channel_node = autoplay_node.get(item.channel, {})
# Obtiene los ajustes des autoplay para este canal
settings_node = channel_node.get('settings', {})
# Informa que AutoPlay esta activo
platformtools.dialog_notification('AutoPlay Activo', '', sound=False)
if settings_node['active']:
url_list_valid = []
autoplay_list = []
favorite_servers = []
favorite_quality = []
# Prioridades a la hora de ordenar itemlist:
# 0: Servidores y calidades
# 1: Calidades y servidores
# 2: Solo servidores
# 3: Solo calidades
# 4: No ordenar
if settings_node['custom_servers'] and settings_node['custom_quality']:
priority = settings_node['priority'] # 0: Servidores y calidades o 1: Calidades y servidores
elif settings_node['custom_servers']:
priority = 2 # Solo servidores
elif settings_node['custom_quality']:
priority = 3 # Solo calidades
else:
priority = 4 # No ordenar
# Guarda el valor actual de "Accion y Player Mode" en preferencias
user_config_setting_action = config.get_setting("default_action")
user_config_setting_player = config.get_setting("player_mode")
# Habilita la accion "Ver en calidad alta" (si el servidor devuelve más de una calidad p.e. gdrive)
if user_config_setting_action != 2:
config.set_setting("default_action", 2)
if user_config_setting_player != 0:
config.set_setting("player_mode", 0)
# Obtiene las listas servidores, calidades disponibles desde el nodo del json de AutoPlay
server_list = channel_node.get('servers', [])
quality_list = channel_node.get('quality', [])
# Informa que AutoPlay esta activo
platformtools.dialog_notification('AutoPlay Activo', '', sound=False)
# Se guardan los textos de cada servidor y calidad en listas p.e. favorite_servers = ['openload',
# 'streamcloud']
for num in range(1, 4):
favorite_servers.append(channel_node['servers'][settings_node['server_%s' % num]])
favorite_quality.append(channel_node['quality'][settings_node['quality_%s' % num]])
# Prioridades a la hora de ordenar itemlist:
# 0: Servidores y calidades
# 1: Calidades y servidores
# 2: Solo servidores
# 3: Solo calidades
# 4: No ordenar
if settings_node['custom_servers'] and settings_node['custom_quality']:
priority = settings_node['priority'] # 0: Servidores y calidades o 1: Calidades y servidores
elif settings_node['custom_servers']:
priority = 2 # Solo servidores
elif settings_node['custom_quality']:
priority = 3 # Solo calidades
else:
priority = 4 # No ordenar
# Se filtran los enlaces de itemlist y que se correspondan con los valores de autoplay
for item in itemlist:
autoplay_elem = dict()
# Obtiene las listas servidores, calidades disponibles desde el nodo del json de AutoPlay
server_list = channel_node.get('servers', [])
quality_list = channel_node.get('quality', [])
# Comprobamos q se trata de un item de video
if 'server' not in item:
# Se guardan los textos de cada servidor y calidad en listas p.e. favorite_servers = ['openload',
# 'streamcloud']
for num in range(1, 4):
favorite_servers.append(channel_node['servers'][settings_node['server_%s' % num]])
favorite_quality.append(channel_node['quality'][settings_node['quality_%s' % num]])
# Se filtran los enlaces de itemlist y que se correspondan con los valores de autoplay
for item in itemlist:
autoplay_elem = dict()
# Comprobamos q se trata de un item de video
if 'server' not in item:
continue
# Agrega la opcion configurar AutoPlay al menu contextual
if 'context' not in item:
item.context = list()
if not filter(lambda x: x['action'] == 'autoplay_config', context):
item.context.append({"title": "Configurar AutoPlay",
"action": "autoplay_config",
"channel": "autoplay",
"from_channel": item.channel})
# Si no tiene calidad definida le asigna calidad 'default'
if item.quality == '':
item.quality = 'default'
# Se crea la lista para configuracion personalizada
if priority < 2: # 0: Servidores y calidades o 1: Calidades y servidores
# si el servidor y la calidad no se encuentran en las listas de favoritos o la url esta repetida,
# descartamos el item
if item.server not in favorite_servers or item.quality not in favorite_quality \
or item.url in url_list_valid:
continue
# Agrega la opcion configurar AutoPlay al menu contextual
if 'context' not in item:
item.context = list()
if not filter(lambda x: x['action'] == 'autoplay_config', context):
item.context.append({"title": "Configurar AutoPlay",
"action": "autoplay_config",
"channel": "autoplay",
"from_channel": item.channel})
# Si no tiene calidad definida le asigna calidad 'default'
if item.quality == '':
item.quality = 'default'
# Se crea la lista para configuracion personalizada
if priority < 2: # 0: Servidores y calidades o 1: Calidades y servidores
# si el servidor y la calidad no se encuentran en las listas de favoritos o la url esta repetida,
# descartamos el item
if item.server not in favorite_servers or item.quality not in favorite_quality \
or item.url in url_list_valid:
continue
autoplay_elem["indice_server"] = favorite_servers.index(item.server)
autoplay_elem["indice_quality"] = favorite_quality.index(item.quality)
elif priority == 2: # Solo servidores
# si el servidor no se encuentra en la lista de favoritos o la url esta repetida,
# descartamos el item
if item.server not in favorite_servers or item.url in url_list_valid:
continue
autoplay_elem["indice_server"] = favorite_servers.index(item.server)
elif priority == 3: # Solo calidades
# si la calidad no se encuentra en la lista de favoritos o la url esta repetida,
# descartamos el item
if item.quality not in favorite_quality or item.url in url_list_valid:
continue
autoplay_elem["indice_quality"] = favorite_quality.index(item.quality)
else: # No ordenar
# si la url esta repetida, descartamos el item
if item.url in url_list_valid:
continue
# Si el item llega hasta aqui lo añadimos al listado de urls validas y a autoplay_list
url_list_valid.append(item.url)
autoplay_elem['videoitem'] = item
# autoplay_elem['server'] = item.server
# autoplay_elem['quality'] = item.quality
autoplay_list.append(autoplay_elem)
# Ordenamos segun la prioridad
if priority == 0: # Servidores y calidades
autoplay_list.sort(key=lambda orden: (orden['indice_server'], orden['indice_quality']))
elif priority == 1: # Calidades y servidores
autoplay_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server']))
autoplay_elem["indice_server"] = favorite_servers.index(item.server)
autoplay_elem["indice_quality"] = favorite_quality.index(item.quality)
elif priority == 2: # Solo servidores
autoplay_list.sort(key=lambda orden: orden['indice_server'])
# si el servidor no se encuentra en la lista de favoritos o la url esta repetida,
# descartamos el item
if item.server not in favorite_servers or item.url in url_list_valid:
continue
autoplay_elem["indice_server"] = favorite_servers.index(item.server)
elif priority == 3: # Solo calidades
autoplay_list.sort(key=lambda orden: orden['indice_quality'])
# Si hay elementos en la lista de autoplay se intenta reproducir cada elemento, hasta encontrar uno
# funcional o fallen todos
if autoplay_list:
played = False
max_intentos = 5
max_intentos_servers = {}
# si la calidad no se encuentra en la lista de favoritos o la url esta repetida,
# descartamos el item
if item.quality not in favorite_quality or item.url in url_list_valid:
continue
autoplay_elem["indice_quality"] = favorite_quality.index(item.quality)
# Si se esta reproduciendo algo detiene la reproduccion
if platformtools.is_playing():
platformtools.stop_video()
else: # No ordenar
for autoplay_elem in autoplay_list:
if not platformtools.is_playing() and not played:
videoitem = autoplay_elem['videoitem']
# si la url esta repetida, descartamos el item
if item.url in url_list_valid:
continue
if videoitem.server not in max_intentos_servers:
# Si el item llega hasta aqui lo añadimos al listado de urls validas y a autoplay_list
url_list_valid.append(item.url)
autoplay_elem['videoitem'] = item
# autoplay_elem['server'] = item.server
# autoplay_elem['quality'] = item.quality
autoplay_list.append(autoplay_elem)
# Ordenamos segun la prioridad
if priority == 0: # Servidores y calidades
autoplay_list.sort(key=lambda orden: (orden['indice_server'], orden['indice_quality']))
elif priority == 1: # Calidades y servidores
autoplay_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server']))
elif priority == 2: # Solo servidores
autoplay_list.sort(key=lambda orden: orden['indice_server'])
elif priority == 3: # Solo calidades
autoplay_list.sort(key=lambda orden: orden['indice_quality'])
# Si hay elementos en la lista de autoplay se intenta reproducir cada elemento, hasta encontrar uno
# funcional o fallen todos
if autoplay_list:
played = False
max_intentos = 5
max_intentos_servers = {}
# Si se esta reproduciendo algo detiene la reproduccion
if platformtools.is_playing():
platformtools.stop_video()
for autoplay_elem in autoplay_list:
if not platformtools.is_playing() and not played:
videoitem = autoplay_elem['videoitem']
if videoitem.server not in max_intentos_servers:
max_intentos_servers[videoitem.server] = max_intentos
# Si se han alcanzado el numero maximo de intentos de este servidor saltamos al siguiente
if max_intentos_servers[videoitem.server] == 0:
continue
lang = " "
if hasattr(videoitem, 'language') and videoitem.language != "":
lang = " '%s' " % videoitem.language
platformtools.dialog_notification("AutoPlay", "%s%s%s" % (
videoitem.server.upper(), lang, videoitem.quality.upper()), sound=False)
# TODO videoitem.server es el id del server, pero podria no ser el nombre!!!
# Intenta reproducir los enlaces
# Si el canal tiene metodo play propio lo utiliza
channel = __import__('channels.%s' % item.channel, None, None, ["channels.%s" % item.channel])
if hasattr(channel, 'play'):
resolved_item = getattr(channel, 'play')(videoitem)
if len(resolved_item) > 0:
if isinstance(resolved_item[0], list):
videoitem.video_urls = resolved_item
else:
videoitem = resolved_item[0]
# si no directamente reproduce
platformtools.play_video(videoitem)
try:
if platformtools.is_playing():
played = True
break
except: # TODO evitar el informe de que el conector fallo o el video no se encuentra
logger.debug(str(len(autoplay_list)))
# Si hemos llegado hasta aqui es por q no se ha podido reproducir
max_intentos_servers[videoitem.server] -= 1
# Si se han alcanzado el numero maximo de intentos de este servidor
# preguntar si queremos seguir probando o lo ignoramos
if max_intentos_servers[videoitem.server] == 0:
text = "Parece que los enlaces de %s no estan funcionando." % videoitem.server.upper()
if not platformtools.dialog_yesno("AutoPlay", text,
"¿Desea ignorar todos los enlaces de este servidor?"):
max_intentos_servers[videoitem.server] = max_intentos
# Si se han alcanzado el numero maximo de intentos de este servidor saltamos al siguiente
if max_intentos_servers[videoitem.server] == 0:
continue
else:
platformtools.dialog_notification('AutoPlay No Fue Posible', 'No Hubo Coincidencias')
if new_options:
platformtools.dialog_notification("AutoPlay", "Nueva Calidad/Servidor disponible en la "
"configuracion", sound=False)
lang = " "
if hasattr(videoitem, 'language') and videoitem.language != "":
lang = " '%s' " % videoitem.language
# Restaura si es necesario el valor previo de "Accion y Player Mode" en preferencias
if user_config_setting_action != 2:
config.set_setting("default_action", user_config_setting_action)
if user_config_setting_player != 0:
config.set_setting("player_mode", user_config_setting_player)
platformtools.dialog_notification("AutoPlay", "%s%s%s" % (
videoitem.server.upper(), lang, videoitem.quality.upper()), sound=False)
# TODO videoitem.server es el id del server, pero podria no ser el nombre!!!
# Intenta reproducir los enlaces
# Si el canal tiene metodo play propio lo utiliza
channel = __import__('channels.%s' % item.channel, None, None, ["channels.%s" % item.channel])
if hasattr(channel, 'play'):
resolved_item = getattr(channel, 'play')(videoitem)
if len(resolved_item) > 0:
if isinstance(resolved_item[0], list):
videoitem.video_urls = resolved_item
else:
videoitem = resolved_item[0]
# si no directamente reproduce
platformtools.play_video(videoitem)
try:
if platformtools.is_playing():
played = True
break
except: # TODO evitar el informe de que el conector fallo o el video no se encuentra
logger.debug(str(len(autoplay_list)))
# Si hemos llegado hasta aqui es por q no se ha podido reproducir
max_intentos_servers[videoitem.server] -= 1
# Si se han alcanzado el numero maximo de intentos de este servidor
# preguntar si queremos seguir probando o lo ignoramos
if max_intentos_servers[videoitem.server] == 0:
text = "Parece que los enlaces de %s no estan funcionando." % videoitem.server.upper()
if not platformtools.dialog_yesno("AutoPlay", text,
"¿Desea ignorar todos los enlaces de este servidor?"):
max_intentos_servers[videoitem.server] = max_intentos
else:
platformtools.dialog_notification('AutoPlay No Fue Posible', 'No Hubo Coincidencias')
if new_options:
platformtools.dialog_notification("AutoPlay", "Nueva Calidad/Servidor disponible en la "
"configuracion", sound=False)
# Restaura si es necesario el valor previo de "Accion y Player Mode" en preferencias
if user_config_setting_action != 2:
config.set_setting("default_action", user_config_setting_action)
if user_config_setting_player != 0:
config.set_setting("player_mode", user_config_setting_player)
# devuelve la lista de enlaces para la eleccion manual
return itemlist
# devuelve la lista de enlaces para la eleccion manual
return itemlist
def init(channel, list_servers, list_quality):
'''
Comprueba la existencia de canal en el archivo de configuracion de Autoplay y si no existe lo añade.
Comprueba la existencia de canal en el archivo de configuracion de Autoplay y si no existe lo añade.
Es necesario llamar a esta funcion al entrar a cualquier canal que incluya la funcion Autoplay.
:param channel: (str) id del canal
:param list_servers: (list) lista inicial de servidores validos para el canal. No es necesario incluirlos todos,
:param list_servers: (list) lista inicial de servidores validos para el canal. No es necesario incluirlos todos,
ya que la lista de servidores validos se ira actualizando dinamicamente.
:param list_quality: (list) lista inicial de calidades validas para el canal. No es necesario incluirlas todas,
:param list_quality: (list) lista inicial de calidades validas para el canal. No es necesario incluirlas todas,
ya que la lista de calidades validas se ira actualizando dinamicamente.
:return: (bool) True si la inicializacion ha sido correcta.
'''
@@ -304,7 +311,7 @@ def init(channel, list_servers, list_quality):
result = True
if not config.is_xbmc():
platformtools.dialog_notification('AutoPlay ERROR', 'Sólo disponible para XBMC/Kodi')
# platformtools.dialog_notification('AutoPlay ERROR', 'Sólo disponible para XBMC/Kodi')
result = False
else:
autoplay_path = os.path.join(config.get_data_path(), "settings_channels", 'autoplay_data.json')
@@ -344,16 +351,12 @@ def init(channel, list_servers, list_quality):
if change:
result, json_data = jsontools.update_node(autoplay_node, 'autoplay', 'AUTOPLAY')
if result:
heading = "AutoPlay Disponible"
msj = "Seleccione '<Configurar AutoPlay>' para activarlo."
icon = 0
else:
if not result:
heading = "Error al iniciar AutoPlay"
msj = "Consulte su log para obtener mas información."
icon = 1
platformtools.dialog_notification(heading, msj, icon, sound=False)
platformtools.dialog_notification(heading, msj, icon, sound=False)
return result
@@ -517,9 +520,9 @@ def autoplay_config(item):
def save(item, dict_data_saved):
'''
Guarda los datos de la ventana de configuracion
:param item: item
:param dict_data_saved: dict
:param dict_data_saved: dict
:return:
'''
logger.info()

View File

@@ -41,7 +41,7 @@ def mainlist(item):
logger.debug("title=[" + title + "], url=[" + url + "], thumbnail=[" + thumbnail + "]")
itemlist.append(
Item(channel=item.channel, action="play", title=title, url=url, thumbnail=thumbnail, fanart=thumbnail,
plot=plot, server="directo", folder=False))
plot=plot,folder=False))
# ------------------------------------------------------
# Extrae la página siguiente

View File

@@ -273,13 +273,13 @@ def listado_series(item):
def fichas(item):
logger.info()
itemlist = []
textoidiomas=''
infoLabels=dict()
## Carga estados
status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data)
if item.title == "Buscar...":
data = agrupa_datos(httptools.downloadpage(item.url, post=item.extra).data)
s_p = scrapertools.get_match(data, '<h3 class="section-title">(.*?)<div id="footer-wrapper">').split(
'<h3 class="section-title">')
@@ -320,10 +320,12 @@ def fichas(item):
if scrapedlangs != ">":
textoidiomas = extrae_idiomas(scrapedlangs)
#Todo Quitar el idioma
title += bbcode_kodi2html(" ( [COLOR teal][B]" + textoidiomas + "[/B][/COLOR])")
if scrapedrating != ">":
valoracion = re.sub(r'><[^>]+>(\d+)<b class="dec">(\d+)</b>', r'\1,\2', scrapedrating)
infoLabels['rating']=valoracion
title += bbcode_kodi2html(" ([COLOR orange]" + valoracion + "[/COLOR])")
url = urlparse.urljoin(item.url, scrapedurl)
@@ -349,7 +351,7 @@ def fichas(item):
itemlist.append(
Item(channel=item.channel, action=action, title=title, url=url, fulltitle=title, thumbnail=thumbnail,
show=show, folder=True, contentType=contentType, contentTitle=contentTitle,
language =textoidiomas+'x'))
language =textoidiomas, infoLabels=infoLabels))
## Paginación
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)">.raquo;</a>')
@@ -794,11 +796,14 @@ def agrupa_datos(data):
def extrae_idiomas(bloqueidiomas):
logger.info("idiomas=" + bloqueidiomas)
# Todo cambiar por lista
#textoidiomas=[]
textoidiomas = ''
patronidiomas = '([a-z0-9]+).png"'
idiomas = re.compile(patronidiomas, re.DOTALL).findall(bloqueidiomas)
textoidiomas = ""
for idioma in idiomas:
textoidiomas = textoidiomas + idioma.upper() + " "
textoidiomas = textoidiomas + idioma +" "
#textoidiomas.append(idioma.upper())
return textoidiomas

View File

@@ -217,7 +217,7 @@ def episodios(item):
idiomas = " ".join(["[%s]" % IDIOMAS.get(language, "OVOS") for language in
re.findall("banderas/([^\.]+)", flags, re.MULTILINE)])
filter_lang = idiomas.replace("[", "").replace("]", "").split(" ")
display_title = "%s - %s" % (item.show, title)
display_title = "%s - %s %s" % (item.show, title, idiomas)
# logger.debug("Episode found %s: %s" % (display_title, urlparse.urljoin(HOST, url)))
itemlist.append(item.clone(title=display_title, url=urlparse.urljoin(HOST, url),
action="findvideos", plot=plot, fanart=fanart, language=filter_lang))

View File

@@ -40,7 +40,7 @@ def novedades(item):
data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;|<Br>|<BR>|<br>|<br/>|<br />|-\s", "", data)
data = re.sub(r"<!--.*?-->", "", data)
logger.debug(data)
patron = '<a title="([^"]+)" href="([^"]+)".*?>'
patron += "<img.*?src='([^']+)'"
matches = re.compile(patron, re.DOTALL).findall(data)
@@ -49,11 +49,19 @@ def novedades(item):
# patron = "^(.*?)(?:Ya Disponible|Disponible|Disponbile|disponible|\(Actualizada\))$"
# match = re.compile(patron, re.DOTALL).findall(scrapedtitle)
title = scrapertools.decodeHtmlentities(scrapedtitle)
language=''
# language = scrapertools.find_multiple_matches(title,'(Vose|Español|Latino)')
# for lang in language:
# title = title.replace(lang,'')
# title = title.replace ('Disponible','')
# title = title.replace('Ya', '')
# title = title.strip()
show = scrapertools.find_single_match(title, "^(.+?) \d+[x|X]\d+")
itemlist.append(Item(channel=item.channel, title=title, url=urlparse.urljoin(HOST, scrapedurl), show=show,
action="episodios", thumbnail=scrapedthumb,
context=filtertools.context(item, list_idiomas, CALIDADES)))
context=filtertools.context(item, list_idiomas, CALIDADES), language=language))
return itemlist
@@ -225,7 +233,7 @@ def parse_videos(item, tipo, data):
itemlist.append(Item(channel=item.channel, title=title, url=urlparse.urljoin(HOST, link), action="play",
show=item.show, language=IDIOMAS.get(language, "OVOS"), quality=quality,
fulltitle=item.title))
fulltitle=item.title, server=server))
return itemlist

4
plugin.video.alfa/channels/serieslatino.py Executable file → Normal file
View File

@@ -56,7 +56,7 @@ def mainlist(item):
autoplay.init(item.channel, list_servers, list_quality)
itemlist = []
itemlist.append(item.clone(title="Series", action="lista", thumbnail='https://s27.postimg.org/iahczwgrn/series.png',
itemlist.append(Item(channel= item.channel, title="Series", action="lista", thumbnail='https://s27.postimg.org/iahczwgrn/series.png',
fanart='https://s27.postimg.org/iahczwgrn/series.png', extra='peliculas/',
url=host + 'lista-de-series/'))
@@ -136,7 +136,7 @@ def temporadas(item):
itemlist.append(Item(channel=item.channel, action='episodiosxtemp', url=item.url, title=title,
contentSerieName=item.contentSerieName, thumbnail=thumbnail, plot=plot, fanart=fanart,
contentSeasonNumber=contentSeasonNumber, infoLabels=item.infoLabels))
contentSeasonNumber=contentSeasonNumber, infoLabels=infoLabels))
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
if config.get_videolibrary_support() and len(itemlist) > 0:

View File

@@ -11,12 +11,14 @@ from core import httptools
from core import jsontools
from core import scrapertools
from core import servertools
from core import tmdb
from core.item import Item
from platformcode import config, logger
HOST = "http://www.seriespapaya.com"
IDIOMAS = {'es': 'Español', 'lat': 'Latino', 'in': 'Inglés', 'ca': 'Catalán', 'sub': 'VOS'}
IDIOMAS = {'es': 'Español', 'lat': 'Latino', 'in': 'Inglés', 'ca': 'Catalán', 'sub': 'VOSE', 'Español Latino':'lat',
'Español Castellano':'es', 'Sub Español':'VOSE'}
list_idiomas = IDIOMAS.values()
CALIDADES = ['360p', '480p', '720p HD', '1080p HD']
@@ -67,22 +69,31 @@ def series_por_letra_y_grupo(item):
"letra": item.letter.lower()
}
data = httptools.downloadpage(url, post=urllib.urlencode(post_request)).data
data = re.sub(r'"|\n|\r|\t|&nbsp;|<br>|\s{2,}', "", data)
patron = '<div class=list_imagen><img src=(.*?) \/>.*?<div class=list_titulo><a href=(.*?) style=.*?inherit;>(.*?)'
patron +='<.*?justify>(.*?)<.*?Año:<\/b>.*?(\d{4})<'
matches = re.compile(patron, re.DOTALL).findall(data)
#series = re.findall(
# 'list_imagen.+?src="(?P<img>[^"]+).+?<div class="list_titulo"><a[^>]+href="(?P<url>[^"]+)[^>]+>(.*?)</a>', data,
# re.MULTILINE | re.DOTALL)
series = re.findall(
'list_imagen.+?src="(?P<img>[^"]+).+?<div class="list_titulo"><a[^>]+href="(?P<url>[^"]+)[^>]+>(.*?)</a>', data,
re.MULTILINE | re.DOTALL)
for img, url, name in series:
itemlist.append(item.clone(
for img, url, name, plot, year in matches:
new_item= Item(
channel = item.channel,
action="episodios",
title=name,
show=name,
url=urlparse.urljoin(HOST, url),
thumbnail=urlparse.urljoin(HOST, img),
context=filtertools.context(item, list_idiomas, CALIDADES)
))
context=filtertools.context(item, list_idiomas, CALIDADES),
plot = plot,
infoLabels={'year':year}
)
if year:
tmdb.set_infoLabels_item(new_item)
itemlist.append(new_item)
if len(series) == 8:
if len(matches) == 8:
itemlist.append(item.clone(title="Siguiente >>", action="series_por_letra_y_grupo", extra=item.extra + 1))
if item.extra > 0:
@@ -94,13 +105,16 @@ def series_por_letra_y_grupo(item):
def novedades(item):
logger.info()
data = httptools.downloadpage(HOST).data
shows = re.findall('sidebarestdiv[^<]+<a[^<]+title="([^"]*)[^<]+href="([^"]*)[^<]+<img[^<]+src="([^"]+)', data,
re.MULTILINE | re.DOTALL)
data = re.sub(r'"|\n|\r|\t|&nbsp;|<br>|\s{2,}', "", data)
patron = 'sidebarestdiv><a title=(.*?\d+X\d+) (.*?) href=(.*?)>.*?src=(.*?)>'
matches = re.compile(patron, re.DOTALL).findall(data)
itemlist = []
for title, url, img in shows:
itemlist.append(item.clone(action="findvideos", title=title, url=urlparse.urljoin(HOST, url), thumbnail=img))
for title, language,url, img in matches:
language = IDIOMAS[language]
itemlist.append(item.clone(action="findvideos", title=title, url=urlparse.urljoin(HOST, url), thumbnail=img,
language=language))
return itemlist
@@ -133,7 +147,6 @@ def episodios(item):
itemlist = []
for url, title, langs in episodes:
logger.debug("langs %s" % langs)
languages = " ".join(
["[%s]" % IDIOMAS.get(lang, lang) for lang in re.findall('images/s-([^\.]+)', langs)])
filter_lang = languages.replace("[", "").replace("]", "").split(" ")
@@ -206,6 +219,5 @@ def play(item):
logger.info("play: %s" % item.url)
data = httptools.downloadpage(item.url).data
video_url = scrapertools.find_single_match(data, "location.href='([^']+)")
logger.debug("Video URL = %s" % video_url)
itemlist = servertools.find_video_items(data=video_url)
return itemlist

View File

@@ -6,6 +6,7 @@ import urlparse
from core import httptools
from core import scrapertools
from core import servertools
from core import tmdb
from core.item import Item
from platformcode import logger
@@ -60,18 +61,18 @@ def lista(item):
logger.info()
itemlist = []
data = httptools.downloadpage(item.url).data
# data = re.sub(r'"|\n|\r|\t|&nbsp;|<br>', "", data)
listado = scrapertools.find_single_match(data,
'<div id="sipeliculas" class="borde"><div class="izquierda">(.*?)<div class="derecha"><h2')
logger.info('vergas' + listado)
patron = '<li class="[^"]+"><a class="[^"]+" href="([^"]+)" title="Ver Película([^"]+)"><i></i><img.*?src="([^"]+)" alt="[^"]+"/>(.*?)</li>'
matches = re.compile(patron, re.DOTALL).findall(listado)
for scrapedurl, scrapedtitle, scrapedthumbnail, dataplot in matches:
dataplot = scrapertools.find_single_match(data, '<div class="ttip"><h5>[^<]+</h5><p><span>([^<]+)</span>')
itemlist.append(Item(channel=item.channel, action='findvideos', title=scrapedtitle, url=scrapedurl,
thumbnail=scrapedthumbnail, plot=dataplot, contentTitle=scrapedtitle, extra=item.extra))
patron = '<a class="i" href="(.*?)".*?src="(.*?)".*?title=.*?>(.*?)<.*?span>(.*?)<.*?<p><span>(.*?)<'
matches = re.compile(patron, re.DOTALL).findall(listado)
for scrapedurl, scrapedthumbnail, scrapedtitle, year, plot in matches:
itemlist.append(Item(channel=item.channel, action='findvideos', title=scrapedtitle, url=scrapedurl,
thumbnail=scrapedthumbnail, plot=plot, contentTitle=scrapedtitle, extra=item.extra,
infoLabels ={'year':year}))
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
# Paginacion
if itemlist != []:
patron = '<li[^<]+<a href="([^"]+)" title="[^"]+">Siguiente[^<]+</a></li>'
@@ -96,22 +97,26 @@ def findvideos(item):
logger.info()
itemlist = []
data = httptools.downloadpage(item.url).data
# data = re.sub(r"'|\n|\r|\t|&nbsp;|<br>", "", data)
listado1 = scrapertools.find_single_match(data,
'<div class="links" id="ver-mas-opciones"><h2 class="h2"><i class="[^"]+"></i>[^<]+</h2><ul class="opciones">(.*?)</ul>')
patron1 = '<li ><a id="([^"]+)" rel="nofollow" href="([^"]+)" title="[^"]+" alt="([^"]+)"><span class="opcion"><i class="[^"]+"></i><u>[^<]+</u>[^<]+</span><span class="ico"><img src="[^"]+" alt="[^"]+"/>[^<]+</span><span>([^"]+)</span><span>([^"]+)</span></a></li>'
matches = matches = re.compile(patron1, re.DOTALL).findall(listado1)
for vidId, vidUrl, vidServer, idioma, calidad in matches:
for vidId, vidUrl, vidServer, language, quality in matches:
server = servertools.get_server_name(vidServer)
if 'Sub' in language:
language='sub'
itemlist.append(Item(channel=item.channel, action='play', url=vidUrl, extra=vidId,
title='Ver en ' + vidServer + ' | ' + idioma + ' | ' + calidad, thumbnail=item.thumbnail))
title='Ver en ' + vidServer + ' | ' + language + ' | ' + quality,
thumbnail=item.thumbnail, server=server, language=language, quality=quality ))
listado2 = scrapertools.find_single_match(data, '<ul class="opciones-tab">(.*?)</ul>')
patron2 = '<li ><a id="([^"]+)" rel="nofollow" href="([^"]+)" title="[^"]+" alt="([^"]+)"><img src="[^"]+" alt="[^"]+"/>[^<]+</a></li>'
matches = matches = re.compile(patron2, re.DOTALL).findall(listado2)
for vidId, vidUrl, vidServer in matches:
server = servertools.get_server_name(vidServer)
itemlist.append(Item(channel=item.channel, action='play', url=vidUrl, extra=vidId, title='Ver en ' + vidServer,
thumbnail=item.thumbnail))
thumbnail=item.thumbnail, server=server))
for videoitem in itemlist:
videoitem.fulltitle = item.title

View File

@@ -154,6 +154,9 @@ def listado(item):
replace("Descarga Serie HD", "", 1).strip()
show = title
#TODO quitar calidad del titulo
if quality:
title = "%s [%s]" % (title, quality)

View File

@@ -194,8 +194,25 @@ def findvideos(item):
patron = '<iframe class=metaframe rptss src=(.*?) frameborder=0 allowfullscreen><\/iframe>'
matches = matches = re.compile(patron, re.DOTALL).findall(data)
for videoitem in matches:
itemlist.extend(servertools.find_video_items(data=videoitem))
for video_url in matches:
# TODO Reparar directos
# if 'stream' in video_url:
# data = httptools.downloadpage('https:'+video_url).data
# new_url=scrapertools.find_single_match(data, 'iframe src="(.*?)"')
# new_data = httptools.downloadpage(new_url).data
# logger.debug(new_data)
#
# url, quality = scrapertools.find_single_match(new_data, "file:'(.*?)',label:'(.*?)'")
# headers_string = '|Referer=%s' % url
# url = url.replace('download', 'preview')+headers_string
# sub = scrapertools.find_single_match(new_data, "file:.*?'(.*?srt)'")
# new_item = (Item(title=item.title, url=url, quality=quality, server='directo',
# subtitle=sub))
# itemlist.append(new_item)
# else:
itemlist.extend(servertools.find_video_items(data=video_url))
for videoitem in itemlist:
videoitem.channel = item.channel
@@ -206,6 +223,7 @@ def findvideos(item):
if 'youtube' in videoitem.url:
videoitem.title = '[COLOR orange]Trailer en Youtube[/COLOR]'
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
itemlist.append(
Item(channel=item.channel, title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', url=item.url,

View File

@@ -4,6 +4,9 @@ import re
import urlparse
from core import scrapertools
from core import httptools
from core import servertools
from core import tmdb
from core.item import Item
from platformcode import config, logger
@@ -25,8 +28,8 @@ def mainlist(item):
url="http://www.vepelis.com/pelicula/ultimas-peliculas/ultimas/actualizadas",
extra="http://www.vepelis.com/pelicula/ultimas-peliculas/ultimas/actualizadas"))
itemlist.append(Item(channel=item.channel, title="Por Genero", action="generos", url="http://www.vepelis.com/"))
itemlist.append(
Item(channel=item.channel, title="Por Orden Alfabetico", action="alfabetico", url="http://www.vepelis.com/"))
itemlist.append(Item(channel=item.channel, title="Por Orden Alfabetico", action="alfabetico",
url="http://www.vepelis.com/"))
itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url="http://www.vepelis.com/"))
return itemlist
@@ -35,12 +38,16 @@ def listarpeliculas(item):
logger.info()
# Descarga la página
data = scrapertools.cachePage(item.url)
data = httptools.downloadpage(item.url).data
extra = item.extra
# Extrae las entradas de la pagina seleccionada
'''<td class="DarkText" align="center" valign="top" width="100px" height="160px" style="background-color:#1e1e1e;" onmouseover="this.style.backgroundColor='#000000'" onmouseout="this.style.backgroundColor='#1e1e1e'"><p style="margin-bottom: 3px;border-bottom:#ABABAB 1px solid">
<a href="http://www.peliculasaudiolatino.com/movies/Larry_Crowne.html"><img src="http://www.peliculasaudiolatino.com/poster/85x115/peliculas/movieimg/movie1317696842.jpg" alt="Larry Crowne" border="0" height="115" width="85"></a>'''
'''<td class="DarkText" align="center" valign="top" width="100px" height="160px"
style="background-color:#1e1e1e;" onmouseover="this.style.backgroundColor='#000000'"
onmouseout="this.style.backgroundColor='#1e1e1e'"><p style="margin-bottom: 3px;border-bottom:#ABABAB 1px solid">
<a href="http://www.peliculasaudiolatino.com/movies/Larry_Crowne.html"><img
src="http://www.peliculasaudiolatino.com/poster/85x115/peliculas/movieimg/movie1317696842.jpg"
alt="Larry Crowne" border="0" height="115" width="85"></a>'''
patron = '<td class=.*?<a '
patron += 'href="([^"]+)"><img src="([^"]+)" alt="([^"]+)"'
matches = re.compile(patron, re.DOTALL).findall(data)
@@ -54,9 +61,8 @@ def listarpeliculas(item):
logger.info(scrapedtitle)
# Añade al listado
itemlist.append(
Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle, url=scrapedurl,
thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
itemlist.append(Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle,
url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
# Extrae la marca de siguiente página
patron = 'Anterior.*? :: <a href="/../../.*?/page/([^"]+)">Siguiente '
@@ -69,8 +75,8 @@ def listarpeliculas(item):
scrapedplot = ""
itemlist.append(
Item(channel=item.channel, action="listarpeliculas", title=scrapedtitle, fulltitle=scrapedtitle,
url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
Item(channel=item.channel, action="listarpeliculas", title=scrapedtitle, fulltitle=scrapedtitle,
url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
return itemlist
@@ -78,77 +84,26 @@ def listarpeliculas(item):
def findvideos(item):
logger.info()
# Descarga la página
data = scrapertools.cachePage(item.url)
title = item.title
scrapedthumbnail = item.thumbnail
itemlist = []
patron = '<li><a href="#ms.*?">([^"]+)</a></li>.*?<iframe src="(.*?)"'
matches = re.compile(patron, re.DOTALL).findall(data)
# itemlist.append( Item(channel=item.channel, action="play", title=title , fulltitle=item.fulltitle, url=item.url , thumbnail=scrapedthumbnail , folder=False) )
data = httptools.downloadpage(item.url).data
for match in matches:
url = match[1]
title = "SERVIDOR: " + match[0]
title = unicode(title, "iso-8859-1", errors="replace").encode("utf-8")
itemlist.append(Item(channel=item.channel, action="play", title=title, fulltitle=item.fulltitle, url=url,
thumbnail=scrapedthumbnail, folder=False))
itemlist.extend(servertools.find_video_items(data=data))
return itemlist
def play(item):
logger.info()
itemlist = []
from core import servertools
itemlist = servertools.find_video_items(data=item.url)
for videoitem in itemlist:
videoitem.channel = item.channel
videoitem.action = "play"
videoitem.folder = False
videoitem.quality = item.quality
videoitem.language = item.language
videoitem.action = 'play'
return itemlist
# data2 = scrapertools.cache_page(item.url)
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/mv.php?url=","http://www.megavideo.com/?v=")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/videobb.php?url=","http://www.videobb.com/watch_video.php?v=")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/vidbux.php?url=","http://www.vidbux.com/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/vidxden.php?url=","http://www.vidxden.com/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/videozer.php?url=","http://www.videozer.com/video/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/v/pl/play.php?url=","http://www.putlocker.com/embed/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/v/mv/play.php?url=","http://www.modovideo.com/frame.php?v=")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/v/ss/play.php?url=","http://www.sockshare.com/embed/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/v/vb/play.php?url=","http://vidbull.com/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/sockshare.php?url=","http://www.sockshare.com/embed/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/moevide.php?url=","http://moevideo.net/?page=video&uid=")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/novamov.php?url=","http://www.novamov.com/video/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/movshare.php?url=","http://www.movshare.net/video/")
# data2 = data2.replace("http://www.peliculasaudiolatino.com/show/divxstage.php?url=","http://www.divxstage.net/video/")
# listavideos = servertools.findvideos(data2)
# for video in listavideos:
# invalid = video[1]
# invalid = invalid[0:8]
# if invalid!= "FN3WE43K" and invalid!="9CC3F8&e":
# scrapedtitle = item.title+video[0]
# videourl = item.url
# server = video[2]
# if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+videourl+"]")
# logger.info("url=" + item.url)
# Añade al listado de XBMC
# itemlist.append( Item(channel=item.channel, action="play", title=scrapedtitle , fulltitle=item.fulltitle, url=videourl , server=server , folder=False) )
# itemlist.append( Item(channel=item.channel, action="play" , title=item.title , url=item.url, thumbnail="", plot="", server=item.url))
# return itemlist
def generos(item):
logger.info()
itemlist = []
# Descarga la página
data = scrapertools.cachePage(item.url)
data = httptools.downloadpage(item.url).data
patron = '>.*?<li><a title="(.*?)" href="(.*?)"'
matches = re.compile(patron, re.DOTALL).findall(data)
@@ -179,12 +134,12 @@ def generos(item):
def alfabetico(item):
logger.info()
# TODO Hacer esto correctamente
extra = item.url
itemlist = []
itemlist.append(
Item(channel=item.channel, action="listado2", title="0-9", url="http://www.vepelis.com/letra/09.html",
extra="http://www.vepelis.com/letra/09.html"))
Item(channel=item.channel, action="listado2", title="0-9", url="http://www.vepelis.com/letra/09.html",
extra="http://www.vepelis.com/letra/09.html"))
itemlist.append(Item(channel=item.channel, action="listado2", title="A", url="http://www.vepelis.com/letra/a.html",
extra="http://www.vepelis.com/letra/a.html"))
itemlist.append(Item(channel=item.channel, action="listado2", title="B", url="http://www.vepelis.com/letra/b.html",
@@ -247,38 +202,29 @@ def listado2(item):
itemlist = []
# Descarga la página
data = scrapertools.cachePage(item.url)
data = httptools.downloadpage(item.url).data
data = re.sub(r'"|\n|\r|\t|&nbsp;|<br>|\s{2,}', "", data)
patron = '<h2 class="titpeli.*?<a href="([^"]+)" title="([^"]+)".*?peli_img_img">.*?<img src="([^"]+)".*?<strong>Idioma</strong>:.*?/>([^"]+)</div>.*?<strong>Calidad</strong>: ([^"]+)</div>'
patron = '<h2 class=titpeli.*?<a href=(.*?) title=(.*?)>.*?peli_img_img>.*?<img src=(.*?) alt.*?'
patron += '<p>(.*?)<.*?Genero.*?:.*?(\d{4})<.*?png\/>(.*?)<.*?: (.*?)<'
matches = re.compile(patron, re.DOTALL).findall(data)
for match in matches:
scrapedurl = match[0] # urlparse.urljoin("",match[0])
scrapedtitle = match[1] + ' - ' + match[4]
scrapedtitle = unicode(scrapedtitle, "iso-8859-1", errors="replace").encode("utf-8")
scrapedthumbnail = match[2]
# scrapedplot = match[0]
# itemlist.append( Item(channel=item.channel, action="findvideos", title=scrapedtitle , fulltitle=scrapedtitle, url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) )
itemlist.append(
Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle, url=scrapedurl,
thumbnail=scrapedthumbnail, folder=True))
for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedplot, year, language, quality in matches:
language = language.strip()
itemlist.append(Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle,
url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, language=language,
quality=quality, infoLabels={'year': year}))
# if extra<>"":
# Extrae la marca de siguiente página
# patron = 'page=(.*?)"><span><b>'
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
patron = '<span><b>(.*?)</b></span>'
matches = re.compile(patron, re.DOTALL).findall(data)
# if DEBUG: scrapertools.printMatches(matches)
for match in matches:
# if len(matches)>0:
nu = int(match[0]) + 1
scrapedurl = extra + "?page=" + str(nu)
scrapedtitle = "!Pagina Siguiente ->"
scrapedthumbnail = ""
scrapedplot = ""
itemlist.append(
Item(channel=item.channel, action="listado2", title=scrapedtitle, fulltitle=scrapedtitle, url=scrapedurl,
thumbnail=scrapedthumbnail, extra=extra, folder=True))
itemlist.append(Item(channel=item.channel, action="listado2", title=scrapedtitle, fulltitle=scrapedtitle,
url=scrapedurl, thumbnail=scrapedthumbnail, extra=extra, folder=True))
return itemlist

View File

@@ -172,13 +172,15 @@ def findvideos(item):
duplicated = []
data = get_source(item.url)
logger.debug(data)
video_info = scrapertools.find_single_match(data, "load_player\('(.*?)','(.*?)'\);")
movie_info = scrapertools.find_single_match(item.url, 'http:\/\/ver-peliculas\.org\/peliculas\/(\d+)-(.*?)-\d{'
'4}-online\.')
movie_id = movie_info[0]
movie_name = movie_info[1]
movie_info = scrapertools.find_single_match(item.url,
'http:\/\/ver-peliculas\.(io|org)\/peliculas\/(\d+)-(.*?)-\d{4}-online\.')
movie_host = movie_info[0]
movie_id = movie_info[1]
movie_name = movie_info[2]
sub = video_info[1]
url_base = 'http://ver-peliculas.org/core/api.php?id=%s&slug=%s' % (movie_id, movie_name)
url_base = 'http://ver-peliculas.%s/core/api.php?id=%s&slug=%s' % (movie_host, movie_id, movie_name)
data = httptools.downloadpage(url_base).data
json_data = jsontools.load(data)
video_list = json_data['lista']

View File

@@ -611,7 +611,7 @@ def findvideos(item):
patron = '<td><a href="([^"]+)".*?<img src="([^"]+)" title="([^<]+)" .*?<td>([^<]+)</td>.*?<td>([^<]+)</td>'
matches = re.compile(patron, re.DOTALL).findall(data)
print matches
for scrapedurl, scrapedthumbnail, scrapedserver, scrapedidioma, scrapedcalidad in matches:
for scrapedurl, scrapedthumbnail, scrapedserver, language, quality in matches:
server = scrapertools.get_match(scrapedserver, '(.*?)[.]')
icon_server = os.path.join(config.get_runtime_path(), "resources", "images", "servers",
@@ -623,16 +623,18 @@ def findvideos(item):
if not os.path.exists(icon_server):
icon_server = scrapedthumbnail
#TODO eliminar esta seccion
scrapedserver = scrapedserver.replace(scrapedserver,
"[COLOR darkorange][B]" + "[" + scrapedserver + "]" + "[/B][/COLOR]")
scrapedidioma = scrapedidioma.replace(scrapedidioma,
"[COLOR lawngreen][B]" + "--" + scrapedidioma + "--" + "[/B][/COLOR]")
scrapedcalidad = scrapedcalidad.replace(scrapedcalidad,
"[COLOR floralwhite][B]" + scrapedcalidad + "[/B][/COLOR]")
language = language.replace(language,
"[COLOR lawngreen][B]" + "--" + language + "--" + "[/B][/COLOR]")
quality = quality.replace(quality,
"[COLOR floralwhite][B]" + quality + "[/B][/COLOR]")
title = scrapedserver + scrapedidioma + scrapedcalidad
title = scrapedserver + language + quality
itemlist.append(Item(channel=item.channel, title=title, action="play", url=scrapedurl, thumbnail=icon_server,
fanart=item.show.split("|")[6], extra=item.thumbnail, folder=True))
fanart=item.show.split("|")[6], extra=item.thumbnail, language= language,
quality=quality))
return itemlist

View File

@@ -298,7 +298,7 @@ def findvideos(item):
if filtro_enlaces != 1:
list_enlaces = bloque_enlaces(data, filtro_idioma, dict_idiomas, "Descarga Directa", item)
if list_enlaces:
itemlist.append(item.clone(action="", title="Enlaces Descarga", text_color=color1,
itemlist.append(item.clone(action="", title="Enlaces Descargas", text_color=color1,
text_bold=True))
itemlist.extend(list_enlaces)
@@ -344,12 +344,13 @@ def bloque_enlaces(data, filtro_idioma, dict_idiomas, tipo, item):
title = " Mirror en " + server + " (" + language + ") (Calidad " + calidad.strip() + ")"
if filtro_idioma == 3 or item.filtro:
lista_enlaces.append(item.clone(title=title, action="play", server=server, text_color=color2,
url=scrapedurl, idioma=language, orden=orden))
url=scrapedurl, idioma=language, orden=orden, language=language))
else:
idioma = dict_idiomas[language]
if idioma == filtro_idioma:
lista_enlaces.append(item.clone(title=title, text_color=color2, action="play",
url=scrapedurl, server=server, idioma=language, orden=orden))
url=scrapedurl, server=server, idioma=language, orden=orden,
language=language))
else:
if language not in filtrados:
filtrados.append(language)

View File

@@ -8,10 +8,12 @@ from platformcode import logger
def test_video_exists(page_url):
logger.info("(page_url='%s')" % page_url)
data = httptools.downloadpage(page_url).data
data = httptools.downloadpage(page_url)
if "Object not found" in data or "longer exists on our servers" in data:
if "Object not found" in data.data or "longer exists on our servers" in data.data:
return False, "[Fastplay] El archivo no existe o ha sido borrado"
if data.code == 500:
return False, "[Fastplay] Error interno del servidor"
return True, ""

View File

@@ -27,105 +27,68 @@ def test_video_exists(page_url):
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.info("url=" + page_url)
# Lo pide una vez
data = httptools.downloadpage(page_url, cookies=False).data
# Si salta aviso, se carga la pagina de comprobacion y luego la inicial
if "You try to access this video with Kodi" in data:
url_reload = scrapertools.find_single_match(data, 'try to reload the page.*?href="([^"]+)"')
url_reload = "http://www.flashx.tv" + url_reload[1:]
page_url = page_url.replace("playvid-", "")
headers = {'Host': 'www.flashx.tv',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1',
'Cookie': ''}
data = httptools.downloadpage(page_url, headers=headers, replace_headers=True).data
flashx_id = scrapertools.find_single_match(data, 'name="id" value="([^"]+)"')
fname = scrapertools.find_single_match(data, 'name="fname" value="([^"]+)"')
hash_f = scrapertools.find_single_match(data, 'name="hash" value="([^"]+)"')
post = 'op=download1&usr_login=&id=%s&fname=%s&referer=&hash=%s&imhuman=Proceed to the video' % (
flashx_id, urllib.quote(fname), hash_f)
wait_time = scrapertools.find_single_match(data, "<span id='xxc2'>(\d+)")
headers['Referer'] = "https://www.flashx.tv/"
headers['Accept'] = "*/*"
headers['Host'] = "www.flashx.tv"
coding_url = 'https://www.flashx.tv/flashx.php?fxfx=5'
headers['X-Requested-With'] = 'XMLHttpRequest'
httptools.downloadpage(coding_url, headers=headers, replace_headers=True)
try:
time.sleep(int(wait_time) + 1)
except:
time.sleep(6)
headers.pop('X-Requested-With')
headers['Content-Type'] = 'application/x-www-form-urlencoded'
data = httptools.downloadpage('https://www.flashx.tv/dl?playnow', post, headers, replace_headers=True).data
matches = scrapertools.find_multiple_matches(data, "(eval\(function\(p,a,c,k.*?)\s+</script>")
video_urls = []
for match in matches:
try:
data = httptools.downloadpage(url_reload, cookies=False).data
data = httptools.downloadpage(page_url, cookies=False).data
match = jsunpack.unpack(match)
match = match.replace("\\'", "'")
# {src:\'https://bigcdn.flashx1.tv/cdn25/5k7xmlcjfuvvjuw5lx6jnu2vt7gw4ab43yvy7gmkvhnocksv44krbtawabta/normal.mp4\',type:\'video/mp4\',label:\'SD\',res:360},
media_urls = scrapertools.find_multiple_matches(match, "{src:'([^']+)'.*?,label:'([^']+)'")
subtitle = ""
for media_url, label in media_urls:
if media_url.endswith(".srt") and label == "Spanish":
try:
from core import filetools
data = scrapertools.downloadpage(media_url)
subtitle = os.path.join(config.get_data_path(), 'sub_flashx.srt')
filetools.write(subtitle, data)
except:
import traceback
logger.info("Error al descargar el subtítulo: " + traceback.format_exc())
for media_url, label in media_urls:
if not media_url.endswith("png") and not media_url.endswith(".srt"):
video_urls.append(["." + media_url.rsplit('.', 1)[1] + " [flashx]", media_url, 0, subtitle])
for video_url in video_urls:
logger.info("%s - %s" % (video_url[0], video_url[1]))
except:
pass
matches = scrapertools.find_multiple_matches(data, "<script type='text/javascript'>(.*?)</script>")
m = ""
for n, m in enumerate(matches):
if m.startswith("eval"):
try:
m = jsunpack.unpack(m)
fake = (scrapertools.find_single_match(m, "(\w{40,})") == "")
if fake:
m = ""
else:
break
except:
m = ""
match = m
if "sources:[{file:" not in match:
page_url = page_url.replace("playvid-", "")
headers = {'Host': 'www.flashx.tv',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1',
'Cookie': ''}
data = httptools.downloadpage(page_url, headers=headers, replace_headers=True).data
flashx_id = scrapertools.find_single_match(data, 'name="id" value="([^"]+)"')
fname = scrapertools.find_single_match(data, 'name="fname" value="([^"]+)"')
hash_f = scrapertools.find_single_match(data, 'name="hash" value="([^"]+)"')
post = 'op=download1&usr_login=&id=%s&fname=%s&referer=&hash=%s&imhuman=Proceed+to+video' % (
flashx_id, urllib.quote(fname), hash_f)
wait_time = scrapertools.find_single_match(data, "<span id='xxc2'>(\d+)")
file_id = scrapertools.find_single_match(data, "'file_id', '([^']+)'")
headers['Referer'] = "https://www.flashx.tv/"
headers['Accept'] = "*/*"
coding_url = 'https://www.flashx.tv/counter.cgi?fx=%s' % base64.encodestring(file_id)
headers['Host'] = "www.flashx.tv"
coding_url = 'https://www.flashx.tv/flashx.php?fxfx=3'
headers['X-Requested-With'] = 'XMLHttpRequest'
coding = httptools.downloadpage(coding_url, headers=headers, replace_headers=True).data
try:
time.sleep(int(wait_time) + 1)
except:
time.sleep(6)
headers.pop('X-Requested-With')
headers['Content-Type'] = 'application/x-www-form-urlencoded'
data = httptools.downloadpage('https://www.flashx.tv/dl?playthis', post, headers, replace_headers=True).data
matches = scrapertools.find_multiple_matches(data, "(eval\(function\(p,a,c,k.*?)\s+</script>")
for match in matches:
if match.startswith("eval"):
try:
match = jsunpack.unpack(match)
fake = (scrapertools.find_single_match(match, "(\w{40,})") == "")
if fake:
match = ""
else:
break
except:
match = ""
if not match:
match = data
# Extrae la URL
# {file:"http://f11-play.flashx.tv/luq4gfc7gxixexzw6v4lhz4xqslgqmqku7gxjf4bk43u4qvwzsadrjsozxoa/video1.mp4"}
video_urls = []
match = match.replace("\\", "").replace('\"', "\'")
media_urls = scrapertools.find_multiple_matches(match, "{src:'([^']+)'.*?,label:'([^']+)'")
subtitle = ""
for media_url, label in media_urls:
if media_url.endswith(".srt") and label == "Spanish":
try:
from core import filetools
data = scrapertools.downloadpage(media_url)
subtitle = os.path.join(config.get_data_path(), 'sub_flashx.srt')
filetools.write(subtitle, data)
except:
import traceback
logger.info("Error al descargar el subtítulo: " + traceback.format_exc())
for media_url, label in media_urls:
if not media_url.endswith("png") and not media_url.endswith(".srt"):
video_urls.append(["." + media_url.rsplit('.', 1)[1] + " [flashx]", media_url, 0, subtitle])
for video_url in video_urls:
logger.info("%s - %s" % (video_url[0], video_url[1]))
return video_urls

View File

@@ -52,5 +52,6 @@
"visible": false
}
],
"thumbnail": "https://s26.postimg.org/y5arjad1l/rapidvideo1.png",
"version": 1
}
}

View File

@@ -26,12 +26,16 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
data = httptools.downloadpage(page_url).data
video_urls = []
matches = scrapertools.find_multiple_matches(data, 'type\s*:\s*"([^"]+)"\s*,\s*src:"([^"]+)",height\s*:\s*(\d+)')
for ext, media_url, calidad in matches:
ext = ext.replace("video/", "")
matches = scrapertools.find_multiple_matches(data, "type:\"video/([^\"]+)\",src:d\('([^']+)',(.*?)\).+?height:(\d+)")
for ext, encoded, code, quality in matches:
media_url = decode(encoded, int(code))
if not media_url.startswith("http"):
media_url = "http:%s" % media_url
video_urls.append([".%s %sp [streamcherry]" % (ext, calidad), media_url])
media_url = "http:" + media_url
video_urls.append([".%s %sp [streamango]" % (ext, quality), media_url])
video_urls.reverse()
for video_url in video_urls:
@@ -40,23 +44,36 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
return video_urls
# Encuentra vídeos del servidor en el texto pasado
def find_videos(data):
encontrados = set()
devuelve = []
def decode(encoded, code):
logger.info("encoded '%s', code '%s'" % (encoded, code))
patronvideos = 'streamcherry.com/(?:embed|f)/([A-z0-9]+)'
logger.info("#" + patronvideos + "#")
matches = re.compile(patronvideos, re.DOTALL).findall(data)
_0x59b81a = ""
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
k = k[::-1]
for match in matches:
titulo = "[streamcherry]"
url = "http://streamcherry.com/embed/%s" % match
if url not in encontrados:
logger.info(" url=" + url)
devuelve.append([titulo, url, 'streamcherry'])
encontrados.add(url)
else:
logger.info(" url duplicada=" + url)
count = 0
return devuelve
for index in range(0, len(encoded) - 1):
while count <= len(encoded) - 1:
_0x4a2f3a = k.index(encoded[count])
count += 1
_0x29d5bf = k.index(encoded[count])
count += 1
_0x3b6833 = k.index(encoded[count])
count += 1
_0x426d70 = k.index(encoded[count])
count += 1
_0x2e4782 = ((_0x4a2f3a << 2) | (_0x29d5bf >> 4))
_0x2c0540 = (((_0x29d5bf & 15) << 4) | (_0x3b6833 >> 2))
_0x5a46ef = ((_0x3b6833 & 3) << 6) | _0x426d70
_0x2e4782 = _0x2e4782 ^ code
_0x59b81a = str(_0x59b81a) + chr(_0x2e4782)
if _0x3b6833 != 64:
_0x59b81a = str(_0x59b81a) + chr(_0x2c0540)
if _0x3b6833 != 64:
_0x59b81a = str(_0x59b81a) + chr(_0x5a46ef)
return _0x59b81a

View File

@@ -36,7 +36,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
for video_url in matches:
_hash = scrapertools.find_single_match(video_url, '[A-z0-9\_\-]{40,}')
hash = _hash[::-1]
hash = hash.replace(hash[2:3],"",1)
hash = hash.replace(hash[1:2],"",1)
video_url = video_url.replace(_hash, hash)
filename = scrapertools.get_filename_from_url(video_url)[-4:]