From a34b0d38675161fc5495b15d22745cec4ccf07da Mon Sep 17 00:00:00 2001 From: test123456654321 <16307130148@fudan.edu.cn> Date: Mon, 28 Oct 2024 13:42:07 +0800 Subject: [PATCH] fix --- src/LunaTranslator/cishu/japandict.py | 7 +++++-- src/LunaTranslator/cishu/jisho.py | 2 +- src/plugins/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/LunaTranslator/cishu/japandict.py b/src/LunaTranslator/cishu/japandict.py index b87b7f26..238c9157 100644 --- a/src/LunaTranslator/cishu/japandict.py +++ b/src/LunaTranslator/cishu/japandict.py @@ -10,7 +10,7 @@ class japandict(cishubase): html = requests.get( link, proxies=self.proxy, - ).content + ).content.replace(b"padding-top:60px !important", b"") base64_content = base64.b64encode(html).decode("utf-8") saver[link] = f"data:application/octet-stream;base64,{base64_content}" @@ -21,8 +21,11 @@ class japandict(cishubase): proxies=self.proxy, ).text + check = get_element_by("class", "alert-heading", html) + if check: + return res = get_element_by("class", "list-group list-group-flush", html) - if res is None: + if not res: return ts = [] saver = {} diff --git a/src/LunaTranslator/cishu/jisho.py b/src/LunaTranslator/cishu/jisho.py index e8798a32..ab5e1a1b 100644 --- a/src/LunaTranslator/cishu/jisho.py +++ b/src/LunaTranslator/cishu/jisho.py @@ -100,7 +100,7 @@ document.querySelectorAll('.tab-widget_xxxxxx_internal .tab-button_xxxx_internal if get_element_by("id", "no-matches", html): return res = get_element_by("id", "page_container", html) - if res is None: + if not res: return res = ( res.replace('href="//', 'href="https://') diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index e532f430..ea7f8e62 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 52) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)