Files
Auto_Bangumi/docs/dev/plugins/points/title-parsed.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

24 lines
1.0 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.
# 修正解析结果(title.parsed)
transform 钩子。在确定性解析(以及启用时的 LLM 解析)之后、准入判定之前调用。收到冻结的解析结果,用 `dataclasses.replace` 返回修改后的副本;返回 `None` 表示不修改。返回其它类型会被忽略并计入熔断。
```python
from dataclasses import replace
from ab_sdk import Plugin, hook, points
ALIASES = {"LoliHouse": "Lolihouse"}
class GroupAlias(Plugin):
@hook(points.TITLE_PARSED)
def fix(self, release):
if release.group in ALIASES:
return replace(release, group=ALIASES[release.group])
return None
```
- 可读字段:`raw`、`title_en`、`title_zh`、`title_jp`、`group`、`season`、`episode`、`resolution`、`source`、`subtitle`、`year`。这些之外的属性(`media_type`、`release_kind` 等)可读,但 SDK 1.0 之前不保证稳定。
- 新规则的番剧名、季度、字幕组都来自这里的结果,所以修改会影响新建的规则。
- 改成 PV、合集等类型会让该资源不被收录。