issues/642

Update vndb.py
This commit is contained in:
恍兮惚兮 2024-04-11 12:29:02 +08:00
parent cfbc76f20b
commit 12ee2d5649
3 changed files with 30 additions and 1 deletions

View File

@ -75,16 +75,17 @@ def vndbdowloadinfo(vid):
def safegetvndbjson(url, json, getter):
try:
print(url, json)
_ = requests.post(
url,
json=json,
proxies=getproxy(),
)
print(_.text)
try:
return getter(_.json())
except:
# print_exc()
print(_.text)
return None
except:
return None

View File

@ -0,0 +1,22 @@
from translator.basetranslator import basetrans
class TS(basetrans):
def langmap(self):
return {"en": "English", "ja": "Japanese", "zh": "Chinese", "vi": "Vietnamese"}
def translate(self, query):
json_data = {
"content": {
"input_text": query,
"input_language": self.srclang,
"output_language": self.tgtlang,
},
"message": "translate sentences",
}
response = self.session.post(
"https://translation-server-proxy-7ja5f.ondigitalocean.app/", json=json_data
)
return response.json()[0]

View File

@ -948,6 +948,12 @@
"color": "#1839f0",
"name": "Sugoi"
},
"sugoionline": {
"use": true,
"color": "#1839f0",
"name": "Sugoi",
"useproxy": true
},
"kingsoft": {
"type": "offline",
"use": false,