Skip to content

Commit

Permalink
获取用户空间动态
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Mar 14, 2024
1 parent 0b20685 commit c8614a8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,12 +1090,15 @@ type DynamicInfo struct {
// GetUserSpaceDynamic 获取用户空间动态,mid就是用户UID,无需登录。
//
// 返回结构较为繁琐,见 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/dynamic/space.md
func GetUserSpaceDynamic(mid int) (*DynamicInfo, error) {
return std.GetUserSpaceDynamic(mid)
func GetUserSpaceDynamic(mid int, offset string) (*DynamicInfo, error) {
return std.GetUserSpaceDynamic(mid, offset)
}
func (c *Client) GetUserSpaceDynamic(mid int) (*DynamicInfo, error) {
resp, err := c.resty().R().SetHeader("Content-Type", "application/x-www-form-urlencoded").
SetQueryParam("host_mid", strconv.Itoa(mid)).Get("https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/space")
func (c *Client) GetUserSpaceDynamic(mid int, offset string) (*DynamicInfo, error) {
r := c.resty().R().SetHeader("Content-Type", "application/x-www-form-urlencoded").SetQueryParam("host_mid", strconv.Itoa(mid))
if len(offset) > 0 {
r = r.SetQueryParam("offset", offset)
}
resp, err := r.Get("https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/space")
if err != nil {
return nil, errors.WithStack(err)
}
Expand Down

0 comments on commit c8614a8

Please sign in to comment.