This commit is contained in:
Alhaziel
2020-01-20 19:38:21 +01:00
11 changed files with 30 additions and 45 deletions
+3 -24
View File
@@ -39,30 +39,9 @@ def find_multiple_matches_groups(text, pattern):
# Convierte los codigos html "ñ" y lo reemplaza por "ñ" caracter unicode utf-8
def decodeHtmlentities(data):
entity_re = re.compile("&(#?)(\d{1,5}|\w{1,8})(;?)")
def substitute_entity(match):
ent = match.group(2) + match.group(3)
res = ""
while not ent in html5 and not ent.endswith(";") and match.group(1) != "#":
# Excepción para cuando '&' se usa como argumento en la urls contenidas en los datos
try:
res = ent[-1] + res
ent = ent[:-1]
except:
break
if match.group(1) == "#":
ent = unichr(int(ent.replace(";", "")))
return ent.encode('utf-8')
else:
cp = html5.get(ent)
if cp:
return cp.decode("unicode-escape").encode('utf-8') + res
else:
return match.group()
return entity_re.subn(substitute_entity, data)[0]
import HTMLParser
parser = HTMLParser.HTMLParser()
return parser.unescape(data)
def unescape(text):
+3 -2
View File
@@ -640,8 +640,9 @@ def menu(func):
item = args['item']
host = func.__globals__['host']
list_servers = func.__globals__['list_servers'] if 'list_servers' in func.__globals__ else 'directo'
list_quality = func.__globals__['list_quality'] if 'list_quality' in func.__globals__ else 'default'
list_servers = func.__globals__['list_servers'] if 'list_servers' in func.__globals__ else ['directo']
list_quality = func.__globals__['list_quality'] if 'list_quality' in func.__globals__ else ['default']
log('LIST QUALITY', list_quality)
filename = func.__module__.split('.')[1]
global_search = False
# listUrls = ['film', 'filmSub', 'tvshow', 'tvshowSub', 'anime', 'animeSub', 'search', 'top', 'topSub']