Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Mar 27, 2024
1 parent c25f8bf commit f1d78fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
4 changes: 1 addition & 3 deletions article.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package bilibili

import (
"github.com/go-resty/resty/v2"
)
import "github.com/go-resty/resty/v2"

type GetArticlesInfoParam struct {
Id int `json:"id"` // 文集rlid
Expand Down
5 changes: 2 additions & 3 deletions dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package bilibili

import (
"encoding/json"
"github.com/pkg/errors"
"github.com/tidwall/gjson"
"io"
"strconv"
"strings"

"github.com/pkg/errors"
"github.com/tidwall/gjson"
)

type SearchDynamicAtResult struct {
Expand Down
9 changes: 2 additions & 7 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package bilibili

import (
"encoding/json"
"strconv"

"github.com/pkg/errors"
"strconv"
)

type OrderType string
Expand Down Expand Up @@ -191,12 +190,8 @@ func (c *Client) GetUserVideos(mid int, order OrderType, tid int, keyword string

// GetUserCard 获取用户用户名片 免登录
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/user/info.md#%E7%94%A8%E6%88%B7%E5%90%8D%E7%89%87%E4%BF%A1%E6%81%AF
func GetUserCard(mid int, photo bool) (*UserCardResult, error) {
return std.GetUserCard(mid, photo)
}
func (c *Client) GetUserCard(mid int, photo bool) (*UserCardResult, error) {
r := c.resty().R().SetQueryParam("mid", strconv.Itoa(mid)).SetQueryParam("photo", strconv.FormatBool(photo))

r := c.resty.R().SetQueryParam("mid", strconv.Itoa(mid)).SetQueryParam("photo", strconv.FormatBool(photo))
resp, err := r.Get("https://api.bilibili.com/x/web-interface/card")
if err != nil {
return nil, errors.WithStack(err)
Expand Down
9 changes: 3 additions & 6 deletions video.go
Original file line number Diff line number Diff line change
Expand Up @@ -1095,18 +1095,15 @@ type ArchivesList struct {
}

// GetArchivesList 获取视频合集信息 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/collection.md#%E8%8E%B7%E5%8F%96%E8%A7%86%E9%A2%91%E5%90%88%E9%9B%86%E4%BF%A1%E6%81%AF
func GetArchivesList(mid int, sid int, pn int, ps int, sort_reverse bool) (*ArchivesList, error) {
return std.GetArchivesList(mid, sid, pn, ps, sort_reverse)
}
func (c *Client) GetArchivesList(mid int, sid int, pn int, ps int, sort_reverse bool) (*ArchivesList, error) {
func (c *Client) GetArchivesList(mid int, sid int, pn int, ps int, sortReverse bool) (*ArchivesList, error) {
postData := map[string]string{
"mid": strconv.Itoa(mid),
"page_num": strconv.Itoa(pn),
"page_size": strconv.Itoa(ps),
"season_id": strconv.Itoa(sid),
"sort_reverse": strconv.FormatBool(sort_reverse),
"sort_reverse": strconv.FormatBool(sortReverse),
}
resp, err := c.resty().R().SetQueryParams(postData).Get("https://api.bilibili.com/x/polymer/web-space/seasons_archives_list")
resp, err := c.resty.R().SetQueryParams(postData).Get("https://api.bilibili.com/x/polymer/web-space/seasons_archives_list")
if err != nil {
return nil, errors.WithStack(err)
}
Expand Down

0 comments on commit f1d78fd

Please sign in to comment.