Skip to content

Commit c34301d

Browse files
authored
v2.4.1: 实现获取个人收藏夹内容,优化类和函数的命名 (#163)(#164)
1 parent bf2ca6e commit c34301d

18 files changed

+604
-328
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ $ jmcomic 422866
5656
- **支持Plugin插件,可以方便地扩展功能,以及使用别人的插件**
5757
- 目前内置支持的插件有:`登录插件` `硬件占用监控插件` `只下载新章插件` `压缩文件插件` `下载特定后缀图片插件` `发送QQ邮件插件` `日志主题过滤插件` `自动使用浏览器cookies插件`
5858
- 支持自定义本子/章节/图片下载前后的回调函数
59-
- 支持自定义debug/logging
59+
- 支持自定义日志
6060
- 支持自定义类:`Downloader(负责调度)` `Option(负责配置)` `Client(负责请求)` `实体类`
6161

6262
## 进阶使用

assets/docs/sources/TODO.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
| 版本范围 | 更新内容 |
44
|:--------:|:--------------------------------------:|
5-
| v2.3.* | 实现移动端API的基础功能,统一HTML和API的实现 |
5+
| v2.4.* | 项目实现基本稳定,进入维护期,按需增加功能。 |
6+
| v2.3.* | 实现移动端API的基础功能,统一HTML和API的实现。 |
67
| v2.2.* | 新的插件体系,新的命令行调用,完善搜索功能。 |
78
| v2.1.* | 拆分Downloader抽象调度,优化可扩展性、代码复用性、模块级别自定义。 |
89
| v2.0.* | 重新设计合理的抽象层次,实现请求重试切换域名机制,新的option配置设计。 |

assets/docs/sources/index.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,34 @@ Python API for JMComic(禁漫天堂)
77
- Bypasses Cloudflare anti-bot measures.
88
- Multiple usage ways:
99

10-
- GitHub Actions: Requires only a GitHub account. (See
11-
tutorial → [Tutorial - Download Album via GitHub Actions](./tutorial/1_github_actions.md))
12-
- Command line: No need to write Python code, simple and easy to use. (See tutorial → [Tutorial - Download Album via Command Line](./tutorial/2_command_line.md))
13-
- Python code: The most flexible and powerful way, requires some basic knowledge of Python programming.
10+
- GitHub Actions: Requires only a GitHub account. (See
11+
tutorial → [Tutorial - Download Album via GitHub Actions](./tutorial/1_github_actions.md))
12+
- Command line: No need to write Python code, simple and easy to use. (See
13+
tutorial → [Tutorial - Download Album via Command Line](./tutorial/2_command_line.md))
14+
- Python code: The most flexible and powerful way, requires some basic knowledge of Python programming.
15+
1416
- Supports two client implementations: web-based and mobile-based. Switchable through configuration (mobile-based has
1517
better IP compatibility, web-based has higher efficiency).
1618
- Supports automatic request retry and domain switching mechanism.
1719
- Multi-threaded downloading (can be fine-tuned to one thread per image, highly efficient).
1820
- Highly configurable:
1921

20-
- Can be used without configuration, very convenient.
21-
- Configuration can be generated from a configuration file, supports multiple file formats.
22-
- Configuration options
23-
include: `request domain`, `client implementation`, `number of chapters/images downloaded simultaneously`, `image format conversion`, `download path rules`, `request metadata (headers, cookies, proxies)`,
24-
and more.
22+
- Can be used without configuration, very convenient.
23+
- Configuration can be generated from a configuration file, supports multiple file formats.
24+
- Configuration options
25+
include: `request domain`, `client implementation`, `number of chapters/images downloaded simultaneously`, `image format conversion`, `download path rules`, `request metadata (headers, cookies, proxies)`,
26+
and more.
27+
2528
- Highly extensible:
2629

27-
- Supports Plugin plugins for easy functionality extension and use of other plugins.
28-
- Currently built-in plugins: `login plugin`, `hardware usage monitoring plugin`, `only download new chapters plugin`, `zip compression plugin`, `image suffix filter plugin` `send qq email plugin` `debug logging topic filter plugin` `auto set browser cookies plugin`.
29-
- Supports custom callback functions before and after downloading album/chapter/images.
30-
- Supports custom debug logging.
31-
- Supports custom core
32-
classes: `Downloader (responsible for scheduling)`, `Option (responsible for configuration)`, `Client (responsible for requests)`, `entity classes`,
33-
and more.
30+
- Supports Plugin for easy functionality extension and use of other plugins.
31+
- Currently built-in
32+
plugins: `login plugin`, `hardware usage monitoring plugin`, `only download new chapters plugin`, `zip compression plugin`, `image suffix filter plugin` `send qq email plugin` `logging topic filter plugin` `auto set browser cookies plugin`.
33+
- Supports custom callback functions before and after downloading album/chapter/images.
34+
- Supports custom logging.
35+
- Supports custom core
36+
classes: `Downloader (responsible for scheduling)`, `Option (responsible for configuration)`, `Client (responsible for requests)`, `entity classes`,
37+
and more.
3438

3539
## Install
3640

assets/docs/sources/tutorial/4_module_custom.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,27 +140,27 @@ def custom_album_photo_image_detail_class():
140140

141141

142142

143-
## 自定义debug
143+
## 自定义log
144144

145145
```python
146-
def custom_jm_debug():
146+
def custom_jm_log():
147147
"""
148-
该函数演示自定义debug
148+
该函数演示自定义log
149149
"""
150150

151-
# jmcomic模块在运行过程中会使用 jm_debug() 这个函数进行打印信息
152-
# jm_debug() 这个函数 最后会调用 JmModuleConfig.debug_executor 函数
153-
# 你可以写一个自己的函数,替换 JmModuleConfig.debug_executor,实现自定义debug
151+
# jmcomic模块在运行过程中会使用 jm_log() 这个函数进行打印信息
152+
# jm_log() 这个函数 最后会调用 JmModuleConfig.log_executor 函数
153+
# 你可以写一个自己的函数,替换 JmModuleConfig.log_executor,实现自定义log
154154

155-
# 1. 自定义debug函数
156-
def my_debug(topic: str, msg: str):
155+
# 1. 自定义log函数
156+
def my_log(topic: str, msg: str):
157157
"""
158-
这个debug函数的参数列表必须包含两个参数,topic和msg
159-
@param topic: debug主题,例如 'album.before', 'req.error', 'plugin.error'
160-
@param msg: 具体debug的信息
158+
这个log函数的参数列表必须包含两个参数,topic和msg
159+
@param topic: log主题,例如 'album.before', 'req.error', 'plugin.error'
160+
@param msg: 具体log的信息
161161
"""
162162
pass
163163

164-
# 2. 让my_debug生效
165-
JmModuleConfig.debug_executor = my_debug
164+
# 2. 让my_log生效
165+
JmModuleConfig.log_executor = my_log
166166
```

assets/docs/sources/tutorial/8_pick_domain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ meta_data = {
1313
# 'proxies': ProxyBuilder.clash_proxy()
1414
}
1515

16-
disable_jm_debug()
16+
disable_jm_log()
1717

1818

1919
def get_domain_ls():

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.17'
5+
__version__ = '2.4.1'
66

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

src/jmcomic/cl.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ def parse(text):
7777

7878
def main(self):
7979
self.parse_arg()
80-
from .api import jm_debug
81-
jm_debug('command_line',
82-
f'start downloading...\n'
83-
f'- using option: [{self.option_path or "default"}]\n'
84-
f'to be downloaded: \n'
85-
f'- album: {self.album_id_list}\n'
86-
f'- photo: {self.photo_id_list}')
80+
from .api import jm_log
81+
jm_log('command_line',
82+
f'start downloading...\n'
83+
f'- using option: [{self.option_path or "default"}]\n'
84+
f'to be downloaded: \n'
85+
f'- album: {self.album_id_list}\n'
86+
f'- photo: {self.photo_id_list}')
8787

8888
from .api import create_option, JmOption
8989
if self.option_path is not None:

0 commit comments

Comments
 (0)