From 4ba1a2133f7f1b2109cb54c928399b75a6401e76 Mon Sep 17 00:00:00 2001 From: Rehtt Date: Thu, 19 Sep 2024 11:00:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E7=9A=84=E6=94=B6=E8=97=8F=E5=A4=B9=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fav.go | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/fav.go b/fav.go index cca0d62..32c08af 100644 --- a/fav.go +++ b/fav.go @@ -316,3 +316,51 @@ func (c *Client) GetFavourIds(param GetFavourIdsParam) ([]FavourId, error) { ) return execute[[]FavourId](c, method, url, param) } + +type SelfFavourList struct { + ID int64 `json:"id"` + Name string `json:"name"` + MediaListResponse struct { + Count int `json:"count"` + List []struct { + ID int64 `json:"id"` + Fid int `json:"fid"` + Mid int `json:"mid"` + Attr int `json:"attr"` + AttrDesc string `json:"attr_desc"` + Title string `json:"title"` + Cover string `json:"cover"` + Upper struct { + Mid int `json:"mid"` + Name string `json:"name"` + Face string `json:"face"` + } `json:"upper"` + CoverType int `json:"cover_type"` + Intro string `json:"intro"` + Ctime int `json:"ctime"` + Mtime int `json:"mtime"` + State int `json:"state"` + FavState int `json:"fav_state"` + MediaCount int `json:"media_count"` + ViewCount int `json:"view_count"` + Vt int `json:"vt"` + IsTop bool `json:"is_top"` + RecentFav interface{} `json:"recent_fav"` + PlaySwitch int `json:"play_switch"` + Type int `json:"type"` + Link string `json:"link"` + Bvid string `json:"bvid"` + } `json:"list"` + HasMore bool `json:"has_more"` + } `json:"mediaListResponse"` + URI string `json:"uri"` +} + +// SelfFavourList 获取自己的收藏夹列表 +func (c *Client) SelfFavourList() ([]SelfFavourList, error) { + const ( + method = resty.MethodGet + url = "https://api.bilibili.com/x/v3/fav/folder/list4navigate" + ) + return execute[[]SelfFavourList](c, method, url, nil) +} From 02fd534ac788a0104ff37e48df1093ea4da83814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E8=91=A9=E3=81=AE=E7=81=B5=E6=A2=A6?= Date: Thu, 19 Sep 2024 11:31:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=91=BD=E5=90=8D=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fav.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fav.go b/fav.go index 32c08af..e8e66dc 100644 --- a/fav.go +++ b/fav.go @@ -356,8 +356,8 @@ type SelfFavourList struct { URI string `json:"uri"` } -// SelfFavourList 获取自己的收藏夹列表 -func (c *Client) SelfFavourList() ([]SelfFavourList, error) { +// GetSelfFavourList 获取自己的收藏夹列表 +func (c *Client) GetSelfFavourList() ([]SelfFavourList, error) { const ( method = resty.MethodGet url = "https://api.bilibili.com/x/v3/fav/folder/list4navigate"