Skip to content

Commit 25bc992

Browse files
committed
Merge branch 'devel' into pure-py
# Conflicts: # poetry.lock # pyproject.toml
2 parents d94754b + c5b792a commit 25bc992

File tree

24 files changed

+909
-314
lines changed

24 files changed

+909
-314
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- master
66
paths:
7+
- 'custom_templates/**'
78
- "ktoolbox/**"
89
- ".github/actions/setup-python/**"
910
- ".github/workflows/docs.yml"

CHANGELOG.md

Lines changed: 66 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,86 @@
11
## Changes
22

3-
![Downloads](https://img.shields.io/github/downloads/Ljzd-PRO/KToolBox/v0.22.0/total)
3+
![Downloads](https://img.shields.io/github/downloads/Ljzd-PRO/KToolBox/v0.23.0/total)
44

55
### ✨ Features
66

7-
- Added `job.download_file` and `job.download_attachments` configuration options to control **whether to download files and attachments in posts**
8-
- Related configuration options:
9-
- `job.download_file` (default: `True`): Whether to download the file corresponding to the `file` field of the post (usually the cover image)
10-
- `job.download_attachments` (default: `True`): Whether to download files corresponding to the `attachments` field of the post (usually original images, compressed packages, etc.)
11-
- These options are enabled by default to maintain the same behavior as previous versions
12-
- You can edit these options via `ktoolbox config-editor` (`Job -> ...`)
13-
- Or manually edit them in the `.env` file or environment variables:
7+
- Added configuration options to support **filtering** downloads by **file size**
8+
- You can set the minimum and maximum file size (in bytes) via `job.min_file_size` and `job.max_file_size`
9+
- Both options can be set together to define a file size range
10+
- Configure these options using the graphical config editor, or set them in the dotenv file `.env` or via system environment variables:
1411
```dotenv
15-
# Whether to download the file corresponding to the `file` field of the post (usually the cover image)
16-
# Download enabled by default
17-
KTOOLBOX_JOB__DOWNLOAD_FILE=False
12+
# Skip files smaller than 1 MB (to avoid downloading thumbnails)
13+
KTOOLBOX_JOB__MIN_FILE_SIZE=1048576
1814
19-
# Whether to download files corresponding to the `attachments` field of the post (usually original images, compressed packages, etc.)
20-
# Download enabled by default
21-
KTOOLBOX_JOB__DOWNLOAD_ATTACHMENTS=True
15+
# Skip files larger than 50 MB (to save disk space)
16+
KTOOLBOX_JOB__MAX_FILE_SIZE=52428800
17+
```
18+
- 📖 More info: [Configuration-Reference-JobConfiguration](https://ktoolbox.readthedocs.io/latest/configuration/reference/#ktoolbox.configuration.JobConfiguration)
19+
- Improved progress bar output
20+
- Fixed the issue of the download file progress bar **constantly reordering**
21+
- Added **visual overall progress bar**
22+
- Added display of **total download speed**
23+
- Enhanced the **color rendering** of the progress bar
24+
```
25+
🔄 [==>---------------------------] 9% | Jobs: 173/1870 | 3 running | 1694 waiting | 5.7MB/s
26+
27+
⠹ 0bh1EKTGt5Zg9nNaDAi25P... |███████████████████████████░░░| 3.7MB/4.0MB 92.5% ⚡ 1.9MB/s
28+
⠹ YV30J8ftUbE9dUkkJVCqvN... |███░░░░░░░░░░░░░░░░░░░░░░░░░░░| 527.0KB/4.1MB 12.5% ⚡ 1.9MB/s
29+
⠹ KvKMSpwB4rRknTPKhEiXle... |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░| 95.0KB/3.8MB 2.5% ⚡ 1.9MB/s
2230
```
23-
- 📖 More information: [Configuration Reference - JobConfiguration](https://ktoolbox.readthedocs.io/latest/zh/configuration/reference/#ktoolbox._configuration_zh.JobConfiguration)
2431
25-
[//]: # (### 🪲 Fixes)
32+
### 🪲 Fixes
33+
34+
- **Increased** the default **tps limit** (maximum number of connections established per second)
35+
- This setting is optional. To **improve download efficiency** in general cases, the default value has been increased from `1.0` to `5.0`
36+
- If you frequently encounter **403** errors during downloads, try setting this value lower, such as `1.0`
37+
- Run `ktoolbox config-editor` to edit this setting (`Downloader -> tps_limit`)
38+
- Or manually edit the `KTOOLBOX_DOWNLOADER__TPS_LIMIT` in the `.env` file or set it via environment variables
39+
```dotenv
40+
KTOOLBOX_DOWNLOADER__TPS_LIMIT=1.0
41+
```
42+
- 📖 More info: [Configuration-Reference-DownloaderConfiguration](https://ktoolbox.readthedocs.io/latest/configuration/reference/#ktoolbox.configuration.DownloaderConfiguration)
2643
2744
- - -
2845
2946
### ✨ 新特性
3047
31-
- 新增 `job.download_file` 和 `job.download_attachments` 配置项,控制**是否下载帖子中的文件和附件**
32-
- 相关配置项:
33-
- `job.download_file`(默认值:`True`):是否下载帖子的 `file` 字段对应的文件(通常是帖子封面图)
34-
- `job.download_attachments`(默认值:`True`):是否下载帖子的 `attachments` 字段对应的文件(通常是帖子中的正式原图、压缩包等附件)
35-
- 该配置项默认均为开启状态,保持与之前版本一致的行为
36-
- 可通过运行 `ktoolbox config-editor` 编辑这些配置(`Job -> ...`)
37-
- 或手动在 `.env` 文件或环境变量中编辑:
48+
- 增加配置项以支持**按文件大小过滤**下载
49+
- 通过配置 `job.min_file_size` 和 `job.max_file_size` 来设置最小和最大文件大小(单位:字节)
50+
- 你可以同时设置这两个选项来定义一个文件大小范围
51+
- 通过图形化配置编辑器或在 dotenv 文件 `.env` 或系统环境变量中设置这些配置:
3852
```dotenv
39-
# 是否下载帖子的 `file` 字段对应的文件(通常是帖子封面图)
40-
# 默认开启下载
41-
KTOOLBOX_JOB__DOWNLOAD_FILE=False
53+
# 跳过小于 1 MB 的文件 (避免下载到缩略图)
54+
KTOOLBOX_JOB__MIN_FILE_SIZE=1048576
4255
43-
# 是否下载帖子的 `attachments` 字段对应的文件(通常是帖子中的正式原图、压缩包等附件)
44-
# 默认开启下载
45-
KTOOLBOX_JOB__DOWNLOAD_ATTACHMENTS=True
56+
# 跳过大于 50 MB 的文件 (节省磁盘空间)
57+
KTOOLBOX_JOB__MAX_FILE_SIZE=52428800
4658
```
47-
- 📖更多信息:[配置参考-JobConfiguration](https://ktoolbox.readthedocs.io/latest/zh/configuration/reference/#ktoolbox._configuration_zh.JobConfiguration)
59+
- 📖 更多信息:[Configuration-Reference-JobConfiguration](https://ktoolbox.readthedocs.io/latest/zh/configuration/reference/#ktoolbox._configuration_zh.JobConfiguration)
60+
- 改进进度条输出
61+
- 修复了下载文件进度条**不断重新排序**的问题
62+
- 增加了**可视化的总进度条**
63+
- 增加了下载**总速度**显示
64+
- 增加了进度条的**颜色渲染**
65+
```
66+
🔄 [==>---------------------------] 9% | Jobs: 173/1870 | 3 running | 1694 waiting | 5.7MB/s
67+
68+
⠹ 0bh1EKTGt5Zg9nNaDAi25P... |███████████████████████████░░░| 3.7MB/4.0MB 92.5% ⚡ 1.9MB/s
69+
⠹ YV30J8ftUbE9dUkkJVCqvN... |███░░░░░░░░░░░░░░░░░░░░░░░░░░░| 527.0KB/4.1MB 12.5% ⚡ 1.9MB/s
70+
⠹ KvKMSpwB4rRknTPKhEiXle... |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░| 95.0KB/3.8MB 2.5% ⚡ 1.9MB/s
71+
```
72+
73+
### 🪲 修复
4874
49-
[//]: # (### 🪲 修复)
75+
- **提高**了默认的 **tps limit** (每秒最多建立的连接数)
76+
- 这项配置是可选的,为了**提高一般情况下的下载效率**,现在的默认值从 `1.0` 提升到了 `5.0`
77+
- 当下载频繁出现 **403** 错误时,可尝试将此设置改为较低值,如 `1.0`
78+
- 执行 `ktoolbox config-editor` 来编辑这项配置 (`Downloader -> tps_limit`)
79+
- 或手动编辑 `.env` 文件中的 `KTOOLBOX_DOWNLOADER__TPS_LIMIT` 或环境变量来设置这项配置
80+
```dotenv
81+
KTOOLBOX_DOWNLOADER__TPS_LIMIT=1.0
82+
```
83+
- 📖更多信息:[Configuration-Reference-DownloaderConfiguration](https://ktoolbox.readthedocs.io/latest/zh/configuration/reference/#ktoolbox._configuration_zh.DownloaderConfiguration)
5084
5185
## Upgrade
5286
@@ -55,4 +89,4 @@ Use this command to upgrade if you are using **pipx**:
5589
pipx upgrade ktoolbox
5690
```
5791

58-
**Full Changelog**: https://github.com/Ljzd-PRO/KToolBox/compare/v0.21.1...v0.22.0
92+
**Full Changelog**: https://github.com/Ljzd-PRO/KToolBox/compare/v0.22.0...v0.23.0

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ Thank you for your contribution!
5252
通过贡献您的代码,您同意将您的工作授权给项目根据项目的许可证。
5353

5454
## 5. 反馈
55-
如果您有其他问题或需要帮助,可以通过 [📫ljzd@office.ljzd-pro.asia](mailto:ljzd@office.ljzd-pro.asia) 联系我们。
55+
如果您有其他问题或需要帮助,可以通过 [📫ljzd@office.ljzd-pro.asia](mailto:me@ljzd.link) 联系我们。
5656

57-
谢谢您的贡献!
57+
谢谢您的贡献!

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
- Such as `[2025-01-02]_TheTitle_1.jpg`, `[2025-01-02]_TheTitle_2.jpg`, `[2025-01-02]_TheTitle_3.jpg`, etc.
6868
- Support excluding **specified file formats** or downloading only specified formats
6969
- For example, if you don't want to download large and duplicate PSD or archive files, you can exclude `.psd` and `.zip` files in the config
70+
- Support filtering downloads by **file size**
71+
- For example, if you want to avoid downloading large video files when running out of disk space, you can set a maximum file size limit in the config
72+
- You can also set a minimum file size to skip downloading thumbnail or preview images
7073
- Support filtering downloads by post **title keywords**
7174
- For example, if you only want to download posts whose titles contain "表情" or "効果音差分", you can use the `sync-creator` command with the `--keywords` option
7275
- You can also exclude posts with specific keywords in the title using the `--keywords-exclude` option

README_zh-CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
-`[2025-01-02]_TheTitle_1.jpg``[2025-01-02]_TheTitle_2.jpg``[2025-01-02]_TheTitle_3.jpg`
6969
- 支持排除 **指定格式** 的文件或仅下载指定格式的文件
7070
- 例如当你不想下载庞大重复的 PSD 和压缩包文件时,可以在配置中排除 `.psd``.zip` 文件
71+
- 支持按**文件大小**过滤下载
72+
- 例如,如果你想在磁盘空间不足时避免下载大型视频文件,可以在配置中设置最大文件大小限制
73+
- 你也可以设置最小文件大小,以跳过下载缩略图或预览图片
7174
- 支持按帖子**标题关键词**过滤下载
7275
- 例如你只想下载标题中包含“表情、効果音差分”的帖子,可以使用 `sync-creator` 命令的 `--keywords` 选项
7376
- 如果你想排除标题中包含指定关键词的帖子,可以使用 `--keywords-exclude` 选项

custom_templates/python/material/_base/docstring/attributes.html.jinja

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)