diff --git a/README.md b/README.md
index 64734f0..2055bac 100644
--- a/README.md
+++ b/README.md
@@ -48,11 +48,11 @@
⭐ XHS-Downloader 开发计划及进度可前往 Projects 查阅
📸 程序截图
🎥 点击图片观看演示视频
-
+
-
+
-
+
🔗 支持链接
https://www.xiaohongshu.com/explore/作品ID?xsec_token=XXX
@@ -106,9 +106,9 @@
命令示例:python .\main.py --browser_cookie Chrome --update_settings
bool
类型参数支持使用 true
、false
、1
、0
、yes
、no
、on
或 off
(不区分大小写)来设置。
-
+
-
+
🖥 服务器模式
启动:运行命令:python .\main.py server
关闭:按下 Ctrl
+ C
关闭服务器
@@ -197,6 +197,7 @@ def api_demo():
- 提取发现作品链接、搜索作品、用户链接时,脚本可以自动滚动页面加载更多内容,默认滚动页面次数:10 次
- 自动滚动页面功能默认关闭;用户可以自由开启,并修改滚动检测间隔、滚动页面次数,修改后立即生效
- 如果未开启自动滚动页面功能,用户需要手动滚动页面以便加载更多内容后再进行其他操作
+- 支持作品文件打包下载;该功能默认开启,多个文件的作品将会以压缩包格式下载
- 使用全局代理工具可能会导致脚本下载文件失败,如有异常,请尝试关闭代理工具,必要时向作者反馈
- XHS-Downloader 用户脚本仅实现可见即可得的数据采集功能,无任何收费功能和破解功能
diff --git a/README_EN.md b/README_EN.md
index 84be1fe..8513d6a 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -49,11 +49,11 @@
⭐ The development plan and progress of XHS-Downloader can be found at Projects
📸 Program Screenshots
🎥 Click the images to watch the demo video
-
+
-
+
-
+
🔗 Supported Links
https://www.xiaohongshu.com/explore/WorksID?xsec_token=XXX
@@ -107,9 +107,9 @@
Command example: python .\main.py --browser_cookie Chrome --update_settings
The bool
type parameters support setting with true
, false
, 1
, 0
, yes
, no
, on
or off
(case insensitive).
-
+
-
+
🖥 Server Mode
Start: Run the command: python .\main.py server
Stop: Press Ctrl
+ C
to stop the server
@@ -201,6 +201,7 @@ def api_demo():
- When extracting links to explore works, searching for works, and user links, the script can automatically scroll the page to load more content. The default number of page scrolls is 10.
- The automatic page scroll feature is turned off by default. Users can enable it and modify the scroll detection interval and the number of scrolls, with changes taking effect immediately.
- If the automatic page scroll feature is not enabled, users need to manually scroll the page to load more content before performing other actions.
+- Support packaging and downloading of work files; This feature is enabled by default, and works from multiple files will be downloaded in compressed file format
- Using global proxy tools may cause script download failures. If there are issues, please try disabling the proxy tool. If necessary, contact the author for feedback.
- XHS-Downloader userscript only implements the data collection functionality for visible content and does not include any paid or cracked features.
@@ -285,7 +286,7 @@ async def example():
name_format |
str |
-1Format of works file name, separated by spaces between fields, supports fields: 收藏数量 、评论数量 、分享数量 、点赞数量 、作品标签 、作品ID 、作品标题 、作品描述 、作品类型 、发布时间 、最后更新时间 、作者昵称 、作者ID |
+#Format of works file name, separated by spaces between fields, supports fields: 收藏数量 、评论数量 、分享数量 、点赞数量 、作品标签 、作品ID 、作品标题 、作品描述 、作品类型 、发布时间 、最后更新时间 、作者昵称 、作者ID |
发布时间 作者昵称 作品标题 |
diff --git a/source/CLI/main.py b/source/CLI/main.py
index 3b03a53..48fc680 100644
--- a/source/CLI/main.py
+++ b/source/CLI/main.py
@@ -39,15 +39,13 @@ def inner(ctx: Context, param, value):
class CLI:
def __init__(self, ctx: Context, **kwargs):
- # print(kwargs)
self.ctx = ctx
- self.url = kwargs.pop("url")
- self.index = self.__format_index(kwargs.pop("index"))
- self.path = kwargs.pop("settings")
- self.update = kwargs.pop("update_settings")
- # print(kwargs)
+ self.url = ctx.params.pop("url")
+ self.index = self.__format_index(ctx.params.pop("index"))
+ self.path = ctx.params.pop("settings")
+ self.update = ctx.params.pop("update_settings")
self.settings = Settings(self.__check_settings_path())
- self.parameter = self.settings.run() | self.__clean_params(kwargs)
+ self.parameter = self.settings.run() | self.__clean_params(ctx.params)
self.APP = XHS(**self.parameter)
async def __aenter__(self):
@@ -116,7 +114,8 @@ def help_(ctx: Context, param, value) -> None:
options = (
("--url", "-u", "str", _("小红书作品链接")),
- ("--index", "-i", "str", _("下载指定序号的图片文件,仅对图文作品生效;多个序号输入示例:\"1 3 5 7\"")),
+ ("--index", "-i", "str",
+ fill(_("下载指定序号的图片文件,仅对图文作品生效;多个序号输入示例:\"1 3 5 7\""), width=55),),
("--work_path", "-wp", "str", _("作品数据 / 文件保存根路径")),
("--folder_name", "-fn", "str", _("作品文件储存文件夹名称")),
("--name_format", "-nf", "str", _("作品文件名称格式")),
@@ -126,7 +125,7 @@ def help_(ctx: Context, param, value) -> None:
("--cookie", "-ck", "str", _("小红书网页版 Cookie,无需登录")),
("--proxy", "-p", "str", _("网络代理")),
("--timeout", "-t", "int", _("请求数据超时限制,单位:秒")),
- ("--chunk", "-c", "int", _("下载文件时,每次从服务器获取的数据块大小,单位:字节")),
+ ("--chunk", "-c", "int", fill(_("下载文件时,每次从服务器获取的数据块大小,单位:字节"), width=55),),
("--max_retry", "-mr", "int", _("请求数据失败时,重试的最大次数")),
("--record_data", "-rd", "bool", _("是否记录作品数据至文件")),
("--image_format", "-if", "choice", _("图文作品文件下载格式,支持:PNG、WEBP")),
@@ -141,7 +140,7 @@ def help_(ctx: Context, param, value) -> None:
BrowserCookie.SUPPORT_BROWSER.keys(),
start=1,
))
- ), width=40)),
+ ), width=55)),
("--update_settings", "-us", "flag", _("是否更新配置文件")),
("--help", "-h", "flag", _("查看详细参数说明")),
("--version", "-v", "flag", _("查看 XHS-Downloader 版本")),
@@ -218,4 +217,4 @@ async def main():
from click.testing import CliRunner
runner = CliRunner()
- result = runner.invoke(cli, ['-l', 'en_US', '-h'])
+ result = runner.invoke(cli, ['-l', 'en_US', '-u', ''])
diff --git a/source/TUI/index.py b/source/TUI/index.py
index 4805941..5bfebc3 100644
--- a/source/TUI/index.py
+++ b/source/TUI/index.py
@@ -90,7 +90,6 @@ def on_mount(self) -> None:
">" *
50}",
style=MASTER),
- animate=True,
scroll_end=True,
)
self.xhs.manager.print_proxy_tip(log=self.tip, )
@@ -102,12 +101,10 @@ async def deal_button(self):
else:
self.tip.write(
Text(_("未输入任何小红书作品链接"), style=WARNING),
- animate=True,
scroll_end=True,
)
self.tip.write(
Text(">" * 50, style=GENERAL),
- animate=True,
scroll_end=True,
)
@@ -132,7 +129,6 @@ async def deal(self):
)
self.tip.write(
Text(">" * 50, style=GENERAL),
- animate=True,
scroll_end=True,
)
await self.app.action_back()
diff --git a/source/TUI/monitor.py b/source/TUI/monitor.py
index 3f1d638..f8f2787 100644
--- a/source/TUI/monitor.py
+++ b/source/TUI/monitor.py
@@ -53,7 +53,6 @@ def on_mount(self) -> None:
Text(_(
"程序会自动读取并提取剪贴板中的小红书作品链接,并自动下载链接对应的作品文件,如需关闭,请点击关闭按钮,或者向剪贴板写入 “close” 文本!"),
style=MASTER),
- animate=True,
scroll_end=True,
)
self.run_monitor()
diff --git a/source/module/static.py b/source/module/static.py
index 08d77de..b4e2ac4 100644
--- a/source/module/static.py
+++ b/source/module/static.py
@@ -2,7 +2,7 @@
VERSION_MAJOR = 2
VERSION_MINOR = 4
-VERSION_BETA = True
+VERSION_BETA = False
ROOT = Path(__file__).resolve().parent.parent.parent
PROJECT = f"XHS-Downloader V{VERSION_MAJOR}.{
VERSION_MINOR}{" Beta" if VERSION_BETA else ""}"
diff --git a/source/module/tools.py b/source/module/tools.py
index 7510929..49ae686 100644
--- a/source/module/tools.py
+++ b/source/module/tools.py
@@ -22,7 +22,7 @@ async def inner(self, *args, **kwargs):
def logging(log, text, style=INFO):
string = Text(text, style=style)
if log:
- log.write(string, animate=True, scroll_end=True, )
+ log.write(string, scroll_end=True, )
else:
print(string)
diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2761.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2761.png"
deleted file mode 100644
index c868406..0000000
Binary files "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2761.png" and /dev/null differ
diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2762.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2762.png"
deleted file mode 100644
index fe3b2aa..0000000
Binary files "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\2762.png" and /dev/null differ
diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN1.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN1.png"
new file mode 100644
index 0000000..204e104
Binary files /dev/null and "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN1.png" differ
diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN2.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN2.png"
new file mode 100644
index 0000000..b56bed5
Binary files /dev/null and "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276CN2.png" differ
diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN1.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN1.png"
new file mode 100644
index 0000000..424f63a
Binary files /dev/null and "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN1.png" differ
diff --git "a/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN2.png" "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN2.png"
new file mode 100644
index 0000000..efa7240
Binary files /dev/null and "b/static/screenshot/\345\221\275\344\273\244\350\241\214\346\250\241\345\274\217\346\210\252\345\233\276EN2.png" differ
diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN1.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN1.png"
index b996edf..cbbd509 100644
Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN1.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN1.png" differ
diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN2.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN2.png"
index e58a97e..63c3c0d 100644
Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN2.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN2.png" differ
diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN3.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN3.png"
index 5e2c7d2..0e36c8e 100644
Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN3.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276CN3.png" differ
diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN1.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN1.png"
index 1bb62d9..4a3c3ce 100644
Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN1.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN1.png" differ
diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN2.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN2.png"
index bf0ad7e..ab3b37d 100644
Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN2.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN2.png" differ
diff --git "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN3.png" "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN3.png"
index de1e408..f3daca8 100644
Binary files "a/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN3.png" and "b/static/screenshot/\347\250\213\345\272\217\350\277\220\350\241\214\346\210\252\345\233\276EN3.png" differ