Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Byaidu committed Dec 6, 2024
1 parent f631a50 commit 6d1591b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pdf2zh/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ def translate(self, text):
ig, iid, key, token = self.fineSID()
resp = self.session.post(
f"{self.endpoint}?IG={ig}&IID={iid}",
data={"fromLang": self.lang_in, "to": self.lang_out, "text": text, "token": token, "key": key},
data={
"fromLang": self.lang_in,
"to": self.lang_out,
"text": text,
"token": token,
"key": key,
},
headers=self.headers,
)
return resp.json()[0]["translations"][0]["text"]
Expand Down

0 comments on commit 6d1591b

Please sign in to comment.