Files
Auto_Bangumi/docs/en/dev/plugins/examples.md
Estrella Pan 776abfa896 docs(4.0): 更新 API 参考与开发者文档,新增获取 SDK 页
- API 参考按实际路由重写,修正认证方式、请求方法与设置向导端点
- 数据库指南改为异步 Database 与 MIGRATIONS
- E2E 指南改为指向 e2e/README.md
- 插件快速上手补上安装 SDK 轮子的步骤,ab-plugin dev 加 --config-dir
- 发布流程改为手动推送标签触发
2026-10-08 17:36:53 +02:00

33 lines
1.8 KiB
Markdown

# Example Plugins
The examples are in [`examples/plugins/`](https://github.com/EstrellaXD/Auto_Bangumi/tree/main/examples/plugins) of the repository. They are not in the Docker image. Each example has its own README and tests. CI runs them one by one.
| Example | What it shows |
| --- | --- |
| `webhook-on-event` | `@subscribe("*")`, a config form, `secret_field`. Sends selected events as a POST to a URL, with an optional HMAC signature |
| `custom-rss-site` | A `search_site` Provider and an `http.request` hook. Adds a Cookie to the requests of a private site. `SearchSiteContract` |
| `template-rename` | A `rename_strategy` Provider with a file-name template that has its own filters. `RenameSkipped`. `RenameStrategyContract` |
| `nfo-writer` | Subscribes to `torrent.organized` and writes an `.nfo` next to each media file. Path mapping. Idempotent |
| `ntfy-notifier` | A `notifier` Provider. Returns `False` when the backend refuses. `NotifierContract` |
| `manual-pick` | The frontend slot `bangumi.detail.tab`, plugin routes, plugin KV, events |
## Install an example
```bash
cp -r examples/plugins/ntfy-notifier config/plugins/local/
```
Turn on "Allow unsigned plugins" in Settings → Plugins, then enable the plugin.
## Run the tests of an example
Run the script in the repository root. It validates the manifest of each example and runs its tests, the same as CI:
```bash
scripts/test_example_plugins.sh
```
The script runs in the `backend/` environment, which has an editable install of the SDK. The `pyproject.toml` of each example needs `autobangumi-sdk`, and this package is not on PyPI. To test an example outside the repository, first run `uv add <path to the wheel>` in the example directory. Then run `uv run pytest`.
You do not need a plugin to refresh a Jellyfin, Emby or Plex library. The built-in plugin `media-server-refresh` does it.