更新翻译

This commit is contained in:
2022-12-06 09:38:01 +08:00
parent 51635cf2c0
commit ed39b338c9
9 changed files with 118 additions and 108 deletions

View File

@@ -6,6 +6,7 @@ import traceback
class Trans():
isTrans = False
unCloudTrans = True
word = {}
fileName = ""
@@ -29,6 +30,8 @@ class Trans():
try:
return self.word[text]
except:
if self.unCloudTrans:
return text
# 机翻
data = { 'doctype': 'json', 'type': 'auto','i': text}
jsonReturn = requests.post("http://fanyi.youdao.com/translate", data=data).json()["translateResult"]