From ca59399a3e51038060ce408f5468390478f1cd3c Mon Sep 17 00:00:00 2001 From: hect0x7 <93357912+hect0x7@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:11:55 +0800 Subject: [PATCH] =?UTF-8?q?v1.4.0:=20=E6=9B=B4=E6=96=B0JM=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E9=85=8D=E7=BD=AE=20(#11)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/config/option_test.yml | 18 ++---------------- assets/config/workflow_option.yml | 14 -------------- src/jmcomic/__init__.py | 2 +- src/jmcomic/jm_config.py | 6 +++--- src/jmcomic/jm_toolkit.py | 2 +- 5 files changed, 7 insertions(+), 35 deletions(-) diff --git a/assets/config/option_test.yml b/assets/config/option_test.yml index 0709d1d6..ba97b7b6 100644 --- a/assets/config/option_test.yml +++ b/assets/config/option_test.yml @@ -14,7 +14,7 @@ download_use_disk_cache: true client_config: # 请求失败时,重试的次数,配个正数就行 retry_times: 10 - domain: jmcomic1.group + domain: null postman_type: cffi postman_type_list: - requests @@ -24,18 +24,4 @@ client_config: meta_data: proxies: null allow_redirects: true - cookies: null - headers: - 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 - authority: jmcomic1.group - sec-ch-ua: '"Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"' - 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/109.0.0.0 Safari/537.36 + cookies: null \ No newline at end of file diff --git a/assets/config/workflow_option.yml b/assets/config/workflow_option.yml index 2d54c09b..b5e50ac1 100644 --- a/assets/config/workflow_option.yml +++ b/assets/config/workflow_option.yml @@ -23,17 +23,3 @@ client_config: proxies: null allow_redirects: true cookies: null - headers: - 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 - authority: jmcomic1.rocks - sec-ch-ua: '"Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"' - 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/109.0.0.0 Safari/537.36 diff --git a/src/jmcomic/__init__.py b/src/jmcomic/__init__.py index c9828e70..0274ed68 100644 --- a/src/jmcomic/__init__.py +++ b/src/jmcomic/__init__.py @@ -2,6 +2,6 @@ # 被依赖方 <--- 使用方 # config <--- entity <--- toolkit <--- client <--- service <--- option -__version__ = '1.3.0' +__version__ = '1.4.0' from .api import * diff --git a/src/jmcomic/jm_config.py b/src/jmcomic/jm_config.py index 601d0cd8..be75a451 100644 --- a/src/jmcomic/jm_config.py +++ b/src/jmcomic/jm_config.py @@ -30,9 +30,9 @@ def default_headers(cls): return { 'authority': cls.DOMAIN, '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', + 'application/signed-exchange;v=b3;q=0.7', 'accept-language': 'zh-CN,zh;q=0.9', - 'sec-ch-ua': '"Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"', + 'sec-ch-ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"Windows"', 'sec-fetch-dest': 'document', @@ -40,7 +40,7 @@ def default_headers(cls): '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/109.0.0.0 ' + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 ' 'Safari/537.36', } diff --git a/src/jmcomic/jm_toolkit.py b/src/jmcomic/jm_toolkit.py index 041f68e6..5e924916 100644 --- a/src/jmcomic/jm_toolkit.py +++ b/src/jmcomic/jm_toolkit.py @@ -4,7 +4,7 @@ class JmcomicText: - pattern_jm_domain = compile('https://([\w.]+)') + pattern_jm_domain = compile('https://([\w.-]+)') pattern_jm_pa_id = compile('/(photos?|album)/(\d+)') pattern_html_photo_photo_id = compile('')