Skip to content

Commit

Permalink
v2.3.6: 新增基于线程池实现的异步客户端代理及其对应的启用插件,用于解决移动端Client一次多个请求要等待的问题,优化重试机制和缓…
Browse files Browse the repository at this point in the history
…存机制 (#147)
  • Loading branch information
hect0x7 authored Oct 3, 2023
1 parent df41112 commit 8070951
Show file tree
Hide file tree
Showing 13 changed files with 311 additions and 148 deletions.
7 changes: 6 additions & 1 deletion assets/config/option_test_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ client:
retry_times: 3
postman:
meta_data:
timeout: 5
timeout: 7

# 插件配置
plugin:
Expand All @@ -15,3 +15,8 @@ plugin:
kwargs:
interval: 0.5 # 间隔时间
enable_warning: false # 不告警

- plugin: client_proxy
kwargs:
proxy_client_key: cl_proxy_future
whitelist: [ api, ]
8 changes: 6 additions & 2 deletions assets/config/option_workflow_download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ dir_rule:

client:
domain:
- jmcomic1.me
- jmcomic.me
html: [jmcomic1.me, jmcomic.me]

# 插件配置
plugin:
Expand All @@ -15,3 +14,8 @@ plugin:
kwargs:
interval: 0.5 # 间隔时间
enable_warning: false # 不告警

- plugin: client_proxy
kwargs:
proxy_client_key: cl_proxy_future
whitelist: [ api, ]
2 changes: 1 addition & 1 deletion src/jmcomic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 被依赖方 <--- 使用方
# config <--- entity <--- toolkit <--- client <--- option <--- downloader

__version__ = '2.3.5'
__version__ = '2.3.6'

from .api import *
from .jm_plugin import *
2 changes: 1 addition & 1 deletion src/jmcomic/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def download_batch(download_api,

return multi_thread_launcher(
iter_objs=set(
JmcomicText.parse_to_album_id(jmid)
JmcomicText.parse_to_jm_id(jmid)
for jmid in jm_id_iter
),
apply_each_obj_func=lambda aid: download_api(aid, option, downloader),
Expand Down
2 changes: 1 addition & 1 deletion src/jmcomic/cl.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def parse(text):
from .jm_toolkit import JmcomicText

try:
return JmcomicText.parse_to_album_id(text)
return JmcomicText.parse_to_jm_id(text)
except Exception as e:
print(e.args[0])
exit(1)
Expand Down
Loading

0 comments on commit 8070951

Please sign in to comment.