From f30b28b0275eb3a9886f81931de63e1775feffc0 Mon Sep 17 00:00:00 2001 From: yuhldr Date: Fri, 6 Sep 2024 20:02:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BE=E5=BA=A6=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lfy/api/server/baidu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lfy/api/server/baidu.py b/lfy/api/server/baidu.py index 55a7920..755e959 100644 --- a/lfy/api/server/baidu.py +++ b/lfy/api/server/baidu.py @@ -44,7 +44,7 @@ def _translate(session, s, api_key_s, lang_to="auto", lang_from="auto"): s1 = "" for trans_result in result["trans_result"]: s1 += f'{trans_result["dst"]}\n' - return True, s1 + return True, s1.strip() return False, f'{error_msg}\n\n{result["error_code"]}: {result["error_msg"]}'