mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-10-30 12:14:27 +08:00
- docs/dev/plugins.md 改为总览与导航,旧内容拆入 docs/dev/plugins/ - 新增核心概念、配置表单、事件、前端挂载点、命令行、签名与分发、内置插件、示例页 - 每个扩展点一页,侧边栏由页面表生成 - 改正旧文档中下载器配置、hardlink path_map 与补链按钮的过时描述
874 B
874 B
Adding Request (torrent.adding)
A transform hook. AB calls it before it gives the torrents to the downloader. The parameter is ab_sdk.ingest.AddRequest (bangumi, torrents, save_path, category, tags).
from dataclasses import replace
from ab_sdk import Plugin, hook, points
class Tagger(Plugin):
@hook(points.TORRENT_ADDING)
def tag(self, request):
return replace(request, tags=(*request.tags, request.bangumi.official_title))
Notes:
- Organizing and renaming process only torrents in the
Bangumicategory. If you changecategory, AB no longer organizes these torrents. - The tag
ab:<series id>is how rename finds the series. If a hook removes it, AB adds it again. - Rename finds the series and the season from the structure
<series name>/Season Nin the save path. Keep this structure when you changesave_path.