Skip to content

Commit 9ef2185

Browse files
authored
v2.6.14: 更新禁漫发布页地址和测试case (#514)
1 parent 620a094 commit 9ef2185

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/jmcomic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 被依赖方 <--- 使用方
33
# config <--- entity <--- toolkit <--- client <--- option <--- downloader
44

5-
__version__ = '2.6.13'
5+
__version__ = '2.6.14'
66

77
from .api import *
88
from .jm_plugin import *

src/jmcomic/jm_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ class JmMagicConstants:
8080
APP_TOKEN_SECRET_2 = '18comicAPPContent'
8181
APP_DATA_SECRET = '185Hcomic3PAPP7R'
8282
API_DOMAIN_SERVER_SECRET = 'diosfjckwpqpdfjkvnqQjsik'
83-
APP_VERSION = '2.0.16'
83+
APP_VERSION = '2.0.18'
8484

8585

8686
# 模块级别共用配置
8787
class JmModuleConfig:
8888
# 网站相关
8989
PROT = "https://"
9090
JM_REDIRECT_URL = f'{PROT}jm365.work/3YeBdF' # 永久網域,怕走失的小伙伴收藏起来
91-
JM_PUB_URL = f'{PROT}jmcomic-fb.vip'
91+
JM_PUB_URL = f'{PROT}jmcomicgo.org'
9292
JM_CDN_IMAGE_URL_TEMPLATE = PROT + 'cdn-msp.{domain}/media/photos/{photo_id}/{index:05}{suffix}' # index 从1开始
9393
JM_IMAGE_SUFFIX = ['.jpg', '.webp', '.png', '.gif']
9494

tests/test_jmcomic/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import io
21
import platform
32
import unittest
43

54
# noinspection PyUnresolvedReferences
65
import jmcomic
76
from jmcomic import *
87

9-
# set encoding
10-
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, 'utf-8')
11-
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, 'utf-8')
8+
# 设置编码为 utf-8,使用 reconfigure() 而非替换 sys.stdout 对象
9+
# 直接替换会破坏 pytest 的 I/O 捕获机制,导致 "I/O operation on closed file" 错误
10+
if hasattr(sys.stdout, 'reconfigure'):
11+
sys.stdout.reconfigure(encoding='utf-8')
12+
if hasattr(sys.stderr, 'reconfigure'):
13+
sys.stderr.reconfigure(encoding='utf-8')
1214
# 获取项目根目录
1315
project_dir = os.path.abspath(os.path.dirname(__file__) + '/../..')
1416
os.chdir(project_dir)

tests/test_jmcomic/test_jm_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def search_and_test(expected_result, params):
186186
cases = {
187187
152637: {
188188
'search_query': '无修正',
189-
'order_by': JmMagicConstants.ORDER_BY_LIKE,
189+
'order_by': JmMagicConstants.ORDER_BY_VIEW,
190190
'time': JmMagicConstants.TIME_ALL,
191191
},
192192
147643: {

0 commit comments

Comments
 (0)