diff --git a/cpp/version.cmake b/cpp/version.cmake index baa10b41..19c9edfd 100644 --- a/cpp/version.cmake +++ b/cpp/version.cmake @@ -1,7 +1,7 @@ set(VERSION_MAJOR 5) set(VERSION_MINOR 58) -set(VERSION_PATCH 2) +set(VERSION_PATCH 3) set(VERSION_REVISION 0) add_definitions(-DVERSION_MAJOR=${VERSION_MAJOR}) add_definitions(-DVERSION_MINOR=${VERSION_MINOR}) diff --git a/py/LunaTranslator/translator/youdao5.py b/py/LunaTranslator/translator/youdao5.py deleted file mode 100644 index e439816a..00000000 --- a/py/LunaTranslator/translator/youdao5.py +++ /dev/null @@ -1,61 +0,0 @@ -from translator.basetranslator import basetrans - - -class TS(basetrans): - def langmap(self): - return {"zh": "zh-CHS"} - - def inittranslator(self): - headers = { - "authority": "ai.youdao.com", - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", - "accept-language": "zh-CN,zh;q=0.9", - "cache-control": "max-age=0", - "sec-ch-ua": '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Windows"', - "sec-fetch-dest": "document", - "sec-fetch-mode": "navigate", - "sec-fetch-site": "none", - "sec-fetch-user": "?1", - "upgrade-insecure-requests": "1", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36", - } - - self.proxysession.get( - "https://ai.youdao.com/product-fanyi-text.s", headers=headers - ) - - def translate(self, content): - - headers = { - "authority": "aidemo.youdao.com", - "accept": "application/json, text/javascript, */*; q=0.01", - "accept-language": "zh-CN,zh;q=0.9", - "content-type": "application/x-www-form-urlencoded; charset=UTF-8", - "origin": "https://ai.youdao.com", - "referer": "https://ai.youdao.com/", - "sec-ch-ua": '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Windows"', - "sec-fetch-dest": "empty", - "sec-fetch-mode": "cors", - "sec-fetch-site": "same-site", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36", - } - - data = { - "q": content, - "from": self.srclang, - "to": self.tgtlang, - } - - response = self.proxysession.post( - "https://aidemo.youdao.com/trans", data=data, headers=headers - ) - try: - js = response.json()["translation"][0] - - return js - except: - raise Exception(response.maybejson) diff --git a/py/files/defaultconfig/config.json b/py/files/defaultconfig/config.json index 7a84c669..fb5a37cb 100644 --- a/py/files/defaultconfig/config.json +++ b/py/files/defaultconfig/config.json @@ -1821,11 +1821,6 @@ "color": "blue", "name": "有道_v3" }, - "youdao5": { - "use": false, - "color": "blue", - "name": "有道_v5" - }, "itrans": { "use": false, "color": "blue",