Skip to content

Commit

Permalink
fix(bilibili): update API (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kittengarten authored Oct 11, 2024
1 parent 9c87909 commit abb9f0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions bilibili/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ import (
"github.com/tidwall/gjson"
)

var (
// ErrAPINeedCookie ...
ErrAPINeedCookie = errors.New("api need cookie")
)
// ErrAPINeedCookie ...
var ErrAPINeedCookie = errors.New("api need cookie")

// SearchUser 查找b站用户
func SearchUser(cookiecfg *CookieConfig, keyword string) (r []SearchResult, err error) {
Expand Down Expand Up @@ -101,7 +99,7 @@ func GetMemberCard(uid any) (result MemberCard, err error) {
if err != nil {
return
}
err = json.Unmarshal(binary.StringToBytes(gjson.ParseBytes(data).Get("card").Raw), &result)
err = json.Unmarshal(binary.StringToBytes(gjson.ParseBytes(data).Get("data.card").Raw), &result)
return
}

Expand Down
2 changes: 1 addition & 1 deletion bilibili/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
// DynamicDetailURL 当前动态信息,一个card
DynamicDetailURL = "https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/get_dynamic_detail?dynamic_id=%v"
// MemberCardURL 个人信息
MemberCardURL = "https://account.bilibili.com/api/member/getCardByMid?mid=%v"
MemberCardURL = "https://api.bilibili.com/x/web-interface/card?mid=%v"
// ArticleInfoURL 查看专栏信息
ArticleInfoURL = "https://api.bilibili.com/x/article/viewinfo?id=%v"
// CVURL b站专栏前缀
Expand Down

0 comments on commit abb9f0f

Please sign in to comment.