Files
Auto_Bangumi/docs/en/dev/plugins/points/torrent-adding.md
Estrella Pan 3258fcca4b docs(4.0-P7): 插件开发文档拆分为总览加每个扩展点一页,补齐中英日三语
- docs/dev/plugins.md 改为总览与导航,旧内容拆入 docs/dev/plugins/
- 新增核心概念、配置表单、事件、前端挂载点、命令行、签名与分发、内置插件、示例页
- 每个扩展点一页,侧边栏由页面表生成
- 改正旧文档中下载器配置、hardlink path_map 与补链按钮的过时描述
2026-10-08 14:51:00 +02:00

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 Bangumi category. If you change category, 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 N in the save path. Keep this structure when you change save_path.