mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
Update ali.py
This commit is contained in:
parent
8951eb189a
commit
0fc328cc75
@ -1,4 +1,4 @@
|
|||||||
import re
|
import re, html
|
||||||
from translator.basetranslator import basetrans
|
from translator.basetranslator import basetrans
|
||||||
|
|
||||||
|
|
||||||
@ -80,11 +80,4 @@ class TS(basetrans):
|
|||||||
trans = data["data"]["translateText"]
|
trans = data["data"]["translateText"]
|
||||||
except:
|
except:
|
||||||
raise Exception(r.text)
|
raise Exception(r.text)
|
||||||
xx = re.findall("&#(.*?);", trans)
|
return html.unescape(trans)
|
||||||
xx = set(xx)
|
|
||||||
for _x in xx:
|
|
||||||
try:
|
|
||||||
trans = trans.replace("&#{};".format(_x), chr(int(_x)))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return trans
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user