Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ae96e20

Browse files
authoredDec 7, 2023
v2.4.7: 实现收藏本子功能,优化获取收藏夹功能传参,优化Headers和域名的处理; 更新文档、dispatch工作流文案+脚本. (#176)
1 parent a7e8ea2 commit ae96e20

File tree

14 files changed

+233
-123
lines changed

14 files changed

+233
-123
lines changed
 

‎.github/workflows/close_specific_pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: Close specific PR
22

33
on:
44
pull_request:
5+
types: [opened, ]
6+
# Note: If you use both the branches filter and the paths filter, the workflow will only run when both filters are satisfied.
7+
branches:
8+
- master
59
paths:
610
- 'usage/workflow_download.py'
7-
types: [opened, ]
8-
911
jobs:
1012
close_pr:
1113
env:

‎.github/workflows/download_dispatch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ on:
1515

1616
CLIENT_IMPL:
1717
type: string
18-
description: 客户端类型(client.impl),[api]=移动端,[html]=网页端。下载失败时,你可以尝试填入此项重试。
18+
description: 客户端类型(client.impl),下载失败时,你可以尝试填入此项重试。'api' 表示移动端,'html' 表示网页端
1919
default: ''
2020
required: false
2121

2222
IMAGE_SUFFIX:
2323
type: string
24-
description: 图片后缀(download.cache.suffix),默认为空,表示不做图片格式转换。可填入例如 "png" "jpg"。
24+
description: 图片后缀(download.cache.suffix),默认为空,表示不做图片格式转换。可填入例如 'png' 'jpg'
2525
default: ''
2626
required: false
2727

2828
DIR_RULE:
2929
type: string
30-
description: 下载文件夹规则(dir_rule.rule)。此处可以不填,默认使用配置文件的'Bd_Aauthor_Atitle_Pindex'。
30+
description: 下载文件夹规则(dir_rule.rule)。默认使用配置文件的 'Bd_Aauthor_Atitle_Pindex'。
3131
default: ''
3232
required: false
3333

‎assets/docs/sources/tutorial/5_filter.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ filter(过滤器)是v2.1.12新引入的机制,
66
使用filter的步骤如下:
77

88
```
9-
1. 自定义class,继承JmDownloader,重写filter_iter_objs方法,即:
9+
1. 自定义class,继承JmDownloader,重写do_filter方法,即:
1010
class MyDownloader(JmDownloader):
11-
def filter_iter_objs(self, iter_objs: DownloadIterObjs):
12-
# 如何重写?参考JmDownloader.filter_iter_objs和下面的示例
11+
def do_filter(self, detail):
12+
# 如何重写?参考JmDownloader.do_filter和下面的示例
1313
...
1414
1515
2. 让你的class生效,使用如下代码:
@@ -30,8 +30,8 @@ from jmcomic import *
3030

3131
class First3ImageDownloader(JmDownloader):
3232

33-
def filter_iter_objs(self, iter_objs: DownloadIterObjs):
34-
if isinstance(iter_objs, JmPhotoDetail):
33+
def do_filter(self, detail):
34+
if detail.is_photo():
3535
photo: JmPhotoDetail = iter_objs
3636
# 支持[start,end,step]
3737
return photo[:3]
@@ -52,8 +52,8 @@ class FindUpdateDownloader(JmDownloader):
5252
'xxx': 'yyy'
5353
}
5454

55-
def filter_iter_objs(self, iter_objs: DownloadIterObjs):
56-
if not isinstance(iter_objs, JmAlbumDetail):
55+
def do_filter(self, detail):
56+
if not detail.is_album():
5757
return iter_objs
5858

5959
return self.find_update(iter_objs)

‎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.4.6'
5+
__version__ = '2.4.7'
66

77
from .api import *
88
from .jm_plugin import *
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Please sign in to comment.