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

View File

@@ -65,6 +65,7 @@ def menupeliculas(item):
itemlist.append(Item(channel=item.channel, action="items_usuario",
title="[COLOR orange][B]Pendientes[/B][/COLOR]",
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="Últimas películas", url=host + "/peliculas", folder=True))
@@ -94,6 +95,7 @@ def menuseries(item):
itemlist.append(Item(channel=item.channel, action="items_usuario",
title="[COLOR orange][B]Para Ver[/B][/COLOR]",
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="novedades_episodios", title="Últimos Emitidos",
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))
itemlist.append(Item(channel=item.channel, action="listado_series", title="Listado de todas las series",
url=host + "/series/list", folder=True))
if account:
itemlist.append(Item(channel=item.channel, action="items_usuario",
title="[COLOR orange][B]Favoritas[/B][/COLOR]",
@@ -235,6 +238,7 @@ def fichas(item):
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(
@@ -248,6 +252,7 @@ def fichas(item):
data = s_p[0] + s_p[1]
else:
data = agrupa_datos(httptools.downloadpage(item.url).data)
data = re.sub(
r'<div class="span-6[^<]+<div class="item"[^<]+' + \
'<a href="([^"]+)"[^<]+' + \
@@ -496,9 +501,11 @@ def findvideos(item):
itemlist = []
it1 = []
it2 = []
## Carga estados
status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data)
url_targets = item.url
## Vídeos
id = ""
type = ""
@@ -521,41 +528,43 @@ def findvideos(item):
thumbnail=item.thumbnail, show=item.show))
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))
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\((.*?)\)')
data_js = httptools.downloadpage("%s/js/providers.js" % host).data
try:
data_js = jhexdecode(data_js)
from lib import alfaresolver
provs = alfaresolver.hdfull_providers(data_js)
if provs == '': return []
except:
from lib.aadecode import decode as aadecode
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)
return []
data = agrupa_datos(httptools.downloadpage(item.url).data)
data_obf = scrapertools.find_single_match(data, "var ad\s*=\s*'([^']+)'")
data_decrypt = jsontools.load(obfs(base64.b64decode(data_obf), 126 - int(key)))
infolabels = {}
year = scrapertools.find_single_match(data, '<span>A&ntilde;o:\s*</span>.*?(\d{4})')
infolabels["year"] = year
matches = []
for match in data_decrypt:
prov = eval(scrapertools.find_single_match(data_js, 'p\[%s\]\s*=\s*(\{.*?\}[\']\})' % match["provider"]))
server_url = scrapertools.find_single_match(prov['l'], 'return\s*"(.*?)"')
url = '%s%s' % (server_url, match['code'])
url = re.sub(r'\'|"|\s|\+', '', url)
url = re.sub(r'var_\d+\[\d+\]', '', url)
embed = prov["e"]
matches.append([match["lang"], match["quality"], url, embed])
if match['provider'] in provs:
try:
embed = provs[match['provider']][0]
url = eval(provs[match['provider']][1].replace('_code_', "match['code']"))
matches.append([match['lang'], match['quality'], url, embed])
except:
pass
for idioma, calidad, url, embed in matches:
mostrar_server = True
option = "Ver"
option1 = 1
if re.search(r'return ([\'"]{2,}|\})', embed):
if embed == 'd':
option = "Descargar"
option1 = 2
else:
option = "Ver"
option1 = 1
calidad = unicode(calidad, "utf8").upper().encode("utf8")
title = option + ": %s (" + calidad + ")" + " (" + idioma + ")"
thumbnail = item.thumbnail
@@ -569,6 +578,7 @@ def findvideos(item):
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,
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.sort(key=lambda it: (it.tipo1, it.idioma, it.server))
for item in it2:
@@ -576,6 +586,7 @@ def findvideos(item):
item.url += "###" + id + ";" + type
itemlist.extend(it1)
itemlist.extend(it2)
## 2 = película
if type == "2" and item.category != "Cine":
if config.get_videolibrary_support():

File diff suppressed because one or more lines are too long

View File

@@ -3245,6 +3245,10 @@ msgctxt "#70135"
msgid "Custom Colours"
msgstr "Colores Personalizados"
msgctxt "#70136"
msgid "Tv Show"
msgstr "Serie"
msgctxt "#70137"
msgid "Movies"
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"
msgctxt "#70331"
msgid "Error during login. Check your credentials
msgid "Error during login. Check your credentials"
msgstr "Error durante el login. Comprueba tus credenciales"
msgctxt "#70332"
@@ -4052,7 +4056,7 @@ msgid "[Trakt] Remove %s from your watchlist"
msgstr "[Trakt] Eliminar %s de tu watchlist"
msgctxt "#70344"
msgid "Add to %s your watchlist""
msgid "Add to %s your watchlist"
msgstr "[Trakt] Añadir %s a tu watchlist"
msgctxt "#70345"
@@ -4060,7 +4064,7 @@ msgid "[Trakt] Remove %s from your collection"
msgstr "[Trakt] Eliminar %s de tu colección"
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"
msgctxt "#70347"
@@ -4684,8 +4688,8 @@ msgid "Genre: "
msgstr "Género: "
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")"
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")"
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\")"
msgctxt "#70501"
msgid "Search did not match (%s)"
@@ -4928,7 +4932,7 @@ msgid "Movies by Genre"
msgstr "Por generos"
msgctxt "#70561"
msgid "Search Similar
msgid "Search Similar"
msgstr "Buscar Similares"

View File

@@ -17,6 +17,8 @@ def test_video_exists(page_url):
data = httptools.downloadpage(page_url, headers={'referer': referer}).data
if data == "File was deleted" or data == '':
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, ""