alcuni fix per kodi 19

This commit is contained in:
marco
2020-08-16 12:55:12 +02:00
parent ae2a9d7c72
commit bfb80f6889
42 changed files with 6510 additions and 2735 deletions
+5 -3
View File
@@ -85,7 +85,7 @@ def decodeHtmlentities(data):
if match.group(1) == "#" and ent.replace(";", "").isdigit():
ent = unichr(int(ent.replace(";", "")))
return ent.encode('utf-8')
return ent if PY3 else ent.encode('utf-8')
else:
cp = html5.get(ent)
if cp:
@@ -112,9 +112,11 @@ def unescape(text):
# character reference
try:
if text[:3] == "&#x":
return unichr(int(text[3:-1], 16)).encode("utf-8")
ret = unichr(int(text[3:-1], 16))
return ret if PY3 else ret.encode("utf-8")
else:
return unichr(int(text[2:-1])).encode("utf-8")
ret = unichr(int(text[2:-1]))
return ret if PY3 else ret.encode("utf-8")
except ValueError:
logger.error("error de valor")