Skip to content

Commit f4babde

Browse files
authored
v2.3.8: 修复图片在带query参数时,是否解码逻辑失效的bug (#149)
1 parent ad9427a commit f4babde

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
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.3.7'
5+
__version__ = '2.3.8'
66

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

src/jmcomic/jm_client_interface.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,14 @@ def get_jm_image(self, img_url) -> JmImageResp:
271271
raise NotImplementedError
272272

273273
@classmethod
274-
def img_is_not_need_to_decode(cls, data_original: str, _resp):
274+
def img_is_not_need_to_decode(cls, data_original: str, _resp) -> bool:
275+
# https://cdn-msp2.18comic.vip/media/photos/498976/00027.gif?v=1697541064
276+
query_params_index = data_original.find('?')
277+
278+
if query_params_index != -1:
279+
data_original = data_original[:query_params_index]
280+
281+
# https://cdn-msp2.18comic.vip/media/photos/498976/00027.gif
275282
return data_original.endswith('.gif')
276283

277284

0 commit comments

Comments
 (0)