Merge pull request #444 from pipcat/master

Corrección hdfull y strings
This commit is contained in:
Alfa
2018-09-27 08:29:47 -05:00
committed by GitHub
4 changed files with 43 additions and 26 deletions
+30 -19
View File
@@ -65,6 +65,7 @@ def menupeliculas(item):
itemlist.append(Item(channel=item.channel, action="items_usuario", itemlist.append(Item(channel=item.channel, action="items_usuario",
title="[COLOR orange][B]Pendientes[/B][/COLOR]", title="[COLOR orange][B]Pendientes[/B][/COLOR]",
url=host + "/a/my?target=movies&action=pending&start=-28&limit=28", folder=True)) url=host + "/a/my?target=movies&action=pending&start=-28&limit=28", folder=True))
itemlist.append(Item(channel=item.channel, action="fichas", title="ABC", url=host + "/peliculas/abc", folder=True)) itemlist.append(Item(channel=item.channel, action="fichas", title="ABC", url=host + "/peliculas/abc", folder=True))
itemlist.append( itemlist.append(
Item(channel=item.channel, action="fichas", title="Últimas películas", url=host + "/peliculas", folder=True)) Item(channel=item.channel, action="fichas", title="Últimas películas", url=host + "/peliculas", folder=True))
@@ -94,6 +95,7 @@ def menuseries(item):
itemlist.append(Item(channel=item.channel, action="items_usuario", itemlist.append(Item(channel=item.channel, action="items_usuario",
title="[COLOR orange][B]Para Ver[/B][/COLOR]", title="[COLOR orange][B]Para Ver[/B][/COLOR]",
url=host + "/a/my?target=shows&action=watch&start=-28&limit=28", folder=True)) url=host + "/a/my?target=shows&action=watch&start=-28&limit=28", folder=True))
itemlist.append(Item(channel=item.channel, action="series_abc", title="A-Z", folder=True)) itemlist.append(Item(channel=item.channel, action="series_abc", title="A-Z", folder=True))
itemlist.append(Item(channel=item.channel, action="novedades_episodios", title="Últimos Emitidos", itemlist.append(Item(channel=item.channel, action="novedades_episodios", title="Últimos Emitidos",
url=host + "/a/episodes?action=latest&start=-24&limit=24&elang=ALL", folder=True)) url=host + "/a/episodes?action=latest&start=-24&limit=24&elang=ALL", folder=True))
@@ -109,6 +111,7 @@ def menuseries(item):
Item(channel=item.channel, action="generos_series", title="Series por Género", url=host, folder=True)) Item(channel=item.channel, action="generos_series", title="Series por Género", url=host, folder=True))
itemlist.append(Item(channel=item.channel, action="listado_series", title="Listado de todas las series", itemlist.append(Item(channel=item.channel, action="listado_series", title="Listado de todas las series",
url=host + "/series/list", folder=True)) url=host + "/series/list", folder=True))
if account: if account:
itemlist.append(Item(channel=item.channel, action="items_usuario", itemlist.append(Item(channel=item.channel, action="items_usuario",
title="[COLOR orange][B]Favoritas[/B][/COLOR]", title="[COLOR orange][B]Favoritas[/B][/COLOR]",
@@ -235,6 +238,7 @@ def fichas(item):
infoLabels=dict() 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(
@@ -248,6 +252,7 @@ def fichas(item):
data = s_p[0] + s_p[1] data = s_p[0] + s_p[1]
else: else:
data = agrupa_datos(httptools.downloadpage(item.url).data) data = agrupa_datos(httptools.downloadpage(item.url).data)
data = re.sub( data = re.sub(
r'<div class="span-6[^<]+<div class="item"[^<]+' + \ r'<div class="span-6[^<]+<div class="item"[^<]+' + \
'<a href="([^"]+)"[^<]+' + \ '<a href="([^"]+)"[^<]+' + \
@@ -496,9 +501,11 @@ def findvideos(item):
itemlist = [] itemlist = []
it1 = [] it1 = []
it2 = [] it2 = []
## Carga estados ## Carga estados
status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data) status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data)
url_targets = item.url url_targets = item.url
## Vídeos ## Vídeos
id = "" id = ""
type = "" type = ""
@@ -521,41 +528,43 @@ def findvideos(item):
thumbnail=item.thumbnail, show=item.show)) thumbnail=item.thumbnail, show=item.show))
it1.append(Item(channel=item.channel, action="set_status", title=title, fulltitle=title, url=url_targets, it1.append(Item(channel=item.channel, action="set_status", title=title, fulltitle=title, url=url_targets,
thumbnail=item.thumbnail, show=item.show, language=item.language, folder=True)) thumbnail=item.thumbnail, show=item.show, language=item.language, folder=True))
data_js = httptools.downloadpage("%s/templates/hdfull/js/jquery.hdfull.view.min.js" % host).data data_js = httptools.downloadpage("%s/templates/hdfull/js/jquery.hdfull.view.min.js" % host).data
key = scrapertools.find_single_match(data_js, 'JSON.parse\(atob.*?substrings\((.*?)\)') key = scrapertools.find_single_match(data_js, 'JSON.parse\(atob.*?substrings\((.*?)\)')
data_js = httptools.downloadpage("%s/js/providers.js" % host).data data_js = httptools.downloadpage("%s/js/providers.js" % host).data
try: try:
data_js = jhexdecode(data_js) from lib import alfaresolver
provs = alfaresolver.hdfull_providers(data_js)
if provs == '': return []
except: except:
from lib.aadecode import decode as aadecode return []
data_js = data_js.split(";゚ω゚")
decode_aa = ""
for match in data_js:
decode_aa += aadecode(match)
data_js = re.sub(r':(function.*?\})', r':"\g<1>"', decode_aa)
data_js = re.sub(r':(var[^,]+),', r':"\g<1>",', data_js)
data = agrupa_datos(httptools.downloadpage(item.url).data) data = agrupa_datos(httptools.downloadpage(item.url).data)
data_obf = scrapertools.find_single_match(data, "var ad\s*=\s*'([^']+)'") data_obf = scrapertools.find_single_match(data, "var ad\s*=\s*'([^']+)'")
data_decrypt = jsontools.load(obfs(base64.b64decode(data_obf), 126 - int(key))) data_decrypt = jsontools.load(obfs(base64.b64decode(data_obf), 126 - int(key)))
infolabels = {} infolabels = {}
year = scrapertools.find_single_match(data, '<span>A&ntilde;o:\s*</span>.*?(\d{4})') year = scrapertools.find_single_match(data, '<span>A&ntilde;o:\s*</span>.*?(\d{4})')
infolabels["year"] = year infolabels["year"] = year
matches = [] matches = []
for match in data_decrypt: for match in data_decrypt:
prov = eval(scrapertools.find_single_match(data_js, 'p\[%s\]\s*=\s*(\{.*?\}[\']\})' % match["provider"])) if match['provider'] in provs:
server_url = scrapertools.find_single_match(prov['l'], 'return\s*"(.*?)"') try:
url = '%s%s' % (server_url, match['code']) embed = provs[match['provider']][0]
url = re.sub(r'\'|"|\s|\+', '', url) url = eval(provs[match['provider']][1].replace('_code_', "match['code']"))
url = re.sub(r'var_\d+\[\d+\]', '', url) matches.append([match['lang'], match['quality'], url, embed])
embed = prov["e"] except:
matches.append([match["lang"], match["quality"], url, embed]) pass
for idioma, calidad, url, embed in matches: for idioma, calidad, url, embed in matches:
mostrar_server = True if embed == 'd':
option = "Ver"
option1 = 1
if re.search(r'return ([\'"]{2,}|\})', embed):
option = "Descargar" option = "Descargar"
option1 = 2 option1 = 2
else:
option = "Ver"
option1 = 1
calidad = unicode(calidad, "utf8").upper().encode("utf8") calidad = unicode(calidad, "utf8").upper().encode("utf8")
title = option + ": %s (" + calidad + ")" + " (" + idioma + ")" title = option + ": %s (" + calidad + ")" + " (" + idioma + ")"
thumbnail = item.thumbnail thumbnail = item.thumbnail
@@ -569,6 +578,7 @@ def findvideos(item):
Item(channel=item.channel, action="play", title=title, url=url, thumbnail=thumbnail, Item(channel=item.channel, action="play", title=title, url=url, thumbnail=thumbnail,
plot=plot, fanart=fanart, show=item.show, folder=True, infoLabels=infolabels, language=idioma, plot=plot, fanart=fanart, show=item.show, folder=True, infoLabels=infolabels, language=idioma,
contentTitle=item.contentTitle, contentType=item.contentType, tipo=option, tipo1=option1, idioma=idioma)) contentTitle=item.contentTitle, contentType=item.contentType, tipo=option, tipo1=option1, idioma=idioma))
it2 = servertools.get_servers_itemlist(it2, lambda i: i.title % i.server.capitalize()) it2 = servertools.get_servers_itemlist(it2, lambda i: i.title % i.server.capitalize())
it2.sort(key=lambda it: (it.tipo1, it.idioma, it.server)) it2.sort(key=lambda it: (it.tipo1, it.idioma, it.server))
for item in it2: for item in it2:
@@ -576,6 +586,7 @@ def findvideos(item):
item.url += "###" + id + ";" + type item.url += "###" + id + ";" + type
itemlist.extend(it1) itemlist.extend(it1)
itemlist.extend(it2) itemlist.extend(it2)
## 2 = película ## 2 = película
if type == "2" and item.category != "Cine": if type == "2" and item.category != "Cine":
if config.get_videolibrary_support(): if config.get_videolibrary_support():
File diff suppressed because one or more lines are too long
@@ -3245,6 +3245,10 @@ msgctxt "#70135"
msgid "Custom Colours" msgid "Custom Colours"
msgstr "Colores Personalizados" msgstr "Colores Personalizados"
msgctxt "#70136"
msgid "Tv Show"
msgstr "Serie"
msgctxt "#70137" msgctxt "#70137"
msgid "Movies" msgid "Movies"
msgstr "Películas" msgstr "Películas"
@@ -4000,7 +4004,7 @@ msgid "Error in the user and/or password. Check your credentials"
msgstr "Error en el usuario y/o contraseña. Comprueba tus credenciales" msgstr "Error en el usuario y/o contraseña. Comprueba tus credenciales"
msgctxt "#70331" msgctxt "#70331"
msgid "Error during login. Check your credentials msgid "Error during login. Check your credentials"
msgstr "Error durante el login. Comprueba tus credenciales" msgstr "Error durante el login. Comprueba tus credenciales"
msgctxt "#70332" msgctxt "#70332"
@@ -4052,7 +4056,7 @@ msgid "[Trakt] Remove %s from your watchlist"
msgstr "[Trakt] Eliminar %s de tu watchlist" msgstr "[Trakt] Eliminar %s de tu watchlist"
msgctxt "#70344" msgctxt "#70344"
msgid "Add to %s your watchlist"" msgid "Add to %s your watchlist"
msgstr "[Trakt] Añadir %s a tu watchlist" msgstr "[Trakt] Añadir %s a tu watchlist"
msgctxt "#70345" msgctxt "#70345"
@@ -4060,7 +4064,7 @@ msgid "[Trakt] Remove %s from your collection"
msgstr "[Trakt] Eliminar %s de tu colección" msgstr "[Trakt] Eliminar %s de tu colección"
msgctxt "#70346" msgctxt "#70346"
msgid "[Trakt] Add %s to your collection msgid "[Trakt] Add %s to your collection"
msgstr "[Trakt] Añadir %s a tu colección" msgstr "[Trakt] Añadir %s a tu colección"
msgctxt "#70347" msgctxt "#70347"
@@ -4684,8 +4688,8 @@ msgid "Genre: "
msgstr "Género: " msgstr "Género: "
msgctxt "#70500" msgctxt "#70500"
msgid "Notification([COLOR red][B]Update Kodi to its latest version[/B][/COLOR], [COLOR skyblue]for best info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")" msgid "Notification([COLOR red][B]Update Kodi to its latest version[/B][/COLOR], [COLOR skyblue]for best info[/COLOR],8000, \"http://i.imgur.com/mHgwcn3.png\")"
msgstr "Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")" msgstr "Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000, \"http://i.imgur.com/mHgwcn3.png\")"
msgctxt "#70501" msgctxt "#70501"
msgid "Search did not match (%s)" msgid "Search did not match (%s)"
@@ -4928,7 +4932,7 @@ msgid "Movies by Genre"
msgstr "Por generos" msgstr "Por generos"
msgctxt "#70561" msgctxt "#70561"
msgid "Search Similar msgid "Search Similar"
msgstr "Buscar Similares" msgstr "Buscar Similares"
+2
View File
@@ -17,6 +17,8 @@ def test_video_exists(page_url):
data = httptools.downloadpage(page_url, headers={'referer': referer}).data data = httptools.downloadpage(page_url, headers={'referer': referer}).data
if data == "File was deleted" or data == '': if data == "File was deleted" or data == '':
return False, "[powvideo] El video ha sido borrado" return False, "[powvideo] El video ha sido borrado"
if 'function(p,a,c,k,e,' not in data:
return False, "[powvideo] El video no está disponible"
return True, "" return True, ""