Update ali.py

This commit is contained in:
恍兮惚兮 2024-04-22 12:36:37 +08:00
parent 8951eb189a
commit 0fc328cc75

View File

@ -1,4 +1,4 @@
import re
import re, html
from translator.basetranslator import basetrans
@ -80,11 +80,4 @@ class TS(basetrans):
trans = data["data"]["translateText"]
except:
raise Exception(r.text)
xx = re.findall("&#(.*?);", trans)
xx = set(xx)
for _x in xx:
try:
trans = trans.replace("&#{};".format(_x), chr(int(_x)))
except:
pass
return trans
return html.unescape(trans)