feat: 发布 2.2 版本

1. 移除 sec_ch_ua_platform 参数
2. 移除 sec_ch_ua 参数
3. 优化请求延时间隔
4. 优化并发下载功能
5. 修正英语翻译错误
6. 新增并发下载限制
7. 修正命令行模式错误
8. 简化数据请求头

Closes #86
Closes #87
Closes #93
Closes #98
Closes #105
Closes #109
Closes #110
Closes #140
Closes #152
Closes #154
Closes #157
Closes #159
Closes #160
Closes #162
Closes #164
Closes #165
This commit is contained in:
JoeanAmier
2024-08-30 12:01:25 +08:00
parent 44d5c61856
commit 0a52dc0ed2
24 changed files with 272 additions and 240 deletions

View File

@@ -122,9 +122,9 @@ class CLI:
("--work_path", "-wp", "str", _("作品数据 / 文件保存根路径")),
("--folder_name", "-fn", "str", _("作品文件储存文件夹名称")),
("--name_format", "-nf", "str", _("作品文件名称格式")),
("--sec_ch_ua", "-su", "str", _("Sec-Ch-Ua")),
("--sec_ch_ua_platform", "-sp", "str", _("User-Agent")),
("--user_agent", "-ua", "str", _("Sec-Ch-Ua-Platform")),
# ("--sec_ch_ua", "-su", "str", _("Sec-Ch-Ua")),
# ("--sec_ch_ua_platform", "-sp", "str", _("Sec-Ch-Ua-Platform")),
("--user_agent", "-ua", "str", _("User-Agent")),
("--cookie", "-ck", "str", _("小红书网页版 Cookie无需登录")),
("--proxy", "-p", "str", _("网络代理")),
("--timeout", "-t", "int", _("请求数据超时限制,单位:秒")),
@@ -133,6 +133,7 @@ class CLI:
("--record_data", "-rd", "bool", _("是否记录作品数据至文件")),
("--image_format", "-if", "choice", _("图文作品文件下载格式支持PNG、WEBP")),
("--live_download", "-ld", "bool", _("图文动图文件下载开关")),
("--download_record", "-dr", "bool", _("作品下载记录开关")),
("--folder_mode", "-fm", "bool", _("是否将每个作品的文件储存至单独的文件夹")),
("--language", "-l", "choice", _("设置程序语言目前支持zh_CN、en_GB")),
("--settings", "-s", "str", _("读取指定配置文件")),
@@ -165,8 +166,8 @@ class CLI:
)
@option("--folder_name", "-fn", )
@option("--name_format", "-nf", )
@option("--sec_ch_ua", "-su", )
@option("--sec_ch_ua_platform", "-sp", )
# @option("--sec_ch_ua", "-su", )
# @option("--sec_ch_ua_platform", "-sp", )
@option("--user_agent", "-ua", )
@option("--cookie", "-ck", )
@option("--proxy", "-p", )
@@ -176,12 +177,14 @@ class CLI:
@option("--record_data", "-rd", type=bool, )
@option("--image_format", "-if", type=Choice(["png", "PNG", "webp", "WEBP"]), )
@option("--live_download", "-ld", type=bool, )
@option("--download_record", "-dr", type=bool, )
@option("--folder_mode", "-fm", type=bool, )
@option("--language", "-l",
type=Choice(["zh_CN", "en_GB"]), )
@option("--settings", "-s", type=Path(dir_okay=False), )
@option("--browser_cookie", "-bc", type=Choice(list(BrowserCookie.SUPPORT_BROWSER.keys()
) + [str(i) for i in range(1, 11)]), callback=CLI.read_cookie, )
@option("--browser_cookie", "-bc", type=Choice(
list(BrowserCookie.SUPPORT_BROWSER.keys()
) + [str(i) for i in range(1, len(BrowserCookie.SUPPORT_BROWSER) + 1)]), callback=CLI.read_cookie, )
@option("--update_settings", "-us", type=bool,
is_flag=True, )
@option("-h",