diff --git a/README.md b/README.md
index 254c2bb..24e25d1 100644
--- a/README.md
+++ b/README.md
@@ -257,6 +257,14 @@ async def example_api():
提示:使用 XHS-Downloader 用户脚本批量提取作品链接,搭配 XHS-Downloader 程序可以实现批量下载无水印作品文件!
+🌏 连接服务器
+⭐ 本项目支持通过浏览器用户脚本与主程序联动,实现一键推送下载任务。
+功能说明:
+- 在项目程序的配置文件中,需要将
script_server 参数设置为 true
+- 保持项目程序在后台运行,它将作为服务器,接收用户脚本的指令(TUI、MCP 和 API 模式均支持)
+- 当您在浏览器中访问作品页面时,点击用户脚本菜单中的
推送下载任务 选项
+- 用户脚本会将下载任务发送给项目程序,由项目程序负责处理和下载文件
+
📜 脚本说明
- 下载小红书无水印作品文件时,脚本需要花费时间处理文件,请等待片刻,请勿多次点击下载按钮
@@ -476,6 +484,12 @@ async def example():
设置程序语言,目前支持:zh_CN、en_US |
zh_CN |
+
+| script_server |
+bool |
+是否开启用户脚本服务器,用于接收浏览器用户脚本的下载任务(TUI、MCP 和 API 模式生效) |
+false |
+
diff --git a/README_EN.md b/README_EN.md
index ba995c4..95b4294 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -261,6 +261,14 @@ async def example_api():
Note: Using the XHS-Downloader user script to batch extract works links, in combination with the XHS-Downloader program, can achieve batch downloading of watermark-free works files!
+🌐 Connect to Server
+⭐ This project supports interaction with the main program through a browser userscript, enabling one-click push of download tasks.
+Function Description:
+- In the project program's configuration file, you need to set the
script_server parameter to true
+- Keep the project program running in the background, where it will act as a server to receive commands from the userscript (TUI, MCP, and API modes are all supported)
+- When you visit a post page in your browser, click the
Push Download Task option in the userscript menu
+- The userscript will send the download task to the project program, which will handle and download the files
+
📜 Script Instructions
- When downloading watermark-free works from Xiaohongshu, the script requires time to process the files. Please wait for a moment and do not click the download button multiple times.
@@ -480,6 +488,12 @@ async def example():
Set program language. Currently supported: zh_CN, en_US |
zh_CN |
+
+| script_server |
+bool |
+Whether to enable the user script server for receiving download tasks from the browser user script (effective in TUI, MCP, and API modes) |
+false |
+
diff --git a/source/CLI/main.py b/source/CLI/main.py
index 9c5a47e..8ad53d5 100644
--- a/source/CLI/main.py
+++ b/source/CLI/main.py
@@ -45,7 +45,11 @@ class CLI:
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(ctx.params)
+ self.parameter = (
+ self.settings.run()
+ | self.__clean_params(ctx.params)
+ | {"script_server": False}
+ )
self.APP = XHS(**self.parameter)
async def __aenter__(self):
diff --git a/static/Release_Notes.md b/static/Release_Notes.md
index d02342a..a5ba4f9 100644
--- a/static/Release_Notes.md
+++ b/static/Release_Notes.md
@@ -1,9 +1,10 @@
**项目更新内容:**
1. 修复 MCP 模式无法下载文件的问题
-2. 新增连接用户脚本下载作品功能
-3. 新增作品处理统计功能
-4. 调整内置延时机制
+2. 新增 `script_server` 配置参数
+3. 新增连接用户脚本下载作品功能
+4. 新增作品处理统计功能
+5. 调整内置延时机制
*****
diff --git a/static/XHS-Downloader.js b/static/XHS-Downloader.js
index e8a3ea6..bc8c65c 100644
--- a/static/XHS-Downloader.js
+++ b/static/XHS-Downloader.js
@@ -2,7 +2,7 @@
// @name XHS-Downloader
// @namespace xhs_downloader
// @homepage https://github.com/JoeanAmier/XHS-Downloader
-// @version 2.2.1
+// @version 2.2.2
// @tag 小红书
// @tag RedNote
// @description 提取小红书作品/用户链接,下载小红书无水印图文/视频作品文件