feat: update parser interface to include context in Parse method

This commit is contained in:
krau
2025-08-23 14:01:00 +08:00
parent 231eb61d25
commit 03eb4f8a18
5 changed files with 18 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ SaveAnyBot 可通过插件扩展功能, 目前仅支持 Parser (解析器)插件
```go
type Parser interface {
CanHandle(url string) bool // 判断是否能处理给定的 URL
Parse(url string) (*Item, error) // 解析 URL, 返回 Item
Parse(ctx context.Context, url string) (*Item, error) // 解析 URL, 返回 Item
}
// Resource is a single downloadable resource with metadata.