diff --git a/bot/plugins/deepl.py b/bot/plugins/deepl.py index d2236c2..813122a 100644 --- a/bot/plugins/deepl.py +++ b/bot/plugins/deepl.py @@ -42,10 +42,11 @@ class DeeplTranslatePlugin(Plugin): headers = { "Authorization": f"DeepL-Auth-Key {self.api_key}", "User-Agent": "chatgpt-telegram-bot", - "Content-Type": "application/x-www-form-urlencoded" + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "utf-8" } data = { "text": kwargs['text'], "target_lang": kwargs['to_language'] } - return requests.post(url, headers=headers, data=data).json()["translations"][0]["text"] + return requests.post(url, headers=headers, data=data).json()["translations"][0]["text"] \ No newline at end of file