From e33c0df92ee75428c4198efb014fc7513919b390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Wed, 17 Jul 2024 00:53:15 +0800 Subject: [PATCH] . --- LunaTranslator/LunaTranslator/translator/youdao.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LunaTranslator/LunaTranslator/translator/youdao.py b/LunaTranslator/LunaTranslator/translator/youdao.py index 56d5c360..93547aa9 100644 --- a/LunaTranslator/LunaTranslator/translator/youdao.py +++ b/LunaTranslator/LunaTranslator/translator/youdao.py @@ -26,7 +26,7 @@ class TS(basetrans): } def inittranslator(self): - headers = { + self.headers = { "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", "Cache-Control": "no-cache", @@ -44,7 +44,7 @@ class TS(basetrans): } # proxies = { "http": None, "https": None} - self.proxysession.get("https://fanyi.youdao.com", headers=headers) + self.proxysession.get("https://fanyi.youdao.com", headers=self.headers) def translate(self, content):