Skip to content

Commit 0c948e3

Browse files
authored
fix(bilibili): GetVideoInfo unmarshal key error (#79)
* fix(bilibili): GetVideoInfo unmarshal key error * chore: make lint happy
1 parent ba37dfe commit 0c948e3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

bilibili/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func GetVideoInfo(id string) (card Card, err error) {
200200
if err != nil {
201201
return
202202
}
203-
err = json.Unmarshal(binary.StringToBytes(gjson.ParseBytes(data).Raw), &card)
203+
err = json.Unmarshal(binary.StringToBytes(gjson.GetBytes(data, "data").Raw), &card)
204204
return
205205
}
206206

bilibili/ctx.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
var re = regexp.MustCompile(`^\d+$`)
1313

14+
// RequireUser 查询用户
1415
func RequireUser(cfg *CookieConfig) func(ctx *zero.Ctx) bool {
1516
return func(ctx *zero.Ctx) bool {
1617
keyword := ctx.State["regex_matched"].([]string)[1]

0 commit comments

Comments
 (0)