Files
Estrella Pan 396a92787e fix: 回滚后再升级时重新备份 3.x 数据库,单个下载器重命名出错不拖垮其它实例
- version_check: 数据库仍是 3.x 结构(schema ≤ 24)时备份并原子替换 data.db.v3.bak,
  回滚 3.3 后再升级也会刷新备份;只留一份,迁移失败的重启循环不会堆积
- rename_all: 实例内的异常记录后继续下一个实例
- 文档:回滚步骤删除 data.db-wal/-shm、还原编号最大的配置备份;schema v28
- 插件 skill 改用 httpx2、补全示例列表;示例 README 先安装 SDK 轮子再测试
- 准备 4.0.0-beta.9
2026-10-24 11:00:56 +02:00

48 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Apprise 通知
通过 [Apprise API](https://github.com/caronc/apprise-api) 服务器把通知转发到 Telegram、Discord、邮件等上百种服务。插件不依赖 `apprise` 库,只调用 HTTP 接口。
- `@provider(points.NOTIFIER, id="apprise")`:返回 `NotifierFactory`
- 填写了 Apprise URL:`POST {server}/notify/`,请求体 `{"urls", "title", "body"}`,多个 URL 以逗号拼接成一个字符串
- 否则使用配置键:`POST {server}/notify/{config_key}`,请求体 `{"title", "body"}`,URL 保存在服务器上
- 两者都没填时 `send` 返回 `False`,「测试」提示需要填写其中之一
- HTTP 2xx 即成功
## 准备 Apprise API 服务器
自行运行 `caronc/apprise` 容器,例如:
```bash
docker run -d --name apprise -p 8000:8000 caronc/apprise:latest
```
与 AutoBangumi 在同一 Docker 网络时,服务器地址可填 `http://apprise:8000`。使用配置键时,先在 Apprise 的网页界面(`http://<服务器>:8000/cfg/<配置键>`)保存通知 URL。
## 配置
| 字段 | 说明 |
| --- | --- |
| `server` | Apprise API 服务器地址,默认 `http://apprise:8000` |
| `urls` | 可选:Apprise URL,如 `tgram://bottoken/ChatID`;多个 URL 用逗号或换行分隔;填写后忽略配置键。URL 含令牌,按秘密字段处理,读取配置时只返回掩码 |
| `config_key` | 可选:服务器上保存的配置键 |
## 安装
```bash
cp -r examples/plugins/apprise-notifier config/plugins/local/
```
在「设置 → 插件」中开启「允许未签名插件」,启用并填写服务器与 URL(或配置键);再到「设置 → 通知 → 添加渠道」选择类型 `apprise`。
## 测试
```bash
cd examples/plugins/apprise-notifier
uv add ../autobangumi_sdk-0.6.0-py3-none-any.whl # SDK 不在 PyPI:换成下载的轮子的实际路径
uv run pytest
```
---
基于 @LTSlw 在 [#942](https://github.com/EstrellaXD/Auto_Bangumi/pull/942) 中的实现