Skip to content

Commit 41b3c0c

Browse files
authored
v2.1.2: 修复禁漫最新图片请求失败的问题 (#76)
1 parent e2d9232 commit 41b3c0c

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/jmcomic/__init__.py

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

5-
__version__ = '2.1.1'
5+
__version__ = '2.1.2'
66

77
from .api import *

src/jmcomic/api.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def download_album(jm_album_id, option=None):
1818
jm_debug('album',
1919
f'本子获取成功: [{album.id}], '
2020
f'作者: [{album.author}], '
21-
f'章节数: [{len(album)}]'
21+
f'章节数: [{len(album)}], '
2222
f'标题: [{album.title}], '
2323
)
2424

@@ -30,11 +30,14 @@ def download_photo(photo: JmPhotoDetail,
3030
jm_debug(debug_topic,
3131
f'开始下载章节: {photo.id} ({photo.album_id}[{photo.index}/{len(album)}]), '
3232
f'标题: [{photo.title}], '
33-
f'图片数为[{len(photo)}]')
33+
f'图片数为[{len(photo)}]'
34+
)
3435

3536
download_by_photo_detail(photo, option)
3637

37-
jm_debug(debug_topic, f'章节下载完成: {photo.id} ({photo.album_id}[{photo.index}/{len(album)}])')
38+
jm_debug(debug_topic,
39+
f'章节下载完成: {photo.id} ({photo.album_id}[{photo.index}/{len(album)}])'
40+
)
3841

3942
thread_pool_executor(
4043
iter_objs=album,
@@ -98,7 +101,8 @@ def download_image(index, image: JmImageDetail, debug_topic='image'):
98101
# 已下载过,缓存命中
99102
if use_cache is True and file_exists(img_save_path):
100103
jm_debug(debug_topic,
101-
f'图片已存在: {debug_tag} ← [{img_save_path}]')
104+
f'图片已存在: {debug_tag} ← [{img_save_path}]'
105+
)
102106
return
103107

104108
# 开始下载
@@ -109,7 +113,8 @@ def download_image(index, image: JmImageDetail, debug_topic='image'):
109113
)
110114

111115
jm_debug(debug_topic,
112-
f'图片下载完成: {debug_tag}, [{image.img_url}] → [{img_save_path}]')
116+
f'图片下载完成: {debug_tag}, [{image.img_url}] → [{img_save_path}]'
117+
)
113118

114119
length = len(photo_detail)
115120
# 根据图片数,决定下载策略

src/jmcomic/jm_client_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def get_if_fail_raise(url):
246246
"""
247247
使用此方法包装 self.get
248248
"""
249-
resp = JmImageResp(self.get(url))
249+
resp = JmImageResp(self.get(url, params={'v': format_ts()}))
250250

251251
if resp.is_success:
252252
return resp

0 commit comments

Comments
 (0)