docs: 更新用户脚本连接服务器功能说明

This commit is contained in:
Quan
2025-12-15 21:12:56 +08:00
parent 9d2547885d
commit e53c15ddc1
5 changed files with 38 additions and 5 deletions

View File

@@ -257,6 +257,14 @@ async def example_api():
<img src="static/screenshot/用户脚本截图4.png" alt="">
</details>
<p>提示:使用 XHS-Downloader 用户脚本批量提取作品链接,搭配 XHS-Downloader 程序可以实现批量下载无水印作品文件!</p>
<h2>🌏 连接服务器</h2>
<p>⭐ 本项目支持通过浏览器用户脚本与主程序联动,实现一键推送下载任务。</p>
<ul><b>功能说明:</b>
<li>在项目程序的配置文件中,需要将 <code>script_server</code> 参数设置为 <code>true</code></li>
<li>保持项目程序在后台运行它将作为服务器接收用户脚本的指令TUI、MCP 和 API 模式均支持)</li>
<li>当您在浏览器中访问作品页面时,点击用户脚本菜单中的 <code>推送下载任务</code> 选项</li>
<li>用户脚本会将下载任务发送给项目程序,由项目程序负责处理和下载文件</li>
</ul>
<h2>📜 脚本说明</h2>
<ul>
<li>下载小红书无水印作品文件时,脚本需要花费时间处理文件,请等待片刻,请勿多次点击下载按钮</li>
@@ -476,6 +484,12 @@ async def example():
<td align="center">设置程序语言,目前支持:<code>zh_CN</code><code>en_US</code></td>
<td align="center">zh_CN</td>
</tr>
<tr>
<td align="center">script_server</td>
<td align="center">bool</td>
<td align="center">是否开启用户脚本服务器用于接收浏览器用户脚本的下载任务TUI、MCP 和 API 模式生效)</td>
<td align="center">false</td>
</tr>
</tbody>
</table>
<hr>

View File

@@ -261,6 +261,14 @@ async def example_api():
<img src="static/screenshot/用户脚本截图4.png" alt="">
</details>
<p>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!</p>
<h2>🌐 Connect to Server</h2>
<p>⭐ This project supports interaction with the main program through a browser userscript, enabling one-click push of download tasks.</p>
<ul><b>Function Description:</b>
<li>In the project program's configuration file, you need to set the <code>script_server</code> parameter to <code>true</code></li>
<li>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)</li>
<li>When you visit a post page in your browser, click the <code>Push Download Task</code> option in the userscript menu</li>
<li>The userscript will send the download task to the project program, which will handle and download the files</li>
</ul>
<h2>📜 Script Instructions</h2>
<ul>
<li>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.</li>
@@ -480,6 +488,12 @@ async def example():
<td align="center">Set program language. Currently supported: <code>zh_CN</code>, <code>en_US</code></td>
<td align="center">zh_CN</td>
</tr>
<tr>
<td align="center">script_server</td>
<td align="center">bool</td>
<td align="center">Whether to enable the user script server for receiving download tasks from the browser user script (effective in TUI, MCP, and API modes)</td>
<td align="center">false</td>
</tr>
</tbody>
</table>
<hr>

View File

@@ -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):

View File

@@ -1,9 +1,10 @@
**项目更新内容:**
1. 修复 MCP 模式无法下载文件的问题
2. 新增连接用户脚本下载作品功能
3. 新增作品处理统计功能
4. 调整内置延时机制
2. 新增 `script_server` 配置参数
3. 新增连接用户脚本下载作品功能
4. 新增作品处理统计功能
5. 调整内置延时机制
*****

View File

@@ -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 提取小红书作品/用户链接,下载小红书无水印图文/视频作品文件