diff --git a/bilibili/api.go b/bilibili/api.go index cc1fbbb..370dc0a 100644 --- a/bilibili/api.go +++ b/bilibili/api.go @@ -200,7 +200,7 @@ func GetVideoInfo(id string) (card Card, err error) { if err != nil { return } - err = json.Unmarshal(binary.StringToBytes(gjson.ParseBytes(data).Raw), &card) + err = json.Unmarshal(binary.StringToBytes(gjson.GetBytes(data, "data").Raw), &card) return } diff --git a/bilibili/ctx.go b/bilibili/ctx.go index c2d5f97..f00d07f 100644 --- a/bilibili/ctx.go +++ b/bilibili/ctx.go @@ -11,6 +11,7 @@ import ( var re = regexp.MustCompile(`^\d+$`) +// RequireUser 查询用户 func RequireUser(cfg *CookieConfig) func(ctx *zero.Ctx) bool { return func(ctx *zero.Ctx) bool { keyword := ctx.State["regex_matched"].([]string)[1]