mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-15 08:53:53 +08:00
17 lines
393 B
Python
17 lines
393 B
Python
from translator.basetranslator import basetrans
|
|
|
|
|
|
class TS(basetrans):
|
|
def translate(self, query):
|
|
|
|
json_data = {
|
|
"content": query,
|
|
"message": "translate sentences",
|
|
}
|
|
|
|
response = self.proxysession.post(self.config["api"], json=json_data)
|
|
try:
|
|
return response.json()
|
|
except:
|
|
raise Exception(response)
|