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
+11 -9
View File
@@ -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="2.0.2" provider-name="Alfa Addon"> <addon id="plugin.video.alfa" name="Alfa" version="2.0.3" 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,15 +19,17 @@
</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]Canales agregados y arreglos[/B][/COLOR] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR]
» anitoonstv » qserie » hdfull » ecartelera
» cartoonlatino » repelis » seriesdanko » serieslatino
» seriesblanco » seodiv » seriesblanco » seriespapaya
» serieslan » pelisplanet » sipeliculas » torrentlocura
» seriesmeme » pepecine » ultrapeliculashd » verpelis
» peliscity » pelisporno » ver-peliculas » verseriesonlinetv
» okru » vimpleru » flashx » vixto
» fastplay » streamcherry
» rapidvideo » streamplay
¤ fix internos ¤ 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> </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>
+2 -1
View File
@@ -111,6 +111,8 @@ def findvideos(item):
match = scrapertools.find_multiple_matches(bloque, '(?is)(?:iframe|script) .*?src="([^"]+)') match = scrapertools.find_multiple_matches(bloque, '(?is)(?:iframe|script) .*?src="([^"]+)')
for url in match: for url in match:
titulo = "Ver en: %s" 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: if "youtube" in url:
titulo = "[COLOR = yellow]Ver trailer: %s[/COLOR]" titulo = "[COLOR = yellow]Ver trailer: %s[/COLOR]"
if "ad.js" in url or "script" in url: if "ad.js" in url or "script" in url:
@@ -123,7 +125,6 @@ def findvideos(item):
title = titulo, title = titulo,
fulltitle = item.fulltitle, fulltitle = item.fulltitle,
thumbnail = item.thumbnail, thumbnail = item.thumbnail,
server = "",
url = url url = url
)) ))
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize()) itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
+195 -192
View File
@@ -43,6 +43,10 @@ def show_option(channel, itemlist, text_color='yellow', thumbnail=None, fanart=N
:return: :return:
''' '''
logger.info() logger.info()
if not config.is_xbmc():
return itemlist
if thumbnail == None: if thumbnail == None:
thumbnail = 'https://s7.postimg.org/65ooga04b/Auto_Play.png' thumbnail = 'https://s7.postimg.org/65ooga04b/Auto_Play.png'
if fanart == None: if fanart == None:
@@ -74,217 +78,220 @@ def start(itemlist, item):
:return: intenta autoreproducir, en caso de fallar devuelve el itemlist que recibio en un principio :return: intenta autoreproducir, en caso de fallar devuelve el itemlist que recibio en un principio
''' '''
logger.info() logger.info()
global autoplay_node
if not config.is_xbmc(): 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 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 global autoplay_node
new_options = check_value(item.channel, itemlist) 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 if not item.channel in autoplay_node:
channel_node = autoplay_node.get(item.channel, {}) return itemlist
# Obtiene los ajustes des autoplay para este canal
settings_node = channel_node.get('settings', {})
if settings_node['active']: # Agrega servidores y calidades que no estaban listados a autoplay_node
url_list_valid = [] new_options = check_value(item.channel, itemlist)
autoplay_list = []
favorite_servers = []
favorite_quality = []
# Guarda el valor actual de "Accion y Player Mode" en preferencias # Obtiene el nodo del canal desde autoplay_node
user_config_setting_action = config.get_setting("default_action") channel_node = autoplay_node.get(item.channel, {})
user_config_setting_player = config.get_setting("player_mode") # Obtiene los ajustes des autoplay para este canal
# Habilita la accion "Ver en calidad alta" (si el servidor devuelve más de una calidad p.e. gdrive) settings_node = channel_node.get('settings', {})
if user_config_setting_action != 2:
config.set_setting("default_action", 2)
if user_config_setting_player != 0:
config.set_setting("player_mode", 0)
# Informa que AutoPlay esta activo if settings_node['active']:
platformtools.dialog_notification('AutoPlay Activo', '', sound=False) url_list_valid = []
autoplay_list = []
favorite_servers = []
favorite_quality = []
# Prioridades a la hora de ordenar itemlist: # Guarda el valor actual de "Accion y Player Mode" en preferencias
# 0: Servidores y calidades user_config_setting_action = config.get_setting("default_action")
# 1: Calidades y servidores user_config_setting_player = config.get_setting("player_mode")
# 2: Solo servidores # Habilita la accion "Ver en calidad alta" (si el servidor devuelve más de una calidad p.e. gdrive)
# 3: Solo calidades if user_config_setting_action != 2:
# 4: No ordenar config.set_setting("default_action", 2)
if settings_node['custom_servers'] and settings_node['custom_quality']: if user_config_setting_player != 0:
priority = settings_node['priority'] # 0: Servidores y calidades o 1: Calidades y servidores config.set_setting("player_mode", 0)
elif settings_node['custom_servers']:
priority = 2 # Solo servidores
elif settings_node['custom_quality']:
priority = 3 # Solo calidades
else:
priority = 4 # No ordenar
# Obtiene las listas servidores, calidades disponibles desde el nodo del json de AutoPlay # Informa que AutoPlay esta activo
server_list = channel_node.get('servers', []) platformtools.dialog_notification('AutoPlay Activo', '', sound=False)
quality_list = channel_node.get('quality', [])
# Se guardan los textos de cada servidor y calidad en listas p.e. favorite_servers = ['openload', # Prioridades a la hora de ordenar itemlist:
# 'streamcloud'] # 0: Servidores y calidades
for num in range(1, 4): # 1: Calidades y servidores
favorite_servers.append(channel_node['servers'][settings_node['server_%s' % num]]) # 2: Solo servidores
favorite_quality.append(channel_node['quality'][settings_node['quality_%s' % num]]) # 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 # Obtiene las listas servidores, calidades disponibles desde el nodo del json de AutoPlay
for item in itemlist: server_list = channel_node.get('servers', [])
autoplay_elem = dict() quality_list = channel_node.get('quality', [])
# Comprobamos q se trata de un item de video # Se guardan los textos de cada servidor y calidad en listas p.e. favorite_servers = ['openload',
if 'server' not in item: # '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 continue
autoplay_elem["indice_server"] = favorite_servers.index(item.server)
# Agrega la opcion configurar AutoPlay al menu contextual autoplay_elem["indice_quality"] = favorite_quality.index(item.quality)
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']))
elif priority == 2: # Solo servidores 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 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 # si la calidad no se encuentra en la lista de favoritos o la url esta repetida,
# funcional o fallen todos # descartamos el item
if autoplay_list: if item.quality not in favorite_quality or item.url in url_list_valid:
played = False continue
max_intentos = 5 autoplay_elem["indice_quality"] = favorite_quality.index(item.quality)
max_intentos_servers = {}
# Si se esta reproduciendo algo detiene la reproduccion else: # No ordenar
if platformtools.is_playing():
platformtools.stop_video()
for autoplay_elem in autoplay_list: # si la url esta repetida, descartamos el item
if not platformtools.is_playing() and not played: if item.url in url_list_valid:
videoitem = autoplay_elem['videoitem'] 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 max_intentos_servers[videoitem.server] = max_intentos
# Si se han alcanzado el numero maximo de intentos de este servidor saltamos al siguiente else:
if max_intentos_servers[videoitem.server] == 0: platformtools.dialog_notification('AutoPlay No Fue Posible', 'No Hubo Coincidencias')
continue if new_options:
platformtools.dialog_notification("AutoPlay", "Nueva Calidad/Servidor disponible en la "
"configuracion", sound=False)
lang = " " # Restaura si es necesario el valor previo de "Accion y Player Mode" en preferencias
if hasattr(videoitem, 'language') and videoitem.language != "": if user_config_setting_action != 2:
lang = " '%s' " % videoitem.language 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" % ( # devuelve la lista de enlaces para la eleccion manual
videoitem.server.upper(), lang, videoitem.quality.upper()), sound=False) return itemlist
# 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
def init(channel, list_servers, list_quality): def init(channel, list_servers, list_quality):
@@ -304,7 +311,7 @@ def init(channel, list_servers, list_quality):
result = True result = True
if not config.is_xbmc(): 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 result = False
else: else:
autoplay_path = os.path.join(config.get_data_path(), "settings_channels", 'autoplay_data.json') 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: if change:
result, json_data = jsontools.update_node(autoplay_node, 'autoplay', 'AUTOPLAY') result, json_data = jsontools.update_node(autoplay_node, 'autoplay', 'AUTOPLAY')
if result: if not result:
heading = "AutoPlay Disponible"
msj = "Seleccione '<Configurar AutoPlay>' para activarlo."
icon = 0
else:
heading = "Error al iniciar AutoPlay" heading = "Error al iniciar AutoPlay"
msj = "Consulte su log para obtener mas información." msj = "Consulte su log para obtener mas información."
icon = 1 icon = 1
platformtools.dialog_notification(heading, msj, icon, sound=False) platformtools.dialog_notification(heading, msj, icon, sound=False)
return result return result
@@ -41,7 +41,7 @@ def mainlist(item):
logger.debug("title=[" + title + "], url=[" + url + "], thumbnail=[" + thumbnail + "]") logger.debug("title=[" + title + "], url=[" + url + "], thumbnail=[" + thumbnail + "]")
itemlist.append( itemlist.append(
Item(channel=item.channel, action="play", title=title, url=url, thumbnail=thumbnail, fanart=thumbnail, 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 # Extrae la página siguiente
+10 -5
View File
@@ -273,13 +273,13 @@ def listado_series(item):
def fichas(item): def fichas(item):
logger.info() logger.info()
itemlist = [] itemlist = []
textoidiomas=''
infoLabels=dict()
## Carga estados ## Carga estados
status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data) status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data)
if item.title == "Buscar...": if item.title == "Buscar...":
data = agrupa_datos(httptools.downloadpage(item.url, post=item.extra).data) 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( s_p = scrapertools.get_match(data, '<h3 class="section-title">(.*?)<div id="footer-wrapper">').split(
'<h3 class="section-title">') '<h3 class="section-title">')
@@ -320,10 +320,12 @@ def fichas(item):
if scrapedlangs != ">": if scrapedlangs != ">":
textoidiomas = extrae_idiomas(scrapedlangs) textoidiomas = extrae_idiomas(scrapedlangs)
#Todo Quitar el idioma
title += bbcode_kodi2html(" ( [COLOR teal][B]" + textoidiomas + "[/B][/COLOR])") title += bbcode_kodi2html(" ( [COLOR teal][B]" + textoidiomas + "[/B][/COLOR])")
if scrapedrating != ">": if scrapedrating != ">":
valoracion = re.sub(r'><[^>]+>(\d+)<b class="dec">(\d+)</b>', r'\1,\2', 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])") title += bbcode_kodi2html(" ([COLOR orange]" + valoracion + "[/COLOR])")
url = urlparse.urljoin(item.url, scrapedurl) url = urlparse.urljoin(item.url, scrapedurl)
@@ -349,7 +351,7 @@ def fichas(item):
itemlist.append( itemlist.append(
Item(channel=item.channel, action=action, title=title, url=url, fulltitle=title, thumbnail=thumbnail, Item(channel=item.channel, action=action, title=title, url=url, fulltitle=title, thumbnail=thumbnail,
show=show, folder=True, contentType=contentType, contentTitle=contentTitle, show=show, folder=True, contentType=contentType, contentTitle=contentTitle,
language =textoidiomas+'x')) language =textoidiomas, infoLabels=infoLabels))
## Paginación ## Paginación
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)">.raquo;</a>') next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)">.raquo;</a>')
@@ -794,11 +796,14 @@ def agrupa_datos(data):
def extrae_idiomas(bloqueidiomas): def extrae_idiomas(bloqueidiomas):
logger.info("idiomas=" + bloqueidiomas) logger.info("idiomas=" + bloqueidiomas)
# Todo cambiar por lista
#textoidiomas=[]
textoidiomas = ''
patronidiomas = '([a-z0-9]+).png"' patronidiomas = '([a-z0-9]+).png"'
idiomas = re.compile(patronidiomas, re.DOTALL).findall(bloqueidiomas) idiomas = re.compile(patronidiomas, re.DOTALL).findall(bloqueidiomas)
textoidiomas = ""
for idioma in idiomas: for idioma in idiomas:
textoidiomas = textoidiomas + idioma.upper() + " " textoidiomas = textoidiomas + idioma +" "
#textoidiomas.append(idioma.upper())
return textoidiomas return textoidiomas
+1 -1
View File
@@ -217,7 +217,7 @@ def episodios(item):
idiomas = " ".join(["[%s]" % IDIOMAS.get(language, "OVOS") for language in idiomas = " ".join(["[%s]" % IDIOMAS.get(language, "OVOS") for language in
re.findall("banderas/([^\.]+)", flags, re.MULTILINE)]) re.findall("banderas/([^\.]+)", flags, re.MULTILINE)])
filter_lang = idiomas.replace("[", "").replace("]", "").split(" ") 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))) # logger.debug("Episode found %s: %s" % (display_title, urlparse.urljoin(HOST, url)))
itemlist.append(item.clone(title=display_title, url=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)) action="findvideos", plot=plot, fanart=fanart, language=filter_lang))
+11 -3
View File
@@ -40,7 +40,7 @@ def novedades(item):
data = httptools.downloadpage(item.url).data 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"\n|\r|\t|\s{2}|&nbsp;|<Br>|<BR>|<br>|<br/>|<br />|-\s", "", data)
data = re.sub(r"<!--.*?-->", "", data) data = re.sub(r"<!--.*?-->", "", data)
logger.debug(data)
patron = '<a title="([^"]+)" href="([^"]+)".*?>' patron = '<a title="([^"]+)" href="([^"]+)".*?>'
patron += "<img.*?src='([^']+)'" patron += "<img.*?src='([^']+)'"
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
@@ -49,11 +49,19 @@ def novedades(item):
# patron = "^(.*?)(?:Ya Disponible|Disponible|Disponbile|disponible|\(Actualizada\))$" # patron = "^(.*?)(?:Ya Disponible|Disponible|Disponbile|disponible|\(Actualizada\))$"
# match = re.compile(patron, re.DOTALL).findall(scrapedtitle) # match = re.compile(patron, re.DOTALL).findall(scrapedtitle)
title = scrapertools.decodeHtmlentities(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+") 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, itemlist.append(Item(channel=item.channel, title=title, url=urlparse.urljoin(HOST, scrapedurl), show=show,
action="episodios", thumbnail=scrapedthumb, action="episodios", thumbnail=scrapedthumb,
context=filtertools.context(item, list_idiomas, CALIDADES))) context=filtertools.context(item, list_idiomas, CALIDADES), language=language))
return itemlist 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", 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, show=item.show, language=IDIOMAS.get(language, "OVOS"), quality=quality,
fulltitle=item.title)) fulltitle=item.title, server=server))
return itemlist return itemlist
+2 -2
View File
@@ -56,7 +56,7 @@ def mainlist(item):
autoplay.init(item.channel, list_servers, list_quality) autoplay.init(item.channel, list_servers, list_quality)
itemlist = [] 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/', fanart='https://s27.postimg.org/iahczwgrn/series.png', extra='peliculas/',
url=host + 'lista-de-series/')) 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, itemlist.append(Item(channel=item.channel, action='episodiosxtemp', url=item.url, title=title,
contentSerieName=item.contentSerieName, thumbnail=thumbnail, plot=plot, fanart=fanart, 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) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
if config.get_videolibrary_support() and len(itemlist) > 0: if config.get_videolibrary_support() and len(itemlist) > 0:
+28 -16
View File
@@ -11,12 +11,14 @@ from core import httptools
from core import jsontools from core import jsontools
from core import scrapertools from core import scrapertools
from core import servertools from core import servertools
from core import tmdb
from core.item import Item from core.item import Item
from platformcode import config, logger from platformcode import config, logger
HOST = "http://www.seriespapaya.com" 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() list_idiomas = IDIOMAS.values()
CALIDADES = ['360p', '480p', '720p HD', '1080p HD'] CALIDADES = ['360p', '480p', '720p HD', '1080p HD']
@@ -67,22 +69,31 @@ def series_por_letra_y_grupo(item):
"letra": item.letter.lower() "letra": item.letter.lower()
} }
data = httptools.downloadpage(url, post=urllib.urlencode(post_request)).data 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( for img, url, name, plot, year in matches:
'list_imagen.+?src="(?P<img>[^"]+).+?<div class="list_titulo"><a[^>]+href="(?P<url>[^"]+)[^>]+>(.*?)</a>', data, new_item= Item(
re.MULTILINE | re.DOTALL) channel = item.channel,
for img, url, name in series:
itemlist.append(item.clone(
action="episodios", action="episodios",
title=name, title=name,
show=name, show=name,
url=urlparse.urljoin(HOST, url), url=urlparse.urljoin(HOST, url),
thumbnail=urlparse.urljoin(HOST, img), 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)) itemlist.append(item.clone(title="Siguiente >>", action="series_por_letra_y_grupo", extra=item.extra + 1))
if item.extra > 0: if item.extra > 0:
@@ -94,13 +105,16 @@ def series_por_letra_y_grupo(item):
def novedades(item): def novedades(item):
logger.info() logger.info()
data = httptools.downloadpage(HOST).data data = httptools.downloadpage(HOST).data
shows = re.findall('sidebarestdiv[^<]+<a[^<]+title="([^"]*)[^<]+href="([^"]*)[^<]+<img[^<]+src="([^"]+)', data, data = re.sub(r'"|\n|\r|\t|&nbsp;|<br>|\s{2,}', "", data)
re.MULTILINE | re.DOTALL) patron = 'sidebarestdiv><a title=(.*?\d+X\d+) (.*?) href=(.*?)>.*?src=(.*?)>'
matches = re.compile(patron, re.DOTALL).findall(data)
itemlist = [] itemlist = []
for title, url, img in shows: for title, language,url, img in matches:
itemlist.append(item.clone(action="findvideos", title=title, url=urlparse.urljoin(HOST, url), thumbnail=img)) language = IDIOMAS[language]
itemlist.append(item.clone(action="findvideos", title=title, url=urlparse.urljoin(HOST, url), thumbnail=img,
language=language))
return itemlist return itemlist
@@ -133,7 +147,6 @@ def episodios(item):
itemlist = [] itemlist = []
for url, title, langs in episodes: for url, title, langs in episodes:
logger.debug("langs %s" % langs)
languages = " ".join( languages = " ".join(
["[%s]" % IDIOMAS.get(lang, lang) for lang in re.findall('images/s-([^\.]+)', langs)]) ["[%s]" % IDIOMAS.get(lang, lang) for lang in re.findall('images/s-([^\.]+)', langs)])
filter_lang = languages.replace("[", "").replace("]", "").split(" ") filter_lang = languages.replace("[", "").replace("]", "").split(" ")
@@ -206,6 +219,5 @@ def play(item):
logger.info("play: %s" % item.url) logger.info("play: %s" % item.url)
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
video_url = scrapertools.find_single_match(data, "location.href='([^']+)") video_url = scrapertools.find_single_match(data, "location.href='([^']+)")
logger.debug("Video URL = %s" % video_url)
itemlist = servertools.find_video_items(data=video_url) itemlist = servertools.find_video_items(data=video_url)
return itemlist return itemlist
+18 -13
View File
@@ -6,6 +6,7 @@ import urlparse
from core import httptools from core import httptools
from core import scrapertools from core import scrapertools
from core import servertools from core import servertools
from core import tmdb
from core.item import Item from core.item import Item
from platformcode import logger from platformcode import logger
@@ -60,18 +61,18 @@ def lista(item):
logger.info() logger.info()
itemlist = [] itemlist = []
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
# data = re.sub(r'"|\n|\r|\t|&nbsp;|<br>', "", data)
listado = scrapertools.find_single_match(data, listado = scrapertools.find_single_match(data,
'<div id="sipeliculas" class="borde"><div class="izquierda">(.*?)<div class="derecha"><h2') '<div id="sipeliculas" class="borde"><div class="izquierda">(.*?)<div class="derecha"><h2')
logger.info('vergas' + listado) patron = '<a class="i" href="(.*?)".*?src="(.*?)".*?title=.*?>(.*?)<.*?span>(.*?)<.*?<p><span>(.*?)<'
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))
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 # Paginacion
if itemlist != []: if itemlist != []:
patron = '<li[^<]+<a href="([^"]+)" title="[^"]+">Siguiente[^<]+</a></li>' patron = '<li[^<]+<a href="([^"]+)" title="[^"]+">Siguiente[^<]+</a></li>'
@@ -96,22 +97,26 @@ def findvideos(item):
logger.info() logger.info()
itemlist = [] itemlist = []
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
# data = re.sub(r"'|\n|\r|\t|&nbsp;|<br>", "", data)
listado1 = scrapertools.find_single_match(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>') '<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>' 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) 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, 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>') 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>' patron2 = '<li ><a id="([^"]+)" rel="nofollow" href="([^"]+)" title="[^"]+" alt="([^"]+)"><img src="[^"]+" alt="[^"]+"/>[^<]+</a></li>'
matches = matches = re.compile(patron2, re.DOTALL).findall(listado2) matches = matches = re.compile(patron2, re.DOTALL).findall(listado2)
for vidId, vidUrl, vidServer in matches: 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, 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: for videoitem in itemlist:
videoitem.fulltitle = item.title videoitem.fulltitle = item.title
@@ -154,6 +154,9 @@ def listado(item):
replace("Descarga Serie HD", "", 1).strip() replace("Descarga Serie HD", "", 1).strip()
show = title show = title
#TODO quitar calidad del titulo
if quality: if quality:
title = "%s [%s]" % (title, quality) title = "%s [%s]" % (title, quality)
+20 -2
View File
@@ -194,8 +194,25 @@ def findvideos(item):
patron = '<iframe class=metaframe rptss src=(.*?) frameborder=0 allowfullscreen><\/iframe>' patron = '<iframe class=metaframe rptss src=(.*?) frameborder=0 allowfullscreen><\/iframe>'
matches = matches = re.compile(patron, re.DOTALL).findall(data) 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: for videoitem in itemlist:
videoitem.channel = item.channel videoitem.channel = item.channel
@@ -206,6 +223,7 @@ def findvideos(item):
if 'youtube' in videoitem.url: if 'youtube' in videoitem.url:
videoitem.title = '[COLOR orange]Trailer en Youtube[/COLOR]' videoitem.title = '[COLOR orange]Trailer en Youtube[/COLOR]'
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
itemlist.append( itemlist.append(
Item(channel=item.channel, title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', url=item.url, Item(channel=item.channel, title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', url=item.url,
+37 -91
View File
@@ -4,6 +4,9 @@ import re
import urlparse import urlparse
from core import scrapertools from core import scrapertools
from core import httptools
from core import servertools
from core import tmdb
from core.item import Item from core.item import Item
from platformcode import config, logger from platformcode import config, logger
@@ -25,8 +28,8 @@ def mainlist(item):
url="http://www.vepelis.com/pelicula/ultimas-peliculas/ultimas/actualizadas", url="http://www.vepelis.com/pelicula/ultimas-peliculas/ultimas/actualizadas",
extra="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 Genero", action="generos", url="http://www.vepelis.com/"))
itemlist.append( itemlist.append(Item(channel=item.channel, title="Por Orden Alfabetico", action="alfabetico",
Item(channel=item.channel, title="Por Orden Alfabetico", action="alfabetico", url="http://www.vepelis.com/")) url="http://www.vepelis.com/"))
itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url="http://www.vepelis.com/")) itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url="http://www.vepelis.com/"))
return itemlist return itemlist
@@ -35,12 +38,16 @@ def listarpeliculas(item):
logger.info() logger.info()
# Descarga la página # Descarga la página
data = scrapertools.cachePage(item.url) data = httptools.downloadpage(item.url).data
extra = item.extra extra = item.extra
# Extrae las entradas de la pagina seleccionada # 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"> '''<td class="DarkText" align="center" valign="top" width="100px" height="160px"
<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>''' 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 = '<td class=.*?<a '
patron += 'href="([^"]+)"><img src="([^"]+)" alt="([^"]+)"' patron += 'href="([^"]+)"><img src="([^"]+)" alt="([^"]+)"'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
@@ -54,9 +61,8 @@ def listarpeliculas(item):
logger.info(scrapedtitle) logger.info(scrapedtitle)
# Añade al listado # Añade al listado
itemlist.append( itemlist.append(Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle,
Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle, url=scrapedurl, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
# Extrae la marca de siguiente página # Extrae la marca de siguiente página
patron = 'Anterior.*? :: <a href="/../../.*?/page/([^"]+)">Siguiente ' patron = 'Anterior.*? :: <a href="/../../.*?/page/([^"]+)">Siguiente '
@@ -69,8 +75,8 @@ def listarpeliculas(item):
scrapedplot = "" scrapedplot = ""
itemlist.append( itemlist.append(
Item(channel=item.channel, action="listarpeliculas", title=scrapedtitle, fulltitle=scrapedtitle, Item(channel=item.channel, action="listarpeliculas", title=scrapedtitle, fulltitle=scrapedtitle,
url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True)) url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
return itemlist return itemlist
@@ -78,77 +84,26 @@ def listarpeliculas(item):
def findvideos(item): def findvideos(item):
logger.info() logger.info()
# Descarga la página # Descarga la página
data = scrapertools.cachePage(item.url)
title = item.title
scrapedthumbnail = item.thumbnail
itemlist = [] itemlist = []
patron = '<li><a href="#ms.*?">([^"]+)</a></li>.*?<iframe src="(.*?)"' data = httptools.downloadpage(item.url).data
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) )
for match in matches: itemlist.extend(servertools.find_video_items(data=data))
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))
return itemlist
def play(item):
logger.info()
itemlist = []
from core import servertools
itemlist = servertools.find_video_items(data=item.url)
for videoitem in itemlist: for videoitem in itemlist:
videoitem.channel = item.channel videoitem.channel = item.channel
videoitem.action = "play" videoitem.quality = item.quality
videoitem.folder = False videoitem.language = item.language
videoitem.action = 'play'
return itemlist 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): def generos(item):
logger.info() logger.info()
itemlist = [] itemlist = []
# Descarga la página # Descarga la página
data = scrapertools.cachePage(item.url) data = httptools.downloadpage(item.url).data
patron = '>.*?<li><a title="(.*?)" href="(.*?)"' patron = '>.*?<li><a title="(.*?)" href="(.*?)"'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
@@ -179,12 +134,12 @@ def generos(item):
def alfabetico(item): def alfabetico(item):
logger.info() logger.info()
# TODO Hacer esto correctamente
extra = item.url extra = item.url
itemlist = [] itemlist = []
itemlist.append( itemlist.append(
Item(channel=item.channel, action="listado2", title="0-9", url="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")) 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", 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")) 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", 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 = [] itemlist = []
# Descarga la página # 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) matches = re.compile(patron, re.DOTALL).findall(data)
for match in matches: for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedplot, year, language, quality in matches:
scrapedurl = match[0] # urlparse.urljoin("",match[0]) language = language.strip()
scrapedtitle = match[1] + ' - ' + match[4] itemlist.append(Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle,
scrapedtitle = unicode(scrapedtitle, "iso-8859-1", errors="replace").encode("utf-8") url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, language=language,
scrapedthumbnail = match[2] quality=quality, infoLabels={'year': year}))
# 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))
# if extra<>"": tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
# Extrae la marca de siguiente página
# patron = 'page=(.*?)"><span><b>'
patron = '<span><b>(.*?)</b></span>' patron = '<span><b>(.*?)</b></span>'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
# if DEBUG: scrapertools.printMatches(matches)
for match in matches: for match in matches:
# if len(matches)>0:
nu = int(match[0]) + 1 nu = int(match[0]) + 1
scrapedurl = extra + "?page=" + str(nu) scrapedurl = extra + "?page=" + str(nu)
scrapedtitle = "!Pagina Siguiente ->" scrapedtitle = "!Pagina Siguiente ->"
scrapedthumbnail = "" scrapedthumbnail = ""
scrapedplot = "" itemlist.append(Item(channel=item.channel, action="listado2", title=scrapedtitle, fulltitle=scrapedtitle,
itemlist.append( url=scrapedurl, thumbnail=scrapedthumbnail, extra=extra, folder=True))
Item(channel=item.channel, action="listado2", title=scrapedtitle, fulltitle=scrapedtitle, url=scrapedurl,
thumbnail=scrapedthumbnail, extra=extra, folder=True))
return itemlist return itemlist
+7 -5
View File
@@ -172,13 +172,15 @@ def findvideos(item):
duplicated = [] duplicated = []
data = get_source(item.url) data = get_source(item.url)
logger.debug(data)
video_info = scrapertools.find_single_match(data, "load_player\('(.*?)','(.*?)'\);") video_info = scrapertools.find_single_match(data, "load_player\('(.*?)','(.*?)'\);")
movie_info = scrapertools.find_single_match(item.url, 'http:\/\/ver-peliculas\.org\/peliculas\/(\d+)-(.*?)-\d{' movie_info = scrapertools.find_single_match(item.url,
'4}-online\.') 'http:\/\/ver-peliculas\.(io|org)\/peliculas\/(\d+)-(.*?)-\d{4}-online\.')
movie_id = movie_info[0] movie_host = movie_info[0]
movie_name = movie_info[1] movie_id = movie_info[1]
movie_name = movie_info[2]
sub = video_info[1] 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 data = httptools.downloadpage(url_base).data
json_data = jsontools.load(data) json_data = jsontools.load(data)
video_list = json_data['lista'] video_list = json_data['lista']
@@ -611,7 +611,7 @@ def findvideos(item):
patron = '<td><a href="([^"]+)".*?<img src="([^"]+)" title="([^<]+)" .*?<td>([^<]+)</td>.*?<td>([^<]+)</td>' patron = '<td><a href="([^"]+)".*?<img src="([^"]+)" title="([^<]+)" .*?<td>([^<]+)</td>.*?<td>([^<]+)</td>'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
print matches print matches
for scrapedurl, scrapedthumbnail, scrapedserver, scrapedidioma, scrapedcalidad in matches: for scrapedurl, scrapedthumbnail, scrapedserver, language, quality in matches:
server = scrapertools.get_match(scrapedserver, '(.*?)[.]') server = scrapertools.get_match(scrapedserver, '(.*?)[.]')
icon_server = os.path.join(config.get_runtime_path(), "resources", "images", "servers", 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): if not os.path.exists(icon_server):
icon_server = scrapedthumbnail icon_server = scrapedthumbnail
#TODO eliminar esta seccion
scrapedserver = scrapedserver.replace(scrapedserver, scrapedserver = scrapedserver.replace(scrapedserver,
"[COLOR darkorange][B]" + "[" + scrapedserver + "]" + "[/B][/COLOR]") "[COLOR darkorange][B]" + "[" + scrapedserver + "]" + "[/B][/COLOR]")
scrapedidioma = scrapedidioma.replace(scrapedidioma, language = language.replace(language,
"[COLOR lawngreen][B]" + "--" + scrapedidioma + "--" + "[/B][/COLOR]") "[COLOR lawngreen][B]" + "--" + language + "--" + "[/B][/COLOR]")
scrapedcalidad = scrapedcalidad.replace(scrapedcalidad, quality = quality.replace(quality,
"[COLOR floralwhite][B]" + scrapedcalidad + "[/B][/COLOR]") "[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, 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 return itemlist
+4 -3
View File
@@ -298,7 +298,7 @@ def findvideos(item):
if filtro_enlaces != 1: if filtro_enlaces != 1:
list_enlaces = bloque_enlaces(data, filtro_idioma, dict_idiomas, "Descarga Directa", item) list_enlaces = bloque_enlaces(data, filtro_idioma, dict_idiomas, "Descarga Directa", item)
if list_enlaces: 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)) text_bold=True))
itemlist.extend(list_enlaces) 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() + ")" title = " Mirror en " + server + " (" + language + ") (Calidad " + calidad.strip() + ")"
if filtro_idioma == 3 or item.filtro: if filtro_idioma == 3 or item.filtro:
lista_enlaces.append(item.clone(title=title, action="play", server=server, text_color=color2, 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: else:
idioma = dict_idiomas[language] idioma = dict_idiomas[language]
if idioma == filtro_idioma: if idioma == filtro_idioma:
lista_enlaces.append(item.clone(title=title, text_color=color2, action="play", 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: else:
if language not in filtrados: if language not in filtrados:
filtrados.append(language) filtrados.append(language)
+4 -2
View File
@@ -8,10 +8,12 @@ from platformcode import logger
def test_video_exists(page_url): def test_video_exists(page_url):
logger.info("(page_url='%s')" % 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" return False, "[Fastplay] El archivo no existe o ha sido borrado"
if data.code == 500:
return False, "[Fastplay] Error interno del servidor"
return True, "" return True, ""
+60 -97
View File
@@ -27,105 +27,68 @@ def test_video_exists(page_url):
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("url=" + page_url) logger.info("url=" + page_url)
# Lo pide una vez page_url = page_url.replace("playvid-", "")
data = httptools.downloadpage(page_url, cookies=False).data
# Si salta aviso, se carga la pagina de comprobacion y luego la inicial headers = {'Host': 'www.flashx.tv',
if "You try to access this video with Kodi" in data: 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36',
url_reload = scrapertools.find_single_match(data, 'try to reload the page.*?href="([^"]+)"') 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
url_reload = "http://www.flashx.tv" + url_reload[1:] '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: try:
data = httptools.downloadpage(url_reload, cookies=False).data match = jsunpack.unpack(match)
data = httptools.downloadpage(page_url, cookies=False).data 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: except:
pass 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 return video_urls
@@ -52,5 +52,6 @@
"visible": false "visible": false
} }
], ],
"thumbnail": "https://s26.postimg.org/y5arjad1l/rapidvideo1.png",
"version": 1 "version": 1
} }
+39 -22
View File
@@ -26,12 +26,16 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
data = httptools.downloadpage(page_url).data data = httptools.downloadpage(page_url).data
video_urls = [] 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: matches = scrapertools.find_multiple_matches(data, "type:\"video/([^\"]+)\",src:d\('([^']+)',(.*?)\).+?height:(\d+)")
ext = ext.replace("video/", "")
for ext, encoded, code, quality in matches:
media_url = decode(encoded, int(code))
if not media_url.startswith("http"): if not media_url.startswith("http"):
media_url = "http:%s" % media_url media_url = "http:" + media_url
video_urls.append([".%s %sp [streamcherry]" % (ext, calidad), media_url]) video_urls.append([".%s %sp [streamango]" % (ext, quality), media_url])
video_urls.reverse() video_urls.reverse()
for video_url in video_urls: 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 return video_urls
# Encuentra vídeos del servidor en el texto pasado def decode(encoded, code):
def find_videos(data): logger.info("encoded '%s', code '%s'" % (encoded, code))
encontrados = set()
devuelve = []
patronvideos = 'streamcherry.com/(?:embed|f)/([A-z0-9]+)' _0x59b81a = ""
logger.info("#" + patronvideos + "#") k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
matches = re.compile(patronvideos, re.DOTALL).findall(data) k = k[::-1]
for match in matches: count = 0
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)
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
+1 -1
View File
@@ -36,7 +36,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
for video_url in matches: for video_url in matches:
_hash = scrapertools.find_single_match(video_url, '[A-z0-9\_\-]{40,}') _hash = scrapertools.find_single_match(video_url, '[A-z0-9\_\-]{40,}')
hash = _hash[::-1] hash = _hash[::-1]
hash = hash.replace(hash[2:3],"",1) hash = hash.replace(hash[1:2],"",1)
video_url = video_url.replace(_hash, hash) video_url = video_url.replace(_hash, hash)
filename = scrapertools.get_filename_from_url(video_url)[-4:] filename = scrapertools.get_filename_from_url(video_url)[-4:]