From 053052e010d43dc3d8dd8c12174f57ba17a2b615 Mon Sep 17 00:00:00 2001 From: krau Date: Sun, 28 Jun 2026 10:00:28 +0000 Subject: [PATCH] deploy: c9bb6c9e3c325c83ffef5bbe4fa54a58b82de2df --- categories/index.html | 2 +- contribute/index.html | 2 +- deployment/configuration/index.html | 29 ++- deployment/configuration/storages/index.html | 2 +- deployment/index.html | 2 +- deployment/installation/index.html | 2 +- en/categories/index.html | 2 +- en/contribute/index.html | 2 +- en/deployment/configuration/index.html | 22 ++- .../configuration/storages/index.html | 2 +- en/deployment/index.html | 2 +- en/deployment/installation/index.html | 2 +- en/help/index.html | 2 +- en/index.html | 2 +- en/index.xml | 23 ++- en/sitemap.xml | 2 +- en/tags/index.html | 2 +- en/usage/api/index.html | 2 +- en/usage/aria2/index.html | 2 +- en/usage/cli/index.html | 34 ++++ en/usage/config/index.html | 33 ++++ en/usage/directlinks/index.html | 2 +- en/usage/index.html | 2 +- en/usage/index.xml | 23 ++- en/usage/parsers/index.html | 2 +- en/usage/rules/index.html | 19 +- en/usage/silent/index.html | 2 +- en/usage/transfer/index.html | 2 +- en/usage/watch/index.html | 2 +- en/usage/ytdlp/index.html | 2 +- help/index.html | 2 +- index.html | 2 +- index.xml | 177 ++++++++++++++++-- sitemap.xml | 2 +- tags/index.html | 2 +- usage/api/index.html | 2 +- usage/aria2/index.html | 2 +- usage/cli/index.html | 88 +++++++++ usage/config/index.html | 101 ++++++++++ usage/directlinks/index.html | 2 +- usage/index.html | 2 +- usage/index.xml | 177 ++++++++++++++++-- usage/parsers/index.html | 2 +- usage/rules/index.html | 56 +++--- usage/silent/index.html | 2 +- usage/transfer/index.html | 2 +- usage/watch/index.html | 2 +- usage/ytdlp/index.html | 2 +- zh/sitemap.xml | 2 +- 49 files changed, 734 insertions(+), 122 deletions(-) create mode 100644 en/usage/cli/index.html create mode 100644 en/usage/config/index.html create mode 100644 usage/cli/index.html create mode 100644 usage/config/index.html diff --git a/categories/index.html b/categories/index.html index b20a60b..0e4eaf4 100644 --- a/categories/index.html +++ b/categories/index.html @@ -1,4 +1,4 @@ Categories | Save Any Bot

Categories

Categories

\ No newline at end of file +简体中文

Categories

Categories

\ No newline at end of file diff --git a/contribute/index.html b/contribute/index.html index 8031f12..589cb8c 100644 --- a/contribute/index.html +++ b/contribute/index.html @@ -36,7 +36,7 @@ 在 parsers 目录下新建一个包, 编写解析器实现 在 parsers/parser.go 的 init 中注册解析器 如果使用 JavaScript 编写, 请参考 plugins/example_parser_basic.js 的实现, 并在该文件夹下新建一个 js 文件, 实现你的解析逻辑.">参与开发 | Save Any Bot

参与开发

参与开发 +简体中文

参与开发

参与开发 #

在开始之前, 请 Fork 本项目, 并克隆到本地, 安装好 Go 开发环境.

以下是一些贡献代码的指南或建议, 你不必完全遵守, 但将有助于快速 review 并合并你的提交:

  • 新功能请先提交 Issue, 以便讨论设计和实现细节, 并避免因与项目设计不符而被拒绝.
  • 使用现代开发工具, 确保提交前格式化代码, 并保持风格一致.
  • 使用语义化提交, 避免提交消息模糊或过于简单.

贡献新存储端 #

  1. pkg/enums/storage/storages.go 中添加新的存储端类型, 并运行代码生成
  2. config/storage 目录下定义存储端配置, 并添加到 config/storage/factory.go
  3. storage 目录下新建一个包, 编写存储端实现, 然后在 storage/storage.go 中导入并添加它
  4. 更新文档, 添加配置说明

贡献新解析器 #

你可以选择使用 Go 编写原生的解析器实现(推荐), 或是使用 JavaScript 以插件的方式实现.

如果使用 Go 编写, 请:

  1. parsers 目录下新建一个包, 编写解析器实现
  2. parsers/parser.goinit 中注册解析器

如果使用 JavaScript 编写, 请参考 plugins/example_parser_basic.js 的实现, 并在该文件夹下新建一个 js 文件, 实现你的解析逻辑.

需要注意, plugins 目录下解析器默认不会被编译到二进制文件中, 用户需要手动下载它们并放到本地指定目录下以启用它们.

\ No newline at end of file diff --git a/deployment/configuration/storages/index.html b/deployment/configuration/storages/index.html index da981d1..a7f32a9 100644 --- a/deployment/configuration/storages/index.html +++ b/deployment/configuration/storages/index.html @@ -44,7 +44,7 @@ base_path = "./downloads" # 本地存储的基础路径, 所有文件将存储 url = "https://webdav.example.com" # WebDAV 的 URL username = "your_username" # WebDAV password = "your_password" # WebDAV 的密码 base_path = "/path/to/webdav" # WebDAV 中的基础路径, 所有文件将存储在此路径下 S3 # type=s3'>存储端配置 | Save Any Bot

存储端配置

存储端配置 +简体中文

存储端配置

存储端配置 #

请先阅读 配置说明 了解配置文件的基本格式.

Alist #

type=alist

不支持 Stream 模式.

url = "https://alist.example.com" # Alist 的 URL
 username = "your_username"  # Alist 的用户名
diff --git a/deployment/index.html b/deployment/index.html
index de015bb..6fc31ed 100644
--- a/deployment/index.html
+++ b/deployment/index.html
@@ -1,6 +1,6 @@
 部署指南 | Save Any Bot
 

部署指南

\ No newline at end of file diff --git a/deployment/installation/index.html b/deployment/installation/index.html index c3bbea5..7c204d0 100644 --- a/deployment/installation/index.html +++ b/deployment/installation/index.html @@ -114,7 +114,7 @@ chmod +x /usr/bin/sabot chmod +x saveany-bot ./saveany-bot 进程守护 # systemd (常规 Linux) 创建文件 /etc/systemd/system/saveany-bot.service 并写入以下内容: [Unit] Description=SaveAnyBot After=systemd-user-sessions.service [Service] Type=simple WorkingDirectory=/yourpath/ ExecStart=/yourpath/saveany-bot Restart=always [Install] WantedBy=multi-user.target 设为开机启动并启动服务: systemctl enable --now saveany-bot procd (OpenWrt) 添加开机自启动服务 创建文件 /etc/init.d/saveanybot ,参考 wrt_init 并自行修改: #!/bin/sh /etc/rc.common #This is the OpenWRT init.d script for SaveAnyBot START=99 STOP=10 description="SaveAnyBot" WORKING_DIR="/mnt/mmc1-1/SaveAnyBot" EXEC_PATH="$WORKING_DIR/saveany-bot" start() { echo "Starting SaveAnyBot..." cd $WORKING_DIR $EXEC_PATH & } stop() { echo "Stopping SaveAnyBot..." killall saveany-bot } reload() { stop start } 赋予权限: chmod +x /etc/init.d/saveanybot 然后将文件复制到 /etc/rc.d 并重命名为 S99saveanybot, 同样赋予权限: chmod +x /etc/rc.d/S99saveanybot 添加快捷指令 创建文件 /usr/bin/sabot ,参考 wrt_bin 并自行修改,注意此处文件编码仅支持 ANSI 936 . 随后赋予权限: chmod +x /usr/bin/sabot 使用: sudo sabot start|stop|restart|status|enable|disable 使用 Docker 部署 # Docker Compose # 下载 docker-compose.yml 文件, 在同目录下新建 config.toml 文件, 参考 config.example.toml 编辑配置文件.">安装与更新 | Save Any Bot

安装与更新

安装与更新 +简体中文

安装与更新

安装与更新 #

从预编译文件部署(推荐) #

Release 页面下载对应平台的二进制文件.

在解压后目录新建 config.toml 文件, 参考 配置说明 编辑配置文件

运行:

chmod +x saveany-bot
 ./saveany-bot
diff --git a/en/categories/index.html b/en/categories/index.html
index a91b091..7a3a101 100644
--- a/en/categories/index.html
+++ b/en/categories/index.html
@@ -1,4 +1,4 @@
 Categories | Save Any Bot
 

Categories

Categories

\ No newline at end of file +English

Categories

Categories

\ No newline at end of file diff --git a/en/contribute/index.html b/en/contribute/index.html index 7038b48..e990c90 100644 --- a/en/contribute/index.html +++ b/en/contribute/index.html @@ -28,7 +28,7 @@ Here are some guidelines and suggestions for contributing code. You don’t have Open an issue before adding new features, so we can discuss design and implementation details and avoid work that doesn’t fit the project design. Use modern development tools, format your code before committing, and keep the style consistent. Use Conventional Commits, and avoid vague or overly simple commit messages. Contributing New Storage Backend # Add the new storage backend type in pkg/enums/storage/storages.go and run code generation. Define the storage backend configuration in the config/storage directory and add it to config/storage/factory.go. Create a new package in the storage directory, implement the storage backend, and import it in storage/storage.go. Update the documentation to include configuration details for the new storage backend. Contributing New Parsers # You can either implement native parsers in Go (recommended), or write JavaScript-based parser plugins.">Contributing | Save Any Bot

Contributing

Contributing +English

Contributing

Contributing #

Before you start, please fork this repository, clone it locally, and set up your Go development environment.

Here are some guidelines and suggestions for contributing code. You don’t have to strictly follow them, but they help speed up review and merging:

  • Open an issue before adding new features, so we can discuss design and implementation details and avoid work that doesn’t fit the project design.
  • Use modern development tools, format your code before committing, and keep the style consistent.
  • Use Conventional Commits, and avoid vague or overly simple commit messages.

Contributing New Storage Backend #

  1. Add the new storage backend type in pkg/enums/storage/storages.go and run code generation.
  2. Define the storage backend configuration in the config/storage directory and add it to config/storage/factory.go.
  3. Create a new package in the storage directory, implement the storage backend, and import it in storage/storage.go.
  4. Update the documentation to include configuration details for the new storage backend.

Contributing New Parsers #

You can either implement native parsers in Go (recommended), or write JavaScript-based parser plugins.

If you use Go:

  1. Create a new package under the parsers directory and implement the parser logic.
  2. Register the parser in the init function in parsers/parser.go.

If you use JavaScript:

  1. Refer to plugins/example_parser_basic.js as an example.
  2. Create a new .js file in the plugins directory and implement your parsing logic there.

Note: Parsers under the plugins directory are not embedded into the binary by default. Users must download them manually and place them in the configured plugin directories to enable them.

\ No newline at end of file diff --git a/en/deployment/configuration/storages/index.html b/en/deployment/configuration/storages/index.html index 2981bf9..d2905bb 100644 --- a/en/deployment/configuration/storages/index.html +++ b/en/deployment/configuration/storages/index.html @@ -27,7 +27,7 @@ Stream mode is not supported. url = "https://alist.example.com" # URL of Alist username = "your_username" # Username for Alist password = "your_password" # Password for Alist base_path = "/path/saveanybot" # Base path in Alist, all files will be stored under this path token_exp = 3600 # Auto-refresh time for Alist access token, in seconds token = "your_token" # Access token for Alist, optional, if not set, username and password will be used for authentication. # When using token authentication, the token cannot be automatically refreshed Local Disk # type=local'>Storage Configuration | Save Any Bot

Storage Configuration

Storage Configuration +English

Storage Configuration

Storage Configuration #

Please first read the Configuration Guide to understand the basic format of the configuration file.

Alist #

type=alist

Stream mode is not supported.

url = "https://alist.example.com" # URL of Alist
 username = "your_username"  # Username for Alist
diff --git a/en/deployment/index.html b/en/deployment/index.html
index 814121f..2645261 100644
--- a/en/deployment/index.html
+++ b/en/deployment/index.html
@@ -1,6 +1,6 @@
 Deployment Guide | Save Any Bot
 

Deployment Guide

\ No newline at end of file diff --git a/en/deployment/installation/index.html b/en/deployment/installation/index.html index 09372d1..656f432 100644 --- a/en/deployment/installation/index.html +++ b/en/deployment/installation/index.html @@ -114,7 +114,7 @@ Run: chmod +x saveany-bot ./saveany-bot Daemon # systemd (Regular Linux) Create a file /etc/systemd/system/saveany-bot.service and write the following content: [Unit] Description=SaveAnyBot After=systemd-user-sessions.service [Service] Type=simple WorkingDirectory=/yourpath/ ExecStart=/yourpath/saveany-bot Restart=always [Install] WantedBy=multi-user.target Enable startup on boot and start the service: systemctl enable --now saveany-bot procd (OpenWrt) Add Boot Autostart Service Create a file /etc/init.d/saveanybot, refer to wrt_init and modify as needed: #!/bin/sh /etc/rc.common #This is the OpenWRT init.d script for SaveAnyBot START=99 STOP=10 description="SaveAnyBot" WORKING_DIR="/mnt/mmc1-1/SaveAnyBot" EXEC_PATH="$WORKING_DIR/saveany-bot" start() { echo "Starting SaveAnyBot..." cd $WORKING_DIR $EXEC_PATH & } stop() { echo "Stopping SaveAnyBot..." killall saveany-bot } reload() { stop start } Set permissions: chmod +x /etc/init.d/saveanybot Then copy the file to /etc/rc.d and rename it to S99saveanybot, also set permissions: chmod +x /etc/rc.d/S99saveanybot Add Shortcut Commands Create a file /usr/bin/sabot, refer to wrt_bin and modify as needed. Note that the file encoding here only supports ANSI 936. Then set permissions: chmod +x /usr/bin/sabot Usage: sudo sabot start|stop|restart|status|enable|disable Deploy Using Docker # Docker Compose # Download the docker-compose.yml file, create a new config.toml file in the same directory, refer to config.example.toml to edit the configuration file.">Installation and Updates | Save Any Bot

Installation and Updates

Installation and Updates +English

Installation and Updates

Installation and Updates #

Download the binary file for your platform from the Release page.

Create a config.toml file in the extracted directory, refer to the Configuration Guide to edit the configuration file.

Run:

chmod +x saveany-bot
 ./saveany-bot
diff --git a/en/help/index.html b/en/help/index.html
index 6a8f51a..a7cc43f 100644
--- a/en/help/index.html
+++ b/en/help/index.html
@@ -21,7 +21,7 @@ Bot indicates successful download but files don’t show up in AList # AList cac
 Docker deployment still can’t connect to Telegram despite proxy configuration (client initialization timeout) # Docker cannot directly access the host network. If you’re not familiar with its usage, please set the container to host mode.">Frequently Asked Questions | Save Any Bot
 

Frequently Asked Questions

Frequently Asked Questions #

Upload to AList shows success but actually fails #

Adjust the upload chunk size in the AList management page, and deploy AList in a more stable network environment to reduce the occurrence of this issue.

Bot indicates successful download but files don’t show up in AList #

AList caches directory structures. Refer to the documentation to adjust cache expiration time.

Docker deployment still can’t connect to Telegram despite proxy configuration (client initialization timeout) diff --git a/en/index.html b/en/index.html index 4dce5ef..f66c229 100644 --- a/en/index.html +++ b/en/index.html @@ -41,7 +41,7 @@ Telegram (re-upload to specified chat) 🎯 Features # Supports documents/videos/images/stickers… and even Telegraph Breaks restrictions on saving files Batch download Streaming Multi-user Automatic organization based on storage rules Watch specific chats and automatically save messages, with filters Transfer files between different storage backends Integrate with yt-dlp to download and save media from 1000+ websites Aria2 integration to download files from URLs/magnets and save to storages Write JS parser plugins to save files from almost any website Supports multiple storage backends: Alist S3 WebDAV Local disk Telegram (re-upload to specified chat) Contributors #">Introduction | Save Any Bot

Introduction

Save Any Bot +English

Introduction

Save Any Bot #

diff --git a/en/index.xml b/en/index.xml index 9e22b12..b00d778 100644 --- a/en/index.xml +++ b/en/index.xml @@ -130,7 +130,21 @@ This feature requires the yt-dlp command-line tool installed on your system. <ul> <li>Twitter</li> <li>Kemono</li> -</ul>HTTP APIhttps://sabot.unv.app/en/usage/api/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/en/usage/api/<h1 id="http-api"> +</ul>File Naming & Conflict Strategieshttps://sabot.unv.app/en/usage/config/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/en/usage/config/<h1 id="file-naming--conflict-strategies"> + File Naming &amp; Conflict Strategies + <a class="anchor" href="#file-naming--conflict-strategies">#</a> +</h1> +<p>SaveAny-Bot lets you customize how saved files are named and how collisions with existing files are resolved, directly in Telegram via the <code>/config</code> and <code>/fnametmpl</code> commands.</p> +<h2 id="config--user-configuration"> + <code>/config</code> — User Configuration + <a class="anchor" href="#config--user-configuration">#</a> +</h2> +<p>The <code>/config</code> command opens an inline menu where you can change two per-user settings:</p> +<ul> +<li><strong>Filename strategy</strong> — how the saved file is named</li> +<li><strong>Duplicate file strategy</strong> — what happens when a file with the same name already exists in the target storage</li> +</ul> +<p>Settings are stored per user and apply to all of that user&rsquo;s subsequent save/transfer tasks.</p>HTTP APIhttps://sabot.unv.app/en/usage/api/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/en/usage/api/<h1 id="http-api"> HTTP API <a class="anchor" href="#http-api">#</a> </h1> @@ -145,7 +159,12 @@ This feature requires the yt-dlp command-line tool installed on your system. </span></span><span style="display:flex;"><span><span style="color:#a6e22e">host</span> = <span style="color:#e6db74">&#34;0.0.0.0&#34;</span> <span style="color:#75715e"># Bind address, default 0.0.0.0</span> </span></span><span style="display:flex;"><span><span style="color:#a6e22e">port</span> = <span style="color:#ae81ff">8080</span> <span style="color:#75715e"># Listen port, default 8080</span> </span></span><span style="display:flex;"><span><span style="color:#a6e22e">token</span> = <span style="color:#e6db74">&#34;your-token&#34;</span> <span style="color:#75715e"># Auth token — strongly recommended</span> -</span></span></code></pre></div><p>You can also override these settings with environment variables (prefix <code>SAVEANY_</code>):</p>Installation and Updateshttps://sabot.unv.app/en/deployment/installation/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/en/deployment/installation/<h1 id="installation-and-updates"> +</span></span></code></pre></div><p>You can also override these settings with environment variables (prefix <code>SAVEANY_</code>):</p>CLI Subcommandshttps://sabot.unv.app/en/usage/cli/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/en/usage/cli/<h1 id="cli-subcommands"> + CLI Subcommands + <a class="anchor" href="#cli-subcommands">#</a> +</h1> +<p>Besides running the Telegram bot with <code>./saveany-bot</code> (no subcommand), the binary exposes two helper subcommands for moving local files into a storage backend: <code>upload</code> (one-shot) and <code>watch</code> (continuous).</p> +<p>These subcommands load the same <code>config.toml</code> as the bot, initialize the database and caches, then perform their task. They do <strong>not</strong> start the Telegram bot itself, although storages of type <code>telegram</code> will spin up the bot client just for the upload.</p>Installation and Updateshttps://sabot.unv.app/en/deployment/installation/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/en/deployment/installation/<h1 id="installation-and-updates"> Installation and Updates <a class="anchor" href="#installation-and-updates">#</a> </h1> diff --git a/en/sitemap.xml b/en/sitemap.xml index 7aa119e..f1d4e8e 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -1 +1 @@ -https://sabot.unv.app/en/usage/silent/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/rules/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/watch/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/deployment/2025-06-16T16:30:45+08:00https://sabot.unv.app/en/usage/directlinks/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/aria2/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/ytdlp/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/transfer/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/parsers/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/help/2025-06-16T16:30:45+08:00https://sabot.unv.app/en/contribute/2025-12-19T21:03:58+08:00https://sabot.unv.app/en/usage/api/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/categories/https://sabot.unv.app/en/deployment/configuration/2026-01-31T21:17:30+08:00https://sabot.unv.app/en/deployment/installation/2026-01-05T11:56:19+08:00https://sabot.unv.app/en/2026-01-19T21:55:26+08:00https://sabot.unv.app/en/deployment/configuration/storages/2026-01-30T13:34:29+08:00https://sabot.unv.app/en/tags/ \ No newline at end of file +https://sabot.unv.app/en/usage/silent/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/rules/2026-06-28T18:00:02+08:00https://sabot.unv.app/en/usage/watch/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/deployment/2025-06-16T16:30:45+08:00https://sabot.unv.app/en/usage/directlinks/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/aria2/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/ytdlp/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/transfer/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/parsers/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/config/2026-06-28T18:00:02+08:00https://sabot.unv.app/en/help/2025-06-16T16:30:45+08:00https://sabot.unv.app/en/contribute/2025-12-19T21:03:58+08:00https://sabot.unv.app/en/usage/api/2026-03-11T19:37:25+08:00https://sabot.unv.app/en/usage/cli/2026-06-28T18:00:02+08:00https://sabot.unv.app/en/categories/https://sabot.unv.app/en/deployment/configuration/2026-06-28T18:00:02+08:00https://sabot.unv.app/en/deployment/installation/2026-01-05T11:56:19+08:00https://sabot.unv.app/en/2026-01-19T21:55:26+08:00https://sabot.unv.app/en/deployment/configuration/storages/2026-01-30T13:34:29+08:00https://sabot.unv.app/en/tags/ \ No newline at end of file diff --git a/en/tags/index.html b/en/tags/index.html index 2aeb96c..61451eb 100644 --- a/en/tags/index.html +++ b/en/tags/index.html @@ -1,4 +1,4 @@ Tags | Save Any Bot

Tags

Tags

\ No newline at end of file +English

Tags

Tags

\ No newline at end of file diff --git a/en/usage/api/index.html b/en/usage/api/index.html index 01ae8cb..29e7fe2 100644 --- a/en/usage/api/index.html +++ b/en/usage/api/index.html @@ -18,7 +18,7 @@ Enabling the API # Add or modify the following section in config.toml: [api] enable = true host = "0.0.0.0" # Bind address, default 0.0.0.0 port = 8080 # Listen port, default 8080 token = "your-token" # Auth token — strongly recommended You can also override these settings with environment variables (prefix SAVEANY_):'>HTTP API | Save Any Bot

HTTP API

HTTP API #

SaveAny-Bot provides an HTTP API that allows you to programmatically create download/transfer tasks, query task status, cancel tasks, and more — without going through Telegram.

Enabling the API #

Add or modify the following section in config.toml:

[api]
 enable = true
diff --git a/en/usage/aria2/index.html b/en/usage/aria2/index.html
index ca21970..88f6ad4 100644
--- a/en/usage/aria2/index.html
+++ b/en/usage/aria2/index.html
@@ -24,7 +24,7 @@ Configure Aria2:">Aria2 Download | Save Any Bot
 

Aria2 Download

Aria2 Download +English

Aria2 Download

Aria2 Download #

This feature requires enabling Aria2 in the configuration file and configuring the RPC connection.

Use the /aria2dl command to download files via the Aria2 download manager, supporting HTTP/HTTPS, FTP, BitTorrent, and other protocols.

/aria2dl <uri1> [uri2] [uri3] ...
 

Examples:

# Download HTTP link
 /aria2dl https://example.com/file.zip
diff --git a/en/usage/cli/index.html b/en/usage/cli/index.html
new file mode 100644
index 0000000..97293e9
--- /dev/null
+++ b/en/usage/cli/index.html
@@ -0,0 +1,34 @@
+CLI Subcommands | Save Any Bot
+

CLI Subcommands

CLI Subcommands +#

Besides running the Telegram bot with ./saveany-bot (no subcommand), the binary exposes two helper subcommands for moving local files into a storage backend: upload (one-shot) and watch (continuous).

These subcommands load the same config.toml as the bot, initialize the database and caches, then perform their task. They do not start the Telegram bot itself, although storages of type telegram will spin up the bot client just for the upload.

upload — Upload a Single File +#

saveany-bot upload -f <file> -s <storage> [-d <dir>] [--no-progress]
+

Flags:

FlagRequiredDescription
-f, --fileYesPath to the local file to upload
-s, --storageYesTarget storage name (must exist in config.toml)
-d, --dirNoDestination directory within the storage. Defaults to the storage’s base_path
--no-progressNoDisable the terminal progress bar

Examples:

# Upload a file to the default dir of storage "MyAlist"
+./saveany-bot upload -f ./movie.mp4 -s MyAlist
+
+# Upload into a specific subdirectory
+./saveany-bot upload -f ./movie.mp4 -s MyAlist -d movies/2026
+
+# Upload via Telegram storage without a progress bar
+./saveany-bot upload -f ./photo.jpg -s MyChannel --no-progress
+

watch — Watch a Directory and Auto-Upload +#

The watch subcommand continuously monitors a local directory and uploads created or modified files to a storage backend, preserving the relative directory structure from the watch root.

saveany-bot watch -p <path> -s <storage> [-d <dir>] [options]
+

Flags:

FlagDefaultDescription
-p, --path(required)Local directory to watch
-s, --storage(required)Target storage name
-d, --dirstorage’s base_pathDestination directory within the storage
-r, --recursivefalseWatch subdirectories recursively
--overwritefalseOverwrite existing files on the storage instead of skipping them
--initial-scanfalseUpload files already present in the directory on startup
--debounce2sHow long to wait after the last write before uploading a file
--upload-workersconfig.workersNumber of concurrent uploads
--retry-delay3sDelay between upload retries
Write-completion detection: the watcher debounces per file and only uploads once the file size stays unchanged across the debounce window, so partial/write-in-progress files are not uploaded.
If a file changes while being uploaded, it is re-uploaded once after the current upload finishes (instead of being queued multiple times).

Examples:

# Watch ./inbox and upload new files to "MyAlist" recursively
+./saveany-bot watch -p ./inbox -s MyAlist -r
+
+# Watch with a custom destination dir and overwrite
+./saveany-bot watch -p ./inbox -s MyAlist -d backup --overwrite
+
+# On startup, also upload everything already in ./inbox
+./saveany-bot watch -p ./inbox -s MyAlist --initial-scan
+

Behavior notes +#

  • Relative directory structure is preserved under the destination directory. A file written to ./inbox/sub/file.txt with --path ./inbox is uploaded to <dest_dir>/sub/file.txt.
  • watch runs until interrupted (e.g. Ctrl-C / SIGINT); in-flight uploads are drained before exit.
  • Retries follow the global retry value from config.toml, with --retry-delay between attempts.
  • Telegram-type storages will start the bot client automatically to perform uploads.
`watch` is unrelated to the in-bot `/watch` command (which watches Telegram chats). This subcommand watches a **local filesystem directory** and uploads to a storage backend, independent of Telegram.
\ No newline at end of file diff --git a/en/usage/config/index.html b/en/usage/config/index.html new file mode 100644 index 0000000..cbb4ab1 --- /dev/null +++ b/en/usage/config/index.html @@ -0,0 +1,33 @@ +File Naming & Conflict Strategies | Save Any Bot +

File Naming & Conflict Strategies

File Naming & Conflict Strategies +#

SaveAny-Bot lets you customize how saved files are named and how collisions with existing files are resolved, directly in Telegram via the /config and /fnametmpl commands.

/config — User Configuration +#

The /config command opens an inline menu where you can change two per-user settings:

  • Filename strategy — how the saved file is named
  • Duplicate file strategy — what happens when a file with the same name already exists in the target storage

Settings are stored per user and apply to all of that user’s subsequent save/transfer tasks.

Filename strategy +#

OptionBehavior
DefaultUse the original media filename, or a generated name when no original filename is available
Gen From Msg FirstGenerate the filename from the message content (e.g. caption, text) and prefer that over the original filename
TemplateRender the filename from a custom template you define with /fnametmpl

Duplicate file strategy +#

OptionBehavior
Always rename (default)Keep the existing file and save the new one with an alternate name
Ask every timePrompt you with inline buttons each time a collision occurs
Always overwriteReplace the existing file with the new one
Always skipDo nothing for conflicting files
The conflict strategy only kicks in for storage backends that can detect the existence of a file. Backends that do not support existence checks will fall back to overwriting.

/fnametmpl — Custom Filename Template +#

When the filename strategy is set to Template, SaveAny-Bot renders each saved file’s name using the template configured via /fnametmpl.

/fnametmpl [template]
+
  • Running /fnametmpl without arguments shows your current template and the help text.
  • Running it with a template string sets that template as your filename template.

The template uses Go text/template syntax. The available variables are:

VariableDescription
{{.msgid}}Telegram message ID
{{.msgtags}}Hashtags found in the message, joined with _
{{.msggen}}Filename generated from the message
{{.msgdate}}Message date, formatted YYYY-MM-DD_HH-MM-SS
{{.msgraw}}Raw, unprocessed message text
{{.origname}}The media’s original filename (if any)
{{.chatid}}Chat ID of the message

Examples:

# Fixed prefix + message id + date
+/fnametmpl Image_{{.msgid}}_{{.msgdate}}.jpg
+
+# Use original name if available, otherwise a generated name
+/fnametmpl {{.origname}}
+
The template only takes effect when the filename strategy is set to `Template`. If template parsing fails, SaveAny-Bot falls back to the default filename naming logic.
\ No newline at end of file diff --git a/en/usage/directlinks/index.html b/en/usage/directlinks/index.html index a9e49a0..1d4e8f3 100644 --- a/en/usage/directlinks/index.html +++ b/en/usage/directlinks/index.html @@ -12,7 +12,7 @@ The bot will validate the link format and then ask you to select the target stor /dl https://example.com/file.zip /dl https://example.com/file1.zip https://example.com/file2.zip The bot will validate the link format and then ask you to select the target storage location.">Direct Download Links | Save Any Bot

Direct Download Links

Direct Download Links +English

Direct Download Links

Direct Download Links #

Use the /dl command to directly download one or more HTTP/HTTPS files to storage.

/dl <url1> [url2] [url3] ...
 

Examples:

/dl https://example.com/file.zip
 /dl https://example.com/file1.zip https://example.com/file2.zip
diff --git a/en/usage/index.html b/en/usage/index.html
index a736972..6a03297 100644
--- a/en/usage/index.html
+++ b/en/usage/index.html
@@ -17,7 +17,7 @@ File Transfer # To use the bot’s Telegram file saving feature, you need to sen
 File or media messages, such as images, videos, documents, etc. Telegram message links, for example: https://t.me/acherkrau/1097. Even if the channel prohibits forwarding and saving, the bot can still download its files. Telegra.ph article links. The bot will download all images in the article.">Usage | Save Any Bot
 

Usage

Usage +English

Usage

Usage #

This page introduces some of Save Any Bot’s features and basic usage. If you can’t find what you need here, please also see the Configuration Guide or ask in GitHub Discussions.

File Transfer #

To use the bot’s Telegram file saving feature, you need to send or forward the following types of messages to the bot:

  1. File or media messages, such as images, videos, documents, etc.
  2. Telegram message links, for example: https://t.me/acherkrau/1097. Even if the channel prohibits forwarding and saving, the bot can still download its files.
  3. Telegra.ph article links. The bot will download all images in the article.

In addition, if CHOSEN is used as the storage name in the rule, it means files will be stored under the path of the storage you selected by clicking the inline button.

You can also toggle whether rules are applied with /rule switch. When rule mode is off, all files go to the default storage.

Preset Rules +#

Manually writing regex rules for common file types is tedious, so the bot ships a built-in set of preset categories (video, image, audio, document, archive) that you can import in one command:

/rule preset <storage> [base_path]
+

Parameters:

  • storage: Target storage name (must exist and be accessible to you)
  • base_path: Optional. Each preset category’s subdirectory is created under this path. If omitted, the default category directory names are used directly.

Examples:

# Import preset rules into "MyAlist" with the default directory layout
+/rule preset MyAlist
+
+# Import preset rules with a custom base path "downloads/sorted"
+/rule preset MyAlist downloads/sorted
+

This will create FILENAME-REGEX rules for each category, routing matched files to the corresponding subdirectory under base_path:

CategoryMatched extensionsDefault directory
videomp4, mkv, ts, avi, flv, mov, webm, wmv, rmvb, m2ts视频
imagejpg, jpeg, png, gif, webp, bmp图片
audiomp3, flac, wav, aac, m4a, ogg音频
documentpdf, doc, docx, xls, xlsx, ppt, pptx, txt, md, csv, epub, mobi, azw3, chm文档
archivezip, rar, 7z, tar, gz, bz2, xz, …压缩包
Preset rules are regular `FILENAME-REGEX` rules once imported. You can view, edit, or delete them individually with `/rule` and `/rule del ` like any other rule.

Rule types:

FILENAME-REGEX #

Matches based on filename regex. The rule content must be a valid regular expression, such as:

FILENAME-REGEX (?i)\.(mp4|mkv|ts|avi|flv)$ MyAlist /videos
 

This means files with extensions mp4, mkv, ts, avi, flv will be saved to the /videos directory in the storage named MyAlist (also affected by the base_path in the configuration file).

MESSAGE-REGEX #

Similar to the above, but matches based on the text content of the message itself.

IS-ALBUM #

Matches album messages (media groups). Rule content can only be true or false.

If the path in the rule uses NEW-FOR-ALBUM, the bot will create a new folder for each media group and store all files of that group there. See: https://github.com/krau/SaveAny-Bot/issues/87

For example:

IS-ALBUM true MyWebdav NEW-FOR-ALBUM
-

This will save media-group messages to the storage named MyWebdav, creating a new folder (generated from the first file) for each album.

\ No newline at end of file +

This will save media-group messages to the storage named MyWebdav, creating a new folder (generated from the first file) for each album.

\ No newline at end of file diff --git a/en/usage/silent/index.html b/en/usage/silent/index.html index a1198e3..4a8a445 100644 --- a/en/usage/silent/index.html +++ b/en/usage/silent/index.html @@ -11,7 +11,7 @@ When silent mode is enabled, the bot will save files directly to the default loc Before enabling silent mode, you need to set the default save location using the /storage command.">Silent Mode | Save Any Bot

Silent Mode

Silent Mode (silent) +English

Silent Mode

Silent Mode (silent) #

Use the /silent command to toggle silent mode.

By default, silent mode is off, and the bot will ask you for the save location of each file.

When silent mode is enabled, the bot will save files directly to the default location without confirmation.

Before enabling silent mode, you need to set the default save location using the /storage command.

\ No newline at end of file diff --git a/en/usage/transfer/index.html b/en/usage/transfer/index.html index 81d2c07..789ea3c 100644 --- a/en/usage/transfer/index.html +++ b/en/usage/transfer/index.html @@ -28,7 +28,7 @@ source_storage: Source storage name source_path: Source path filter: Optional re # Transfer entire directory /transfer local1:/downloads # Transfer files from specified path /transfer alist1:/media/photos # Transfer only mp4 files /transfer webdav1:/videos ".*\.mp4$" # Transfer image files /transfer local1:/pictures "(?i)\.(jpg|png|gif)$" The bot will:'>Storage Transfer | Save Any Bot

Storage Transfer

Storage Transfer +English

Storage Transfer

Storage Transfer #

Use the /transfer command to transfer files directly between different storages without going through Telegram.

/transfer <source_storage>:/<source_path> [filter]
 

Parameters:

  • source_storage: Source storage name
  • source_path: Source path
  • filter: Optional regex filter to transfer only matching files

Examples:

# Transfer entire directory
 /transfer local1:/downloads
diff --git a/en/usage/watch/index.html b/en/usage/watch/index.html
index f1710f2..a5fb33b 100644
--- a/en/usage/watch/index.html
+++ b/en/usage/watch/index.html
@@ -28,7 +28,7 @@ msgre # Regex-match the message text. For example:
 /watch 12345678 msgre:.*hello.* This will watch the chat with ID 12345678, and only save messages whose text contains hello.">Watch Chats | Save Any Bot
 

Watch Chats

Watch Chats +English

Watch Chats

Watch Chats #

This feature requires enabling UserBot integration.

You can watch messages in a specific chat and automatically save them to the default storage, following storage rules. You can also add filters so that only matching messages are saved.

Watch a chat:

/watch <chat_id/username> [filter]
 

Stop watching:

/unwatch <chat_id/username>
 

Filter types:

msgre diff --git a/en/usage/ytdlp/index.html b/en/usage/ytdlp/index.html index 0d2407a..cdc8f5d 100644 --- a/en/usage/ytdlp/index.html +++ b/en/usage/ytdlp/index.html @@ -25,7 +25,7 @@ Common parameters:">yt-dlp Video Download | Save Any Bot

yt-dlp Video Download

yt-dlp Video Download +English

yt-dlp Video Download

yt-dlp Video Download #

This feature requires the yt-dlp command-line tool installed on your system.

Use the /ytdlp command to download videos and audio from supported video websites, including YouTube, Bilibili, Twitter, and 1000+ other sites.

/ytdlp <url1> [url2] [flags...]
 

Examples:

# Basic download
 /ytdlp https://www.youtube.com/watch?v=dQw4w9WgXcQ
diff --git a/help/index.html b/help/index.html
index 67c8564..e81f5c4 100644
--- a/help/index.html
+++ b/help/index.html
@@ -21,7 +21,7 @@ Bot 提示下载成功但是 alist 未显示 # alist 缓存了目录结构, 参
 docker部署配置了代理后仍无法连接 telegram (初始化客户端超时) # docker 不能直接访问宿主机网络, 如果你不熟悉其用法, 请将容器设为 host 模式.">常见问题 | Save Any Bot
 

常见问题

常见问题 #

上传 alist 失败也会显示成功 #

在 alist 管理页面适当调整上传分片大小, 为 alist 使用更稳定的网络环境部署, 都可以减少这种情况的发生.

Bot 提示下载成功但是 alist 未显示 #

alist 缓存了目录结构, 参考 文档 可以调整缓存时间

docker部署配置了代理后仍无法连接 telegram (初始化客户端超时) diff --git a/index.html b/index.html index 5f3f1b3..2c6cec3 100644 --- a/index.html +++ b/index.html @@ -42,7 +42,7 @@ Telegram (重传回指定聊天) 🎯 特性 # 支持文档/视频/图片/贴纸…甚至还有 Telegraph 破解禁止保存的文件 批量下载 流式传输 多用户使用 基于存储规则的自动整理 监听并自动转存指定聊天的消息, 支持过滤 在不同存储端之间转存文件 集成 yt-dlp, 从所支持的网站下载并转存媒体文件 集成 Aria2, 支持直链/磁力下载和转存 使用 js 编写解析器插件以转存任意网站的文件 存储端支持: Alist S3 WebDAV 本地磁盘 Rclone (通过命令行调用) Telegram (重传回指定聊天) 贡献者 #">介绍 | Save Any Bot

介绍

Save Any Bot +简体中文

介绍

Save Any Bot #

diff --git a/index.xml b/index.xml index c20d187..6ccf8e0 100644 --- a/index.xml +++ b/index.xml @@ -22,25 +22,25 @@ <p>注意空格的使用, 语法正确 bot 才能解析, 以下是一条合法的添加规则命令:</p> <pre tabindex="0"><code>/rule add FILENAME-REGEX (?i)\.(mp4|mkv|ts|avi|flv)$ MyAlist /视频 </code></pre><p>此外, 规则中的存储名若使用 &ldquo;CHOSEN&rdquo; , 则表示存储到点击按钮选择的存储端的路径下</p> -<p>规则类型:</p> -<h2 id="filename-regex"> - FILENAME-REGEX - <a class="anchor" href="#filename-regex">#</a> +<p>你也可以使用 <code>/rule switch</code> 来开关规则模式. 关闭规则模式时, 所有文件都将保存到默认存储.</p> +<h2 id="预设规则"> + 预设规则 + <a class="anchor" href="#%e9%a2%84%e8%ae%be%e8%a7%84%e5%88%99">#</a> </h2> -<p>根据文件名正则匹配, 规则内容要求为一个合法的正则表达式, 如</p> -<pre tabindex="0"><code>FILENAME-REGEX (?i)\.(mp4|mkv|ts|avi|flv)$ MyAlist /视频 -</code></pre><p>表示将文件名后缀为 mp4,mkv,ts,avi,flv 的文件放到名为 MyAlist 存储下的 /视频 目录内 (同时受配置文件中的 <code>base_path</code> 影响)</p> -<h2 id="message-regex"> - MESSAGE-REGEX - <a class="anchor" href="#message-regex">#</a> -</h2> -<p>同上, 但是是根据消息本身的文本内容正则匹配</p> -<h2 id="is-album"> - IS-ALBUM - <a class="anchor" href="#is-album">#</a> -</h2> -<p>匹配相册消息 (media group), 规则内容只能为 <code>true</code> 或 <code>false</code>.</p> -<p>规则中的路径若使用 &ldquo;NEW-FOR-ALBUM&rdquo; , 则表示为该组消息新建一个文件夹来存储它们. 见: <a href="https://github.com/krau/SaveAny-Bot/issues/87">https://github.com/krau/SaveAny-Bot/issues/87</a></p>监听聊天https://sabot.unv.app/usage/watch/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/usage/watch/<h1 id="监听聊天"> +<p>为常见文件类型手动编写正则规则比较繁琐, 因此 Bot 内置了一组预设分类 (视频、图片、音频、文档、压缩包), 可以通过一条命令批量导入:</p> +<pre tabindex="0"><code>/rule preset &lt;存储名&gt; [基础路径] +</code></pre><p>参数:</p> +<ul> +<li><code>存储名</code>: 目标存储名 (必须存在且你有权访问)</li> +<li><code>基础路径</code>: 可选. 各预设分类的子目录会创建在此路径下; 若不填则直接使用默认分类目录名</li> +</ul> +<p>示例:</p> +<pre tabindex="0"><code># 导入预设规则到 &#34;MyAlist&#34;, 使用默认目录布局 +/rule preset MyAlist + +# 在自定义基础路径 &#34;downloads/sorted&#34; 下导入预设规则 +/rule preset MyAlist downloads/sorted +</code></pre><p>此命令会为每个分类创建 <code>FILENAME-REGEX</code> 规则, 将匹配的文件路由到 <code>基础路径</code> 下对应的子目录:</p>监听聊天https://sabot.unv.app/usage/watch/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/usage/watch/<h1 id="监听聊天"> 监听聊天 <a class="anchor" href="#%e7%9b%91%e5%90%ac%e8%81%8a%e5%a4%a9">#</a> </h1> @@ -179,7 +179,88 @@ <ul> <li>Twitter</li> <li>Kemono</li> -</ul>HTTP APIhttps://sabot.unv.app/usage/api/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/usage/api/<h1 id="http-api"> +</ul>文件命名与重名策略https://sabot.unv.app/usage/config/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/usage/config/<h1 id="文件命名与重名策略"> + 文件命名与重名策略 + <a class="anchor" href="#%e6%96%87%e4%bb%b6%e5%91%bd%e5%90%8d%e4%b8%8e%e9%87%8d%e5%90%8d%e7%ad%96%e7%95%a5">#</a> +</h1> +<p>SaveAny-Bot 支持在 Telegram 中通过 <code>/config</code> 和 <code>/fnametmpl</code> 命令自定义保存文件的命名方式, 以及处理与已存在文件重名时的冲突策略.</p> +<h2 id="config--用户配置"> + <code>/config</code> — 用户配置 + <a class="anchor" href="#config--%e7%94%a8%e6%88%b7%e9%85%8d%e7%bd%ae">#</a> +</h2> +<p><code>/config</code> 命令会弹出一个内联菜单, 你可以在其中修改以下两项用户级设置:</p> +<ul> +<li><strong>文件名策略</strong> — 保存文件的命名方式</li> +<li><strong>重名文件保存策略</strong> — 目标存储中已存在同名文件时的处理方式</li> +</ul> +<p>设置按用户分别保存, 对该用户后续所有的保存/转存任务生效.</p> +<h3 id="文件名策略"> + 文件名策略 + <a class="anchor" href="#%e6%96%87%e4%bb%b6%e5%90%8d%e7%ad%96%e7%95%a5">#</a> +</h3> +<table> + <thead> + <tr> + <th>选项</th> + <th>行为</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>默认</code></td> + <td>使用媒体原始文件名, 没有原始文件名时使用生成名</td> + </tr> + <tr> + <td><code>优先从消息生成</code></td> + <td>优先根据消息内容 (如 caption、文本) 生成文件名, 而非原始文件名</td> + </tr> + <tr> + <td><code>自定义模板</code></td> + <td>使用 <code>/fnametmpl</code> 设置的自定义模板渲染文件名</td> + </tr> + </tbody> +</table> +<h3 id="重名文件保存策略"> + 重名文件保存策略 + <a class="anchor" href="#%e9%87%8d%e5%90%8d%e6%96%87%e4%bb%b6%e4%bf%9d%e5%ad%98%e7%ad%96%e7%95%a5">#</a> +</h3> +<table> + <thead> + <tr> + <th>选项</th> + <th>行为</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>始终重命名</code> (默认)</td> + <td>保留已有文件, 将新文件以另一个名字保存</td> + </tr> + <tr> + <td><code>每次询问</code></td> + <td>每次遇到重名时通过内联按钮提示你选择</td> + </tr> + <tr> + <td><code>始终覆盖</code></td> + <td>用新文件替换已有文件</td> + </tr> + <tr> + <td><code>始终跳过</code></td> + <td>对重名文件不做处理</td> + </tr> + </tbody> +</table> +<blockquote class="book-hint info"> + +重名策略仅在能够检测文件是否已存在的存储后端生效. 不支持检测文件是否存在的存储后端会退化为覆盖行为. + +</blockquote> + +<h2 id="fnametmpl--自定义文件名模板"> + <code>/fnametmpl</code> — 自定义文件名模板 + <a class="anchor" href="#fnametmpl--%e8%87%aa%e5%ae%9a%e4%b9%89%e6%96%87%e4%bb%b6%e5%90%8d%e6%a8%a1%e6%9d%bf">#</a> +</h2> +<p>当文件名策略设置为 <code>自定义模板</code> 时, SaveAny-Bot 会用 <code>/fnametmpl</code> 配置的模板来渲染所保存文件的文件名.</p>HTTP APIhttps://sabot.unv.app/usage/api/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/usage/api/<h1 id="http-api"> HTTP API <a class="anchor" href="#http-api">#</a> </h1> @@ -239,7 +320,63 @@ 错误响应格式 <a class="anchor" href="#%e9%94%99%e8%af%af%e5%93%8d%e5%ba%94%e6%a0%bc%e5%bc%8f">#</a> </h2> -<p>所有错误均使用统一的 JSON 格式:</p>安装与更新https://sabot.unv.app/deployment/installation/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/deployment/installation/<h1 id="安装与更新"> +<p>所有错误均使用统一的 JSON 格式:</p>命令行子命令https://sabot.unv.app/usage/cli/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/usage/cli/<h1 id="命令行子命令"> + 命令行子命令 + <a class="anchor" href="#%e5%91%bd%e4%bb%a4%e8%a1%8c%e5%ad%90%e5%91%bd%e4%bb%a4">#</a> +</h1> +<p>除了直接运行 <code>./saveany-bot</code> (不带子命令) 启动 Telegram Bot 外, 这个二进制文件还提供两个把本地文件上传到存储后端的辅助子命令: <code>upload</code> (一次性) 和 <code>watch</code> (持续监听).</p> +<p>这些子命令会读取与 Bot 相同的 <code>config.toml</code>, 初始化数据库和缓存, 然后执行任务. 它们<strong>不会</strong>启动 Telegram Bot 本身, 但 <code>telegram</code> 类型的存储会在需要上传时临时启动 Bot 客户端来执行上传.</p> +<h2 id="upload--上传单个文件"> + <code>upload</code> — 上传单个文件 + <a class="anchor" href="#upload--%e4%b8%8a%e4%bc%a0%e5%8d%95%e4%b8%aa%e6%96%87%e4%bb%b6">#</a> +</h2> +<pre tabindex="0"><code>saveany-bot upload -f &lt;文件&gt; -s &lt;存储名&gt; [-d &lt;目录&gt;] [--no-progress] +</code></pre><p>参数:</p> +<table> + <thead> + <tr> + <th>参数</th> + <th>必填</th> + <th>说明</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>-f, --file</code></td> + <td>是</td> + <td>待上传的本地文件路径</td> + </tr> + <tr> + <td><code>-s, --storage</code></td> + <td>是</td> + <td>目标存储名 (必须存在于 <code>config.toml</code>)</td> + </tr> + <tr> + <td><code>-d, --dir</code></td> + <td>否</td> + <td>存储中的目标目录, 默认使用存储的 <code>base_path</code></td> + </tr> + <tr> + <td><code>--no-progress</code></td> + <td>否</td> + <td>关闭终端进度条</td> + </tr> + </tbody> +</table> +<p>示例:</p> +<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 上传文件到 &#34;MyAlist&#34; 的默认目录</span> +</span></span><span style="display:flex;"><span>./saveany-bot upload -f ./movie.mp4 -s MyAlist +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#75715e"># 上传到指定子目录</span> +</span></span><span style="display:flex;"><span>./saveany-bot upload -f ./movie.mp4 -s MyAlist -d movies/2026 +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#75715e"># 通过 Telegram 存储上传并关闭进度条</span> +</span></span><span style="display:flex;"><span>./saveany-bot upload -f ./photo.jpg -s MyChannel --no-progress +</span></span></code></pre></div><h2 id="watch--监听目录并自动上传"> + <code>watch</code> — 监听目录并自动上传 + <a class="anchor" href="#watch--%e7%9b%91%e5%90%ac%e7%9b%ae%e5%bd%95%e5%b9%b6%e8%87%aa%e5%8a%a8%e4%b8%8a%e4%bc%a0">#</a> +</h2> +<p><code>watch</code> 子命令持续监听一个本地目录, 将新建或修改的文件上传到存储后端, 并保留相对监听根目录的子目录结构.</p>安装与更新https://sabot.unv.app/deployment/installation/Mon, 01 Jan 0001 00:00:00 +0000https://sabot.unv.app/deployment/installation/<h1 id="安装与更新"> 安装与更新 <a class="anchor" href="#%e5%ae%89%e8%a3%85%e4%b8%8e%e6%9b%b4%e6%96%b0">#</a> </h1> diff --git a/sitemap.xml b/sitemap.xml index 9e993be..629e503 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://sabot.unv.app/zh/sitemap.xml2026-03-11T19:37:25+08:00https://sabot.unv.app/en/sitemap.xml2026-03-11T19:37:25+08:00 \ No newline at end of file +https://sabot.unv.app/zh/sitemap.xml2026-06-28T18:00:02+08:00https://sabot.unv.app/en/sitemap.xml2026-06-28T18:00:02+08:00 \ No newline at end of file diff --git a/tags/index.html b/tags/index.html index bfdf1f7..c35e1df 100644 --- a/tags/index.html +++ b/tags/index.html @@ -1,4 +1,4 @@ Tags | Save Any Bot

Tags

Tags

\ No newline at end of file +简体中文

Tags

Tags

\ No newline at end of file diff --git a/usage/api/index.html b/usage/api/index.html index 6dd048a..a840be2 100644 --- a/usage/api/index.html +++ b/usage/api/index.html @@ -66,7 +66,7 @@ Authorization: Bearer 鉴权失败时返回 401: { "error": "unauthorized", "message": "invalid token" } 错误响应格式 # 所有错误均使用统一的 JSON 格式:'>HTTP API | Save Any Bot

HTTP API

HTTP API #

SaveAny-Bot 提供了一套 HTTP API,允许你通过程序化方式创建下载/转存任务、查询任务状态、取消任务等,无需通过 Telegram 操作。

启用 API #

config.toml 中添加或修改以下配置:

[api]
 enable = true
diff --git a/usage/aria2/index.html b/usage/aria2/index.html
index aaebab3..1348a42 100644
--- a/usage/aria2/index.html
+++ b/usage/aria2/index.html
@@ -33,7 +33,7 @@ remove_after_transfer = true  # 转存完成后删除本地文件
 [aria2] enable = true url = "http://localhost:6800/jsonrpc" secret = "your-rpc-secret" # 如果配置了 rpc-secret remove_after_transfer = true # 转存完成后删除本地文件'>Aria2 下载 | Save Any Bot
 

Aria2 下载

Aria2 下载 +简体中文

Aria2 下载

Aria2 下载 #

该功能需要在配置文件中启用 Aria2 并配置 RPC 连接.

使用 /aria2dl 命令可以通过 Aria2 下载管理器下载文件, 支持 HTTP/HTTPS、FTP、BitTorrent 等多种协议.

/aria2dl <uri1> [uri2] [uri3] ...
 

示例:

# 下载 HTTP 链接
 /aria2dl https://example.com/file.zip
diff --git a/usage/cli/index.html b/usage/cli/index.html
new file mode 100644
index 0000000..cf20a4c
--- /dev/null
+++ b/usage/cli/index.html
@@ -0,0 +1,88 @@
+命令行子命令 | Save Any Bot
+

命令行子命令

命令行子命令 +#

除了直接运行 ./saveany-bot (不带子命令) 启动 Telegram Bot 外, 这个二进制文件还提供两个把本地文件上传到存储后端的辅助子命令: upload (一次性) 和 watch (持续监听).

这些子命令会读取与 Bot 相同的 config.toml, 初始化数据库和缓存, 然后执行任务. 它们不会启动 Telegram Bot 本身, 但 telegram 类型的存储会在需要上传时临时启动 Bot 客户端来执行上传.

upload — 上传单个文件 +#

saveany-bot upload -f <文件> -s <存储名> [-d <目录>] [--no-progress]
+

参数:

参数必填说明
-f, --file待上传的本地文件路径
-s, --storage目标存储名 (必须存在于 config.toml)
-d, --dir存储中的目标目录, 默认使用存储的 base_path
--no-progress关闭终端进度条

示例:

# 上传文件到 "MyAlist" 的默认目录
+./saveany-bot upload -f ./movie.mp4 -s MyAlist
+
+# 上传到指定子目录
+./saveany-bot upload -f ./movie.mp4 -s MyAlist -d movies/2026
+
+# 通过 Telegram 存储上传并关闭进度条
+./saveany-bot upload -f ./photo.jpg -s MyChannel --no-progress
+

watch — 监听目录并自动上传 +#

watch 子命令持续监听一个本地目录, 将新建或修改的文件上传到存储后端, 并保留相对监听根目录的子目录结构.

saveany-bot watch -p <路径> -s <存储名> [-d <目录>] [选项]
+

参数:

参数默认值说明
-p, --path(必填)要监听的本地目录
-s, --storage(必填)目标存储名
-d, --dir存储的 base_path存储中的目标目录
-r, --recursivefalse是否递归监听子目录
--overwritefalse覆盖存储上已有的文件, 而非跳过
--initial-scanfalse启动时将目录中已存在的文件也上传
--debounce2s文件最后一次写入后, 等待多久再上传
--upload-workersconfig.workers并发上传数
--retry-delay3s上传重试之间的延迟
写入完成检测: 监听器会按文件做防抖处理, 仅当文件大小在一个 debounce 窗口内保持不变时才上传, 因此不会上传未写完的半成品文件.
若某文件在上传过程中又被修改, 它会在当前上传完成后再上传一次, 而不是被重复排队.

示例:

# 递归监听 ./inbox 并且把新文件上传到 "MyAlist"
+./saveany-bot watch -p ./inbox -s MyAlist -r
+
+# 自定义目标目录并覆盖已有文件
+./saveany-bot watch -p ./inbox -s MyAlist -d backup --overwrite
+
+# 启动时把 ./inbox 中已有的内容也一并上传
+./saveany-bot watch -p ./inbox -s MyAlist --initial-scan
+

行为说明 +#

  • 相对子目录结构会被保留: 以 --path ./inbox 为例, 写入 ./inbox/sub/file.txt 的文件会被上传到 <目标目录>/sub/file.txt.
  • watch 会一直运行直到被中断 (如 Ctrl-C / SIGINT), 退出前会等待所有进行中的上传完成.
  • 重试次数遵循 config.toml 中的全局 retry 值, 各次重试之间间隔 --retry-delay.
  • telegram 类型的存储会自动启动 Bot 客户端来执行上传.
`watch` 子命令与 Bot 内的 `/watch` 命令 (监听 Telegram 聊天) 无关. 本子命令监听的是**本地文件系统目录**, 不依赖 Telegram.
\ No newline at end of file diff --git a/usage/config/index.html b/usage/config/index.html new file mode 100644 index 0000000..b5a2ba7 --- /dev/null +++ b/usage/config/index.html @@ -0,0 +1,101 @@ +文件命名与重名策略 | Save Any Bot +

文件命名与重名策略

文件命名与重名策略 +#

SaveAny-Bot 支持在 Telegram 中通过 /config/fnametmpl 命令自定义保存文件的命名方式, 以及处理与已存在文件重名时的冲突策略.

/config — 用户配置 +#

/config 命令会弹出一个内联菜单, 你可以在其中修改以下两项用户级设置:

  • 文件名策略 — 保存文件的命名方式
  • 重名文件保存策略 — 目标存储中已存在同名文件时的处理方式

设置按用户分别保存, 对该用户后续所有的保存/转存任务生效.

文件名策略 +#

选项行为
默认使用媒体原始文件名, 没有原始文件名时使用生成名
优先从消息生成优先根据消息内容 (如 caption、文本) 生成文件名, 而非原始文件名
自定义模板使用 /fnametmpl 设置的自定义模板渲染文件名

重名文件保存策略 +#

选项行为
始终重命名 (默认)保留已有文件, 将新文件以另一个名字保存
每次询问每次遇到重名时通过内联按钮提示你选择
始终覆盖用新文件替换已有文件
始终跳过对重名文件不做处理
重名策略仅在能够检测文件是否已存在的存储后端生效. 不支持检测文件是否存在的存储后端会退化为覆盖行为.

/fnametmpl — 自定义文件名模板 +#

当文件名策略设置为 自定义模板 时, SaveAny-Bot 会用 /fnametmpl 配置的模板来渲染所保存文件的文件名.

/fnametmpl [模板]
+
  • 不带参数运行 /fnametmpl 会显示当前模板以及帮助说明
  • 带模板字符串运行则会把它设为你的文件名模板

模板使用 Go text/template 语法. 可用变量如下:

变量说明
{{.msgid}}Telegram 消息 ID
{{.msgtags}}消息中的标签, 以 _ 连接输出
{{.msggen}}根据消息生成的文件名
{{.msgdate}}消息日期, 格式 YYYY-MM-DD_HH-MM-SS
{{.msgraw}}消息的原始文本内容 (不做处理)
{{.origname}}媒体的原始文件名 (如有)
{{.chatid}}消息所在聊天的 ID

示例:

# 固定前缀 + 消息 ID + 日期
+/fnametmpl 图片_{{.msgid}}_{{.msgdate}}.jpg
+
+# 优先使用原始文件名, 没有则用生成名
+/fnametmpl {{.origname}}
+
模板仅在文件名策略设置为 `自定义模板` 时生效. 如果模板解析失败, SaveAny-Bot 会回退到默认的文件名生成逻辑.
\ No newline at end of file diff --git a/usage/directlinks/index.html b/usage/directlinks/index.html index fdbc71d..2d765ae 100644 --- a/usage/directlinks/index.html +++ b/usage/directlinks/index.html @@ -12,7 +12,7 @@ Bot 会验证链接格式, 然后让你选择目标存储位置.">直接下载链接 | Save Any Bot

直接下载链接

直接下载链接 +简体中文

直接下载链接

直接下载链接 #

使用 /dl 命令可以直接下载一个或多个 HTTP/HTTPS 链接的文件到存储中.

/dl <url1> [url2] [url3] ...
 

示例:

/dl https://example.com/file.zip
 /dl https://example.com/file1.zip https://example.com/file2.zip
diff --git a/usage/index.html b/usage/index.html
index 0ab0008..4ab4f5c 100644
--- a/usage/index.html
+++ b/usage/index.html
@@ -17,7 +17,7 @@ Telegra.ph 的文章链接, Bot 将下载其中的所有图片
 文件或媒体消息, 如图片, 视频, 文档等 Telegram 消息链接, 例如: https://t.me/acherkrau/1097. 即使频道禁止了转发和保存, Bot 依然可以下载其文件. Telegra.ph 的文章链接, Bot 将下载其中的所有图片">使用帮助 | Save Any Bot
 

使用帮助

使用帮助 +简体中文

使用帮助

使用帮助 #

这里介绍 Save Any Bot 的一些功能和使用方法, 如果你没有在这里找到你需要的内容, 另请参阅 配置说明 或前往 Github Discussions 提问.

转存文件 #

要使用 Bot 的转存 Telegram 文件功能, 需要向 Bot 发送或转发以下类型的消息.

  1. 文件或媒体消息, 如图片, 视频, 文档等
  2. Telegram 消息链接, 例如: https://t.me/acherkrau/1097. 即使频道禁止了转发和保存, Bot 依然可以下载其文件.
  3. Telegra.ph 的文章链接, Bot 将下载其中的所有图片

此外, 规则中的存储名若使用 “CHOSEN” , 则表示存储到点击按钮选择的存储端的路径下

你也可以使用 /rule switch 来开关规则模式. 关闭规则模式时, 所有文件都将保存到默认存储.

预设规则 +#

为常见文件类型手动编写正则规则比较繁琐, 因此 Bot 内置了一组预设分类 (视频、图片、音频、文档、压缩包), 可以通过一条命令批量导入:

/rule preset <存储名> [基础路径]
+

参数:

  • 存储名: 目标存储名 (必须存在且你有权访问)
  • 基础路径: 可选. 各预设分类的子目录会创建在此路径下; 若不填则直接使用默认分类目录名

示例:

# 导入预设规则到 "MyAlist", 使用默认目录布局
+/rule preset MyAlist
+
+# 在自定义基础路径 "downloads/sorted" 下导入预设规则
+/rule preset MyAlist downloads/sorted
+

此命令会为每个分类创建 FILENAME-REGEX 规则, 将匹配的文件路由到 基础路径 下对应的子目录:

分类匹配的扩展名默认目录
视频mp4, mkv, ts, avi, flv, mov, webm, wmv, rmvb, m2ts视频
图片jpg, jpeg, png, gif, webp, bmp图片
音频mp3, flac, wav, aac, m4a, ogg音频
文档pdf, doc, docx, xls, xlsx, ppt, pptx, txt, md, csv, epub, mobi, azw3, chm文档
压缩包zip, rar, 7z, tar, gz, bz2, xz, …压缩包
导入后的预设规则就是普通的 `FILENAME-REGEX` 规则. 你可以像其他规则一样通过 `/rule` 查看或用 `/rule del ` 单独删除/编辑它们.

规则类型:

FILENAME-REGEX #

根据文件名正则匹配, 规则内容要求为一个合法的正则表达式, 如

FILENAME-REGEX (?i)\.(mp4|mkv|ts|avi|flv)$ MyAlist /视频
 

表示将文件名后缀为 mp4,mkv,ts,avi,flv 的文件放到名为 MyAlist 存储下的 /视频 目录内 (同时受配置文件中的 base_path 影响)

MESSAGE-REGEX #

同上, 但是是根据消息本身的文本内容正则匹配

IS-ALBUM #

匹配相册消息 (media group), 规则内容只能为 truefalse.

规则中的路径若使用 “NEW-FOR-ALBUM” , 则表示为该组消息新建一个文件夹来存储它们. 见: https://github.com/krau/SaveAny-Bot/issues/87

例如:

IS-ALBUM true MyWebdav NEW-FOR-ALBUM
-

这将会把以 media group 形式发送的消息保存到名为 MyWebdav 的存储下, 并为每个相册新建一个文件夹(由第一个文件生成)来存储它们.

\ No newline at end of file +

这将会把以 media group 形式发送的消息保存到名为 MyWebdav 的存储下, 并为每个相册新建一个文件夹(由第一个文件生成)来存储它们.

\ No newline at end of file diff --git a/usage/silent/index.html b/usage/silent/index.html index 535eb52..23dd388 100644 --- a/usage/silent/index.html +++ b/usage/silent/index.html @@ -11,7 +11,7 @@ 在开启静默模式之前, 需要使用 /storage 命令设置默认保存位置.">静默模式 | Save Any Bot

静默模式

静默模式 (silent) +简体中文

静默模式

静默模式 (silent) #

使用 /silent 命令可以开关静默模式.

默认情况下不开启静默模式, Bot 会询问你每个文件的保存位置.

开启静默模式后, Bot 会直接保存文件到默认位置, 无需确认.

在开启静默模式之前, 需要使用 /storage 命令设置默认保存位置.

\ No newline at end of file diff --git a/usage/transfer/index.html b/usage/transfer/index.html index 927ad6b..1956f5f 100644 --- a/usage/transfer/index.html +++ b/usage/transfer/index.html @@ -45,7 +45,7 @@ source_storage: 源存储名称 source_path: 源路径 filter: 可选的正则 源存储必须支持列举和读取功能 目标存储必须支持写入功能 传输过程显示实时进度 支持取消正在进行的传输任务'>存储间传输 | Save Any Bot

存储间传输

存储间传输 +简体中文

存储间传输

存储间传输 #

使用 /transfer 命令可以在不同存储之间直接传输文件, 无需经过 Telegram.

/transfer <source_storage>:/<source_path> [filter]
 

参数说明:

  • source_storage: 源存储名称
  • source_path: 源路径
  • filter: 可选的正则表达式过滤器, 只传输匹配的文件

示例:

# 传输整个目录
 /transfer local1:/downloads
diff --git a/usage/watch/index.html b/usage/watch/index.html
index c96c39e..6b52c79 100644
--- a/usage/watch/index.html
+++ b/usage/watch/index.html
@@ -28,7 +28,7 @@ msgre # 正则匹配消息文本, 例如:
 /watch 12345678 msgre:.*hello.* 这将会监听 ID 为 12345678 的聊天, 并且只保存消息文本中包含 “hello” 的消息.">监听聊天 | Save Any Bot
 

监听聊天

监听聊天 +简体中文

监听聊天

监听聊天 #

该功能需开启 UserBot 集成.

监听指定聊天的消息, 并自动保存到默认存储中, 遵从存储规则, 并且可以设置过滤器来只保存匹配的消息.

监听聊天:

/watch <chat_id/username> [filter] 
 

取消监听:

/unwatch <chat_id/username>
 

过滤器类型:

msgre diff --git a/usage/ytdlp/index.html b/usage/ytdlp/index.html index 78c913b..7d25ea0 100644 --- a/usage/ytdlp/index.html +++ b/usage/ytdlp/index.html @@ -34,7 +34,7 @@ -f : 指定下载格式 (如 best, worst, bestvideo+bestaudio) --extract-audio: 提取音频 --audio-format : 音频格式 (如 mp3, m4a, wav) --write-sub: 下载字幕 --write-thumbnail: 下载缩略图 更多参数请参考 yt-dlp 文档.">yt-dlp 视频下载 | Save Any Bot

yt-dlp 视频下载

yt-dlp 视频下载 +简体中文

yt-dlp 视频下载

yt-dlp 视频下载 #

该功能需要在系统中安装 yt-dlp 命令行工具.

使用 /ytdlp 命令可以下载支持的视频网站的视频和音频, 支持 YouTube、Bilibili、Twitter 等 1000+ 个网站.

/ytdlp <url1> [url2] [flags...]
 

示例:

# 基本下载
 /ytdlp https://www.youtube.com/watch?v=dQw4w9WgXcQ
diff --git a/zh/sitemap.xml b/zh/sitemap.xml
index 764f9be..9407ac4 100644
--- a/zh/sitemap.xml
+++ b/zh/sitemap.xml
@@ -1 +1 @@
-https://sabot.unv.app/usage/silent/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/rules/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/watch/2026-03-11T19:37:25+08:00https://sabot.unv.app/deployment/2025-06-16T15:58:03+08:00https://sabot.unv.app/usage/directlinks/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/aria2/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/ytdlp/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/transfer/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/parsers/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/2026-03-11T19:37:25+08:00https://sabot.unv.app/help/2025-06-16T15:58:03+08:00https://sabot.unv.app/usage/api/2026-03-11T19:37:25+08:00https://sabot.unv.app/contribute/2025-12-19T11:45:52+08:00https://sabot.unv.app/categories/https://sabot.unv.app/tags/https://sabot.unv.app/deployment/installation/2025-12-18T18:43:57+08:00https://sabot.unv.app/deployment/configuration/storages/2026-01-30T13:34:29+08:00https://sabot.unv.app/2026-01-30T13:34:29+08:00https://sabot.unv.app/deployment/configuration/2026-01-31T21:17:30+08:00
\ No newline at end of file
+https://sabot.unv.app/usage/silent/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/rules/2026-06-28T18:00:02+08:00https://sabot.unv.app/usage/watch/2026-03-11T19:37:25+08:00https://sabot.unv.app/deployment/2025-06-16T15:58:03+08:00https://sabot.unv.app/usage/directlinks/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/aria2/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/ytdlp/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/transfer/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/parsers/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/2026-03-11T19:37:25+08:00https://sabot.unv.app/usage/config/2026-06-28T18:00:02+08:00https://sabot.unv.app/help/2025-06-16T15:58:03+08:00https://sabot.unv.app/usage/api/2026-03-11T19:37:25+08:00https://sabot.unv.app/contribute/2025-12-19T11:45:52+08:00https://sabot.unv.app/usage/cli/2026-06-28T18:00:02+08:00https://sabot.unv.app/categories/https://sabot.unv.app/tags/https://sabot.unv.app/deployment/installation/2025-12-18T18:43:57+08:00https://sabot.unv.app/deployment/configuration/storages/2026-01-30T13:34:29+08:00https://sabot.unv.app/2026-01-30T13:34:29+08:00https://sabot.unv.app/deployment/configuration/2026-06-28T18:00:02+08:00
\ No newline at end of file