bilibili

package module
v0.0.0-...-c368e8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 26 Imported by: 1

README

go-bilibili-api

哔哩哔哩 API 的 go 语言实现。

接口编写参考 BAC Document 目前已按顺序实现至 大会员

背景知识

在使用本库前,你需要了解 req 库的使用方法。

使用方法

你先别急🤭

先看本库有没有实现,如果没有实现,请告诉我,我有空会实现。

其次,本库最大的优点是自由度高,你可以按照本库中编写 API 的方式写你需要的接口,再用 client.go 里的函数实现调用

func Do[T any](api req.API) (result T, err error) {
	err = cli.Result(api, &result)
	return
}

Documentation

Index

Constants

View Source
const (
	MsgText        = 1   // 纯文字消息
	MsgImage       = 2   // 图片消息
	MsgWithdraw    = 5   // 撤回消息
	MsgGroupsImage = 6   // 应援团图片
	MsgShareVideo  = 7   // 分享视频
	MsgNotice      = 10  // 系统通知
	MsgPushedVideo = 11  // UP 主推送的视频
	MsgWelcome     = 306 // 新成员加入应援团欢迎
)

Variables

View Source
var ErrRefreshCSRFNotExist = errors.New("bilibili: refresh_csrf does not exist")
View Source
var PublicKeyPEM []byte
View Source
var Session = req.DefaultSession.Clone().SetHeader(map[string]string{
	"Referer": "https://www.bilibili.com/",
}).SetBaseURL("https://api.bilibili.com/x")

Functions

func AddMixinKey

func AddMixinKey(query url.Values) error

添加请求参数验证参数

func Do

func Do[T any](ctx context.Context, api req.API) (result T, err error)

func GenerateMixinKey

func GenerateMixinKey(ae string) string

根据拼接后字符串生成 mixinKey

func GetBuvid3

func GetBuvid3(ctx context.Context) string

接口获取 buvid3

func GetCorrespondPath

func GetCorrespondPath(ts int64) (string, error)

生成 CorrespondPath

ts 为当前毫秒级时间戳

代码由 https://socialsisteryi.github.io/bilibili-API-collect/docs/login/cookie_refresh.html 提供

func GetMixinKey

func GetMixinKey() (string, error)

获取 mixinKey

func GetRefreshCSRF

func GetRefreshCSRF(ctx context.Context, jar http.CookieJar) (string, error)

获取 refresh_csrf

func IntSliceToString

func IntSliceToString(num []int) string

将数组转为字符串

func PostConfirmRefresh

func PostConfirmRefresh(ctx context.Context, jar http.CookieJar, token string) (err error)

确认更新

func SplitURL

func SplitURL(url string) string

提取 img_key 和 sub_key

func UpdateMixinKey

func UpdateMixinKey() error

更新 mixinKey

成功后会刷新 mixinKeyUpdateTime

Types

type AccInfo

type AccInfo struct {
	GetWBI
	http.CookieJar

	// 目标用户 UID
	MID int `req:"query"`
}

用户空间详细信息

func (AccInfo) RawURL

func (AccInfo) RawURL() string

type AccInfoResponse

type AccInfoResponse struct {
	Error
	Data struct {
		MID         int    `json:"mid"`           // 208259
		Name        string `json:"name"`          // "陈睿"
		Sex         string `json:"sex"`           // "男"
		Face        string `json:"face"`          // "http://i2.hdslb.com/bfs/app/8920e6741fc2808cce5b81bc27abdbda291655d3.png"
		FaceNft     int    `json:"face_nft"`      // 0
		FaceNftType int    `json:"face_nft_type"` // 0
		Sign        string `json:"sign"`          // "喜欢的话就坚持吧"
		Rank        int    `json:"rank"`          // 10000
		Level       int    `json:"level"`         // 6
		Jointime    int    `json:"jointime"`      // 0
		Moral       int    `json:"moral"`         // 0
		Silence     int    `json:"silence"`       // 0
		Coins       int    `json:"coins"`         // 0
		FansBadge   bool   `json:"fans_badge"`    // true
		FansMedal   struct {
			Show  bool `json:"show"` // false
			Wear  bool `json:"wear"` // false
			Medal any  `json:"medal"`
		} `json:"fans_medal"`
		Official struct {
			Role  int    `json:"role"`  // 2
			Title string `json:"title"` // "bilibili董事长兼CEO"
			Desc  string `json:"desc"`  // ""
			Type  int    `json:"type"`  // 0
		} `json:"official"`
		Vip struct {
			Type       int   `json:"type"`         // 2
			Status     int   `json:"status"`       // 1
			DueDate    int64 `json:"due_date"`     // 2096121600000
			VipPayType int   `json:"vip_pay_type"` // 1
			ThemeType  int   `json:"theme_type"`   // 0
			Label      struct {
				Path                  string `json:"path"`                      // ""
				Text                  string `json:"text"`                      // "十年大会员"
				LabelTheme            string `json:"label_theme"`               // "ten_annual_vip"
				TextColor             string `json:"text_color"`                // "#FFFFFF"
				BgStyle               int    `json:"bg_style"`                  // 1
				BgColor               string `json:"bg_color"`                  // "#FB7299"
				BorderColor           string `json:"border_color"`              // ""
				UseImgLabel           bool   `json:"use_img_label"`             // true
				ImgLabelURIHans       string `json:"img_label_uri_hans"`        // "https://i0.hdslb.com/bfs/activity-plat/static/20220608/e369244d0b14644f5e1a06431e22a4d5/wltavwHAkL.gif"
				ImgLabelURIHant       string `json:"img_label_uri_hant"`        // ""
				ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"` // "https://i0.hdslb.com/bfs/vip/802418ff03911645648b63aa193ba67997b5a0bc.png"
				ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"` // "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/8u7iRTPE7N.png"
			} `json:"label"`
			AvatarSubscript    int    `json:"avatar_subscript"`     // 1
			NicknameColor      string `json:"nickname_color"`       // "#FB7299"
			Role               int    `json:"role"`                 // 7
			AvatarSubscriptURL string `json:"avatar_subscript_url"` // ""
			TvVipStatus        int    `json:"tv_vip_status"`        // 1
			TvVipPayType       int    `json:"tv_vip_pay_type"`      // 0
			TvDueDate          int    `json:"tv_due_date"`          // 1873641600
			AvatarIcon         struct {
				IconType     int `json:"icon_type"` // 1
				IconResource struct {
				} `json:"icon_resource"`
			} `json:"avatar_icon"`
		} `json:"vip"`
		Pendant struct {
			PID               int    `json:"pid"`                 // 0
			Name              string `json:"name"`                // ""
			Image             string `json:"image"`               // ""
			Expire            int    `json:"expire"`              // 0
			ImageEnhance      string `json:"image_enhance"`       // ""
			ImageEnhanceFrame string `json:"image_enhance_frame"` // ""
			NPID              int    `json:"n_pid"`               // 0
		} `json:"pendant"`
		Nameplate struct {
			NID        int    `json:"nid"`         // 0
			Name       string `json:"name"`        // ""
			Image      string `json:"image"`       // ""
			ImageSmall string `json:"image_small"` // ""
			Level      string `json:"level"`       // ""
			Condition  string `json:"condition"`   // ""
		} `json:"nameplate"`
		UserHonourInfo struct {
			MID               int   `json:"mid"` // 0
			Colour            any   `json:"colour"`
			Tags              []any `json:"tags"`
			IsLatest100Honour int   `json:"is_latest_100honour"` // 0
		} `json:"user_honour_info"`
		IsFollowed bool   `json:"is_followed"` // false
		TopPhoto   string `json:"top_photo"`   // "http://i0.hdslb.com/bfs/space/cb1c3ef50e22b6096fde67febe863494caefebad.png"
		Theme      struct {
		} `json:"theme"`
		SysNotice struct {
		} `json:"sys_notice"`
		LiveRoom struct {
			RoomStatus    int    `json:"roomStatus"`     // 1
			LiveStatus    int    `json:"liveStatus"`     // 0
			URL           string `json:"url"`            // "https://live.bilibili.com/3394945?broadcast_type=0&is_room_feed=0"
			Title         string `json:"title"`          // "初来报道,关注一下吧~"
			Cover         string `json:"cover"`          // "https://i0.hdslb.com/bfs/live/59fc254c1f51a962dbf69ae85e4920f2f6fb8dcd.png"
			RoomID        int    `json:"roomid"`         // 3394945
			RoundStatus   int    `json:"roundStatus"`    // 0
			BroadcastType int    `json:"broadcast_type"` // 0
			WatchedShow   struct {
				Switch       bool   `json:"switch"`        // true
				Num          int    `json:"num"`           // 1
				TextSmall    string `json:"text_small"`    // "1"
				TextLarge    string `json:"text_large"`    // "1人看过"
				Icon         string `json:"icon"`          // "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png"
				IconLocation string `json:"icon_location"` // ""
				IconWeb      string `json:"icon_web"`      // "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png"
			} `json:"watched_show"`
		} `json:"live_room"`
		Birthday string `json:"birthday"` // "01-23"
		School   struct {
			Name string `json:"name"` // "成都信息工程大学"
		} `json:"school"`
		Profession struct {
			Name       string `json:"name"`       // ""
			Department string `json:"department"` // ""
			Title      string `json:"title"`      // ""
			IsShow     int    `json:"is_show"`    // 0
		} `json:"profession"`
		Tags   any `json:"tags"`
		Series struct {
			UserUpgradeStatus int  `json:"user_upgrade_status"` // 3
			ShowUpgradeWindow bool `json:"show_upgrade_window"` // false
		} `json:"series"`
		IsSeniorMember int  `json:"is_senior_member"` // 0
		McnInfo        any  `json:"mcn_info"`
		GaiaResType    int  `json:"gaia_res_type"` // 0
		GaiaData       any  `json:"gaia_data"`
		IsRisk         bool `json:"is_risk"` // false
		Elec           struct {
			ShowInfo struct {
				Show    bool   `json:"show"`     // false
				State   int    `json:"state"`    // -1
				Title   string `json:"title"`    // ""
				Icon    string `json:"icon"`     // ""
				JumpURL string `json:"jump_url"` // "?oid=208259"
			} `json:"show_info"`
		} `json:"elec"`
		Contract struct {
			IsDisplay       bool `json:"is_display"`        // false
			IsFollowDisplay bool `json:"is_follow_display"` // false
		} `json:"contract"`
		CertificateShow bool `json:"certificate_show"` // false
		NameRender      any  `json:"name_render"`
	} `json:"data"`
}

func GetAccInfo

func GetAccInfo(ctx context.Context, jar http.CookieJar, uid int) (AccInfoResponse, error)

用户空间详细信息

type AccRelation

type AccRelation struct {
	GetWBI
	http.CookieJar

	// 目标用户 UID
	MID int `req:"query"`
}

查询用户与自己关系(互相关系)

func (AccRelation) RawURL

func (AccRelation) RawURL() string

type AccRelationResponse

type AccRelationResponse struct {
	Error
	Data struct {
		Relation   QueryRelation `json:"relation"`    // 目标用户对于当前用户的关系
		BeRelation QueryRelation `json:"be_relation"` // 当前用户对于目标用户的关系
	} `json:"data"`
}

func GetAccRelation

func GetAccRelation(ctx context.Context, jar http.CookieJar, uid int) (AccRelationResponse, error)

查询用户与自己关系(互相关系)

type AccTags

type AccTags struct {
	req.Get

	// 用户 UID
	MID int `req:"query"`
}

查看用户个人 TAG

func (AccTags) RawURL

func (AccTags) RawURL() string

type AccTagsResponse

type AccTagsResponse struct {
	Error
	Data []struct {
		MID  int      `json:"mid"` // 434334701
		Tags []string `json:"tags"`
	} `json:"data"`
}

func GetAccTags

func GetAccTags(ctx context.Context, uid int) (AccTagsResponse, error)

查看用户个人 TAG

type Account

type Account struct {
	req.Get
	http.CookieJar
}

获取我的信息

func (Account) RawURL

func (Account) RawURL() string

type AccountResponse

type AccountResponse struct {
	Error
	Data struct {
		MID      int    `json:"mid"`
		Uname    string `json:"uname"`
		UserID   string `json:"userid"`
		Sign     string `json:"sign"`
		Birthday string `json:"birthday"`
		Sex      string `json:"sex"`
		NickFree bool   `json:"nick_free"`
		Rank     string `json:"rank"`
	} `json:"data"`
}

func GetAccount

func GetAccount(ctx context.Context, jar http.CookieJar) (AccountResponse, error)

获取我的信息

type Add

type Add struct {
	PostCSRF
	http.CookieJar

	// 置顶目标稿件 avid
	// 与 bvid 任选一个
	AID int `req:"body"`

	// 置顶目标稿件 bvid
	// 与 avid 任选一个
	BVID string `req:"body:bvid"`

	// 置顶视频备注 最大 40 字符
	Reason string `req:"body"`
}

添加代表作视频

func (Add) RawURL

func (Add) RawURL() string

type AddResponse

type AddResponse struct {
	Error
}

func PostAdd

func PostAdd(ctx context.Context, jar http.CookieJar, bvid, reason string) (AddResponse, error)

添加代表作视频

type AddUsers

type AddUsers struct {
	PostCSRF
	http.CookieJar

	// 目标用户 UID 用(,)间隔
	FIDs string `req:"query"`

	// 分组 id 列表 用(,)间隔
	TagIDs string `req:"query:tagids"`
}

修改分组成员

如需删除分组中的成员 请将 tagids 设为 0 即移动至默认分组 而不是取关

func (AddUsers) RawURL

func (AddUsers) RawURL() string

type AddUsersResponse

type AddUsersResponse struct {
	Error
}

func PostAddUsers

func PostAddUsers(ctx context.Context, jar http.CookieJar, uid, tagid []int) (AddUsersResponse, error)

修改分组成员

如需删除分组中的成员 请将 tagids 设为 0 即移动至默认分组 而不是取关

type ApplyStatus

type ApplyStatus struct {
	req.Get
	http.CookieJar
}

查询实名认证详细信息

func (ApplyStatus) RawURL

func (ApplyStatus) RawURL() string

type ApplyStatusResponse

type ApplyStatusResponse struct {
	Error
	Data struct {
		Status   int    `json:"status"`
		Remark   string `json:"remark"`
		Realname string `json:"realname"`
		Card     string `json:"card"`
		CardType int    `json:"card_type"`
	} `json:"data"`
}

func GetApplyStatus

func GetApplyStatus(ctx context.Context, jar http.CookieJar) (ApplyStatusResponse, error)

查询实名认证详细信息

type Arc

type Arc struct {
	req.Get

	// 目标用户 UID
	Vmid int `req:"query"`
}

查询用户置顶视频

func (Arc) RawURL

func (Arc) RawURL() string

type ArcResponse

type ArcResponse struct {
	Error
	Data VideoInfo `json:"data"`
}

func GetArc

func GetArc(ctx context.Context, uid int) (ArcResponse, error)

查询用户置顶视频

type ArcSearch

type ArcSearch struct {
	GetWBI
	http.CookieJar

	// 目标用户 UID
	MID int `req:"query"`

	// 排序方式
	// 默认为 pubdate
	// 最新发布 pubdate
	// 最多播放 click
	// 最多收藏 stow
	Order string `req:"query"`

	// 筛选目标分区
	// 默认为 0 不进行分区筛选
	TID int `req:"query"`

	// 关键词筛选
	// 用于使用关键词搜索该UP主视频稿件
	Keyword string `req:"query"`

	// 页码
	// 默认为 1
	Pn int `req:"query" default:"1"`

	// 每页项数
	// 默认为 30
	Ps int `req:"query" default:"30"`
}

查询用户投稿视频明细

func (ArcSearch) RawURL

func (ArcSearch) RawURL() string

type ArcSearchResponse

type ArcSearchResponse struct {
	Error
	Data struct {
		List struct {
			Slist []any `json:"slist"`
			Tlist map[int]struct {
				TID   int    `json:"tid"`   // 4
				Count int    `json:"count"` // 13
				Name  string `json:"name"`  // "游戏"
			} `json:"tlist"`
			Vlist []ArcSearchVideo `json:"vlist"`
		} `json:"list"`
		Page struct {
			Pn    int `json:"pn"`    // 1
			Ps    int `json:"ps"`    // 30
			Count int `json:"count"` // 77
		} `json:"page"`
		EpisodicButton struct {
			Text string `json:"text"` // "播放全部"
			URI  string `json:"uri"`  // "//www.bilibili.com/medialist/play/188888131?from=space"
		} `json:"episodic_button"`
		IsRisk      bool `json:"is_risk"`       // false
		GaiaResType int  `json:"gaia_res_type"` // 0
		GaiaData    any  `json:"gaia_data"`
	} `json:"data"`
}

func GetArcSearch

func GetArcSearch(ctx context.Context, jar http.CookieJar, uid int) (ArcSearchResponse, error)

查询用户投稿视频明细

type ArcSearchVideo

type ArcSearchVideo struct {
	Comment          int    `json:"comment"`            // 44 评论数
	TypeID           int    `json:"typeid"`             // 27 视频分区
	Play             int    `json:"play"`               // 5258 播放数
	Pic              string `json:"pic"`                // "http://i1.hdslb.com/bfs/archive/090bdea9fa9e5cacd78f50961e4db615d13cee5e.jpg" 视频封面
	Subtitle         string `json:"subtitle"`           // ""
	Description      string `json:"description"`        // "伊蕾娜生贺作品 不准骂我" 简介
	Copyright        string `json:"copyright"`          // "1" 视频版权类型
	Title            string `json:"title"`              // "我是灰之魔女伊蕾娜" 视频标题
	Review           int    `json:"review"`             // 0
	Author           string `json:"author"`             // "脆鲨12138" 视频UP主 是合作视频时不一定为目标用户
	MID              int    `json:"mid"`                // 188888131 视频UP主UID 同上
	Created          int    `json:"created"`            // 1729094460 投稿时间
	Length           string `json:"length"`             // "00:18" 视频长度	MM:SS
	VideoReview      int    `json:"video_review"`       // 2 视频弹幕数
	AID              int64  `json:"aid"`                // 113315128938366
	BVID             string `json:"bvid"`               // "BV1hxmwYDEJ6"
	HideClick        bool   `json:"hide_click"`         // false
	IsPay            int    `json:"is_pay"`             // 0
	IsUnionVideo     int    `json:"is_union_video"`     // 0 是否为合作视频
	IsSteinsGate     int    `json:"is_steins_gate"`     // 0
	IsLivePlayback   int    `json:"is_live_playback"`   // 0
	IsLessonVideo    int    `json:"is_lesson_video"`    // 0
	IsLessonFinished int    `json:"is_lesson_finished"` // 0
	LessonUpdateInfo string `json:"lesson_update_info"` // ""
	JumpURL          string `json:"jump_url"`           // ""
	Meta             any    `json:"meta"`
	IsAvoided        int    `json:"is_avoided"`        // 0
	SeasonID         int    `json:"season_id"`         // 0
	Attribute        int    `json:"attribute"`         // 16640
	IsChargingArc    bool   `json:"is_charging_arc"`   // false
	ElecArcType      int    `json:"elec_arc_type"`     // 0
	Vt               int    `json:"vt"`                // 0
	EnableVt         int    `json:"enable_vt"`         // 0
	VtDisplay        string `json:"vt_display"`        // ""
	PlaybackPosition int    `json:"playback_position"` // 0
	IsSelfView       bool   `json:"is_self_view"`      // false
}

func (ArcSearchVideo) String

func (v ArcSearchVideo) String() string

type Archive

type Archive struct {
	AID      int64  `json:"aid" gorm:"column:aid"` // 114410580345016
	Title    string `json:"title"`                 // "【直播回放】你给我进来! 2025年04月27日19点场"
	Pubdate  int    `json:"pubdate"`               // 1745780073
	Ctime    int    `json:"ctime"`                 // 1745780073
	State    int    `json:"state"`                 // 0
	Pic      string `json:"pic"`                   // "http://i2.hdslb.com/bfs/archive/f75be7f33a2b8ef29e2f80b542fc787e47695658.jpg"
	Duration int    `json:"duration"`              // 10256
	Stat     struct {
		View int `json:"view"` // 251
	} `json:"stat" gorm:"serializer:json"`
	BVID             string `json:"bvid" gorm:"column:bvid"` // "BV1ZSL6zNEoB"
	UgcPay           int    `json:"ugc_pay"`                 // 0
	InteractiveVideo bool   `json:"interactive_video"`       // false
	EnableVt         int    `json:"enable_vt"`               // 0
	VtDisplay        string `json:"vt_display"`              // ""
	PlaybackPosition int    `json:"playback_position"`       // 0
}

func (Archive) String

func (a Archive) String() string

type Article

type Article struct {
	GetWBI
	http.CookieJar

	// 目标用户 UID
	MID int `req:"query"`

	// 页码
	// 默认为 1
	Pn int `req:"query" default:"1"`

	// 每页项数
	// 默认为 30
	Ps int `req:"query" default:"30"`

	// 排序方式
	// 默认为 publish_time
	// 最新发布 publish_time
	// 最多阅读 view
	// 最多收藏 fav
	Sort string `req:"query"`
}

查询用户投稿专栏明细

func (Article) RawURL

func (Article) RawURL() string

type ArticleLists

type ArticleLists struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	MID int `req:"query"`

	// 排序方式
	// 默认为 0
	// 最近更新 0
	// 最多阅读 1
	Sort int `req:"query"`
}

查询用户专栏文集明细

func (ArticleLists) RawURL

func (ArticleLists) RawURL() string

type ArticleListsResponse

type ArticleListsResponse struct {
	Error
	Data struct {
		Lists []struct {
			ID            int    `json:"id"`             // 26407
			MID           int    `json:"mid"`            // 2859372
			Name          string `json:"name"`           // "周榜"
			ImageURL      string `json:"image_url"`      // "https://i0.hdslb.com/bfs/article/96d2b3d2a72e6497a011c885ab9245c51507ce18.png"
			UpdateTime    int    `json:"update_time"`    // 1745768376
			Ctime         int    `json:"ctime"`          // 1537942450
			PublishTime   int    `json:"publish_time"`   // 1745768458
			Summary       string `json:"summary"`        // ""
			Words         int    `json:"words"`          // 162765
			Read          int    `json:"read"`           // 55220355
			ArticlesCount int    `json:"articles_count"` // 339
			State         int    `json:"state"`          // 1
			Reason        string `json:"reason"`         // ""
			ApplyTime     string `json:"apply_time"`     // ""
			CheckTime     string `json:"check_time"`     // ""
		} `json:"lists"`
		Total int `json:"total"` // 10
	} `json:"data"`
}

func GetArticleLists

func GetArticleLists(ctx context.Context, jar http.CookieJar, uid int) (ArticleListsResponse, error)

查询用户专栏文集明细

type ArticleResponse

type ArticleResponse struct {
	Error
	Data struct {
		Articles []struct {
			ID       int `json:"id"` // 41510926
			Category struct {
				ID       int    `json:"id"`        // 15
				ParentID int    `json:"parent_id"` // 3
				Name     string `json:"name"`      // "日常"
			} `json:"category"`
			Categories []struct {
				ID       int    `json:"id"`        // 3
				ParentID int    `json:"parent_id"` // 0
				Name     string `json:"name"`      // "生活"
			} `json:"categories"`
			Title      string `json:"title"`       // "B站UP主日报2025年04月29日23点(v1.1)"
			Summary    string `json:"summary"`     // "粉丝数第3多:知识 罗翔说刑法 (3188.61万粉, +2541)昨日涨粉第1多:美食 灶台阿连 (+2.17万粉)昨日掉粉最多:游戏 阿Q君的吉拔猫 (-11376粉)昨日涨播放第3多:资讯 河南都市频道 (+1014.60万)昨日点赞数第1多:游戏 明日方舟 (+34.50万)昨日涨阅读第1多:运动 茉莉蜜糕 (+10.59万)昨日充电人次最多:美食 食贫道 (+308人)各位观众早上好,今天是2025年04月30日,农历四月初三,欢迎收看狸子每天定期更新的新人联播节目 o(∩_∩)o近期UP主宏观"
			BannerURL  string `json:"banner_url"`  // ""
			TemplateID int    `json:"template_id"` // 4
			State      int    `json:"state"`       // 0
			Author     struct {
				MID     int    `json:"mid"`  // 300021061
				Name    string `json:"name"` // "狸工智能"
				Face    string `json:"face"` // "https://i1.hdslb.com/bfs/face/4cba9bc9d6cf6935a37ec156dedb8f8d26c1df95.jpg"
				Pendant struct {
					PID    int    `json:"pid"`    // 0
					Name   string `json:"name"`   // ""
					Image  string `json:"image"`  // ""
					Expire int    `json:"expire"` // 0
				} `json:"pendant"`
				OfficialVerify struct {
					Type int    `json:"type"` // -1
					Desc string `json:"desc"` // ""
				} `json:"official_verify"`
				Nameplate struct {
					NID        int    `json:"nid"`         // 3
					Name       string `json:"name"`        // "白银殿堂"
					Image      string `json:"image"`       // "https://i2.hdslb.com/bfs/face/f6a31275029365ae5dc710006585ddcf1139bde1.png"
					ImageSmall string `json:"image_small"` // "https://i1.hdslb.com/bfs/face/b09cdb4c119c467cf2d15db5263b4f539fa6e30b.png"
					Level      string `json:"level"`       // "高级勋章"
					Condition  string `json:"condition"`   // "单个自制视频总播放数>=10万"
				} `json:"nameplate"`
				Vip struct {
					Type       int `json:"type"`         // 1
					Status     int `json:"status"`       // 0
					DueDate    int `json:"due_date"`     // 0
					VipPayType int `json:"vip_pay_type"` // 0
					ThemeType  int `json:"theme_type"`   // 0
					Label      struct {
						Path       string `json:"path"`        // ""
						Text       string `json:"text"`        // ""
						LabelTheme string `json:"label_theme"` // ""
					} `json:"label"`
					AvatarSubscript int    `json:"avatar_subscript"` // 0
					NicknameColor   string `json:"nickname_color"`   // ""
				} `json:"vip"`
			} `json:"author"`
			Reprint     int      `json:"reprint"` // 0
			ImageUrls   []string `json:"image_urls"`
			PublishTime int      `json:"publish_time"` // 1745981640
			Ctime       int      `json:"ctime"`        // 1745981640
			Mtime       int      `json:"mtime"`        // 1745981640
			Stats       struct {
				View     int `json:"view"`     // 1927
				Favorite int `json:"favorite"` // 0
				Like     int `json:"like"`     // 24
				Dislike  int `json:"dislike"`  // 0
				Reply    int `json:"reply"`    // 0
				Share    int `json:"share"`    // 0
				Coin     int `json:"coin"`     // 0
				Dynamic  int `json:"dynamic"`  // 0
			} `json:"stats"`
			Words           int      `json:"words"` // 0
			OriginImageUrls []string `json:"origin_image_urls"`
			List            any      `json:"list"`
			IsLike          bool     `json:"is_like"` // false
			Media           struct {
				Score    int    `json:"score"`     // 0
				MediaID  int    `json:"media_id"`  // 0
				Title    string `json:"title"`     // ""
				Cover    string `json:"cover"`     // ""
				Area     string `json:"area"`      // ""
				TypeID   int    `json:"type_id"`   // 0
				TypeName string `json:"type_name"` // ""
				Spoiler  int    `json:"spoiler"`   // 0
			} `json:"media"`
			ApplyTime        string `json:"apply_time"` // ""
			CheckTime        string `json:"check_time"` // ""
			Original         int    `json:"original"`   // 1
			ActID            int    `json:"act_id"`     // 0
			Dispute          any    `json:"dispute"`
			AuthenMark       any    `json:"authenMark"`
			CoverAvid        int    `json:"cover_avid"` // 0
			TopVideoInfo     any    `json:"top_video_info"`
			Type             int    `json:"type"`                 // 0
			CheckState       int    `json:"check_state"`          // 0
			OriginTemplateID int    `json:"origin_template_id"`   // 5
			Attributes       int    `json:"attributes,omitempty"` // 148
		} `json:"articles"`
		Pn    int `json:"pn"`    // 1
		Ps    int `json:"ps"`    // 30
		Count int `json:"count"` // 2489
	} `json:"data"`
}

func GetArticle

func GetArticle(ctx context.Context, jar http.CookieJar, uid int) (ArticleResponse, error)

查询用户投稿专栏明细

type BatchModify

type BatchModify struct {
	PostCSRF
	http.CookieJar
}

批量操作用户关系

func (BatchModify) RawURL

func (BatchModify) RawURL() string

type Blacks

type Blacks struct {
	req.Get
	http.CookieJar

	// 分页页数
	Pn int `req:"query" default:"1"`

	// 分页大小
	Ps int `req:"query" default:"50"`
}

查询黑名单明细

func (Blacks) RawURL

func (Blacks) RawURL() string

type BlacksResponse

type BlacksResponse struct {
	Error
	Data struct {
		List      []RelationItem `json:"list"`
		ReVersion int            `json:"re_version"` // 0
		Total     int            `json:"total"`      // 87
	} `json:"data"`
}

func GetBlacks

func GetBlacks(ctx context.Context, jar http.CookieJar) (BlacksResponse, error)

查询黑名单明细

type Cancel

type Cancel struct {
	PostCSRF
	http.CookieJar
}

取消置顶视频

func (Cancel) RawURL

func (Cancel) RawURL() string

type CancelResponse

type CancelResponse struct {
	Error
}

func PostCancel

func PostCancel(ctx context.Context, jar http.CookieJar) (CancelResponse, error)

取消置顶视频

type Card

type Card struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	MID int `req:"query"`

	// 是否请求用户主页头图
	Photo bool `req:"query"`
}

用户名片信息

func (Card) RawURL

func (Card) RawURL() string

type CardMap

type CardMap struct {
	req.Get
	http.CookieJar

	// 目标用户的 UID 列表 用(,)间隔
	// 最多200个成员
	UIDs string `req:"query"`
}

多用户详细信息字典

func (CardMap) RawURL

func (CardMap) RawURL() string

type CardMapResponse

type CardMapResponse struct {
	Error
	Data map[string]struct {
		Face       string `json:"face"`         // "https://i1.hdslb.com/bfs/face/8802d20c0c0e7f4cc232543c619da14ec5bac76d.jpg"
		FaceNft    int    `json:"face_nft"`     // 0
		FaceNftNew int    `json:"face_nft_new"` // 0
		MID        string `json:"mid"`          // "434324701"
		Name       string `json:"name"`         // "奔跑在上岸路上的小杨"
		NameRender any    `json:"name_render"`
		Nameplate  any    `json:"nameplate"`
		Official   struct {
			Desc  string `json:"desc"`  // ""
			Role  int    `json:"role"`  // 0
			Title string `json:"title"` // ""
			Type  int    `json:"type"`  // -1
		} `json:"official"`
		Pendant any `json:"pendant"`
		Vip     struct {
			AvatarIcon         any    `json:"avatar_icon"`
			AvatarSubscript    int    `json:"avatar_subscript"`     // 0
			AvatarSubscriptURL string `json:"avatar_subscript_url"` // ""
			DueDate            string `json:"due_date"`             // "0"
			Label              struct {
				BgColor               string `json:"bg_color"`                  // ""
				BgStyle               int    `json:"bg_style"`                  // 0
				BorderColor           string `json:"border_color"`              // ""
				ImgLabelURIHans       string `json:"img_label_uri_hans"`        // ""
				ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"` // "https://i0.hdslb.com/bfs/vip/d7b702ef65a976b20ed854cbd04cb9e27341bb79.png"
				ImgLabelURIHant       string `json:"img_label_uri_hant"`        // ""
				ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"` // "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/KJunwh19T5.png"
				LabelTheme            string `json:"label_theme"`               // ""
				Path                  string `json:"path"`                      // ""
				Text                  string `json:"text"`                      // ""
				TextColor             string `json:"text_color"`                // ""
				UseImgLabel           bool   `json:"use_img_label"`             // true
			} `json:"label"`
			NicknameColor string `json:"nickname_color"`  // ""
			Role          string `json:"role"`            // "0"
			Status        int    `json:"status"`          // 0
			ThemeType     int    `json:"theme_type"`      // 0
			TvDueDate     string `json:"tv_due_date"`     // "0"
			TvVipPayType  int    `json:"tv_vip_pay_type"` // 0
			TvVipStatus   int    `json:"tv_vip_status"`   // 0
			Type          int    `json:"type"`            // 0
			VipPayType    int    `json:"vip_pay_type"`    // 0
		} `json:"vip"`
	} `json:"data"`
}

func GetCardMap

func GetCardMap(ctx context.Context, jar http.CookieJar, uid []int) (CardMapResponse, error)

多用户详细信息字典

type CardResponse

type CardResponse struct {
	Error
	Data struct {
		Card struct {
			MID         string `json:"mid"`           // "208259"
			Name        string `json:"name"`          // "陈睿"
			Approve     bool   `json:"approve"`       // false
			Sex         string `json:"sex"`           // "男"
			Rank        string `json:"rank"`          // "10000"
			Face        string `json:"face"`          // "http://i2.hdslb.com/bfs/app/8920e6741fc2808cce5b81bc27abdbda291655d3.png"
			FaceNft     int    `json:"face_nft"`      // 0
			FaceNftType int    `json:"face_nft_type"` // 0
			DisplayRank string `json:"DisplayRank"`   // "0"
			Regtime     int    `json:"regtime"`       // 0
			Spacesta    int    `json:"spacesta"`      // 0
			Birthday    string `json:"birthday"`      // ""
			Place       string `json:"place"`         // ""
			Description string `json:"description"`   // ""
			Article     int    `json:"article"`       // 0
			Attentions  []any  `json:"attentions"`
			Fans        int    `json:"fans"`      // 2280857
			Friend      int    `json:"friend"`    // 528
			Attention   int    `json:"attention"` // 528
			Sign        string `json:"sign"`      // "喜欢的话就坚持吧"
			LevelInfo   struct {
				CurrentLevel int `json:"current_level"` // 6
				CurrentMin   int `json:"current_min"`   // 0
				CurrentExp   int `json:"current_exp"`   // 0
				NextExp      int `json:"next_exp"`      // 0
			} `json:"level_info"`
			Pendant struct {
				PID               int    `json:"pid"`                 // 0
				Name              string `json:"name"`                // ""
				Image             string `json:"image"`               // ""
				Expire            int    `json:"expire"`              // 0
				ImageEnhance      string `json:"image_enhance"`       // ""
				ImageEnhanceFrame string `json:"image_enhance_frame"` // ""
				NPID              int    `json:"n_pid"`               // 0
			} `json:"pendant"`
			Nameplate struct {
				NID        int    `json:"nid"`         // 0
				Name       string `json:"name"`        // ""
				Image      string `json:"image"`       // ""
				ImageSmall string `json:"image_small"` // ""
				Level      string `json:"level"`       // ""
				Condition  string `json:"condition"`   // ""
			} `json:"nameplate"`
			Official struct {
				Role  int    `json:"role"`  // 2
				Title string `json:"title"` // "bilibili董事长兼CEO"
				Desc  string `json:"desc"`  // ""
				Type  int    `json:"type"`  // 0
			} `json:"Official"`
			OfficialVerify struct {
				Type int    `json:"type"` // 0
				Desc string `json:"desc"` // "bilibili董事长兼CEO"
			} `json:"official_verify"`
			Vip struct {
				Type       int   `json:"type"`         // 2
				Status     int   `json:"status"`       // 1
				DueDate    int64 `json:"due_date"`     // 2096121600000
				VipPayType int   `json:"vip_pay_type"` // 1
				ThemeType  int   `json:"theme_type"`   // 0
				Label      struct {
					Path                  string `json:"path"`                      // ""
					Text                  string `json:"text"`                      // "十年大会员"
					LabelTheme            string `json:"label_theme"`               // "ten_annual_vip"
					TextColor             string `json:"text_color"`                // "#FFFFFF"
					BgStyle               int    `json:"bg_style"`                  // 1
					BgColor               string `json:"bg_color"`                  // "#FB7299"
					BorderColor           string `json:"border_color"`              // ""
					UseImgLabel           bool   `json:"use_img_label"`             // true
					ImgLabelURIHans       string `json:"img_label_uri_hans"`        // "https://i0.hdslb.com/bfs/activity-plat/static/20220608/e369244d0b14644f5e1a06431e22a4d5/wltavwHAkL.gif"
					ImgLabelURIHant       string `json:"img_label_uri_hant"`        // ""
					ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"` // "https://i0.hdslb.com/bfs/vip/802418ff03911645648b63aa193ba67997b5a0bc.png"
					ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"` // "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/8u7iRTPE7N.png"
				} `json:"label"`
				AvatarSubscript    int    `json:"avatar_subscript"`     // 1
				NicknameColor      string `json:"nickname_color"`       // "#FB7299"
				Role               int    `json:"role"`                 // 7
				AvatarSubscriptURL string `json:"avatar_subscript_url"` // ""
				TvVipStatus        int    `json:"tv_vip_status"`        // 1
				TvVipPayType       int    `json:"tv_vip_pay_type"`      // 0
				TvDueDate          int    `json:"tv_due_date"`          // 1873641600
				AvatarIcon         struct {
					IconType     int `json:"icon_type"` // 1
					IconResource struct {
					} `json:"icon_resource"`
				} `json:"avatar_icon"`
				VipType   int `json:"vipType"`   // 2
				VipStatus int `json:"vipStatus"` // 1
			} `json:"vip"`
			IsSeniorMember int `json:"is_senior_member"` // 0
			NameRender     any `json:"name_render"`
		} `json:"card"`
		Space struct {
			SImg string `json:"s_img"` // "http://i0.hdslb.com/bfs/space/768cc4fd97618cf589d23c2711a1d1a729f42235.png"
			LImg string `json:"l_img"` // "http://i0.hdslb.com/bfs/space/cb1c3ef50e22b6096fde67febe863494caefebad.png"
		} `json:"space"`
		Following    bool `json:"following"`     // false
		ArchiveCount int  `json:"archive_count"` // 13
		ArticleCount int  `json:"article_count"` // 0
		Follower     int  `json:"follower"`      // 2280857
		LikeNum      int  `json:"like_num"`      // 5862111
	} `json:"data"`
}

func GetCard

func GetCard(ctx context.Context, jar http.CookieJar, uid int) (CardResponse, error)

用户名片信息

type CardSlice

type CardSlice struct {
	req.Get
	http.CookieJar

	// 目标用户的 UID 列表 用(,)间隔
	// 最多 50 个成员
	UIDs string `req:"query"`
}

多用户详细信息切片

func (CardSlice) RawURL

func (CardSlice) RawURL() string

type CardSliceResponse

type CardSliceResponse struct {
	Error
	Data []struct {
		MID     int    `json:"mid"`     // 7706705
		Name    string `json:"name"`    // "阿梓从小就很可爱"
		Face    string `json:"face"`    // "https://i2.hdslb.com/bfs/face/217b2cd3d069325244f7f64ff3d75b33c71f43c8.jpg"
		Sign    string `json:"sign"`    // "虚拟艺人团体VirtuaReal成员,喜欢宅在家唱歌打游戏的梓宝! 商务合作:bd@vrp.live"
		Rank    int    `json:"rank"`    // 10000
		Level   int    `json:"level"`   // 6
		Silence int    `json:"silence"` // 0
	} `json:"data"`
}

func GetCardSlice

func GetCardSlice(ctx context.Context, jar http.CookieJar, uid []int) (CardSliceResponse, error)

多用户详细信息切片

type Coin

type Coin struct {
	req.Get
	http.CookieJar
}

获取硬币数

func (Coin) RawURL

func (Coin) RawURL() string

type CoinLog

type CoinLog struct {
	req.Get
	http.CookieJar
}

查询硬币变化情况

func (CoinLog) RawURL

func (CoinLog) RawURL() string

type CoinLogResponse

type CoinLogResponse struct {
	Error
	Data struct {
		List []struct {
			Time   string `json:"time"`
			Delta  int    `json:"delta"`
			Reason string `json:"reason"`
		} `json:"list"`
		Count int `json:"count"`
	} `json:"data"`
}

func GetCoinLog

func GetCoinLog(ctx context.Context, jar http.CookieJar) (CoinLogResponse, error)

查询硬币变化情况

type CoinResponse

type CoinResponse struct {
	Error
	Status bool `json:"status"`
	Data   struct {
		Money float64 `json:"money"`
	} `json:"data"`
}

func GetCoin

func GetCoin(ctx context.Context, jar http.CookieJar) (CoinResponse, error)

获取硬币数

type CoinVideo

type CoinVideo struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	Vmid int `req:"query"`
}

查询用户最近投币视频(Web)

func (CoinVideo) RawURL

func (CoinVideo) RawURL() string

type CoinVideoResponse

type CoinVideoResponse struct {
	Error
	Data []VideoInfo `json:"data"`
}

func GetCoinVideo

func GetCoinVideo(ctx context.Context, jar http.CookieJar, uid int) (CoinVideoResponse, error)

查询用户最近投币视频(Web)

type ConfirmRefresh

type ConfirmRefresh struct {
	PostCSRF
	http.CookieJar

	// 旧的持久化刷新口令
	RefreshToken string `req:"body"`
}

确认更新

func (ConfirmRefresh) RawURL

func (ConfirmRefresh) RawURL() string

type ConfirmRefreshResponse

type ConfirmRefreshResponse struct {
	Error
}

type Content

type Content interface {
	MsgType() MsgType
}

Content 内容接口

type ContractInfo

type ContractInfo struct {
	// 目标用户是否为对方的契约者
	IsContract bool `json:"is_contract"`

	// 是否为目标用户的契约者
	IsContractor bool `json:"is_contractor"`

	// 对方成为目标用户的契约者的时间 秒级时间戳
	// 仅当 IsContractor 项的值为 true 时才有此项
	TS int `json:"ts"`

	// 对方作为目标用户的契约者的属性
	// (1)老粉
	// 否则为原始粉丝
	UserAttr int `json:"user_attr"`
}

契约计划相关信息

type CookieInfo

type CookieInfo struct {
	req.Get
	http.CookieJar
}

检查是否需要刷新

func (CookieInfo) RawURL

func (CookieInfo) RawURL() string

type CookieInfoResponse

type CookieInfoResponse struct {
	Error
	Data struct {
		Refresh   bool  `json:"refresh"`   // true
		Timestamp int64 `json:"timestamp"` // 1734963138171
	} `json:"data"`
}

func GetCookieInfo

func GetCookieInfo(ctx context.Context, jar http.CookieJar) (CookieInfoResponse, error)

检查是否需要刷新

type CookieRefresh

type CookieRefresh struct {
	PostCSRF
	http.CookieJar

	// 实时刷新口令
	// 通过 GetRefreshCSRF 获得
	RefreshCSRF string `req:"body:refresh_csrf"`

	// 访问来源 默认值 main_web
	Source string `req:"body" default:"main_web"`

	// 持久化刷新口令
	RefreshToken string `req:"body"`
}

刷新 Cookie

func (CookieRefresh) RawURL

func (CookieRefresh) RawURL() string

type CookieRefreshResponse

type CookieRefreshResponse struct {
	Error
	Data struct {
		Status       int    `json:"status"`        // 0
		Message      string `json:"message"`       // ""
		RefreshToken string `json:"refresh_token"` // "xxx"
	} `json:"data"`
}

func PostCookieRefresh

func PostCookieRefresh(ctx context.Context, jar http.CookieJar, token string) (result CookieRefreshResponse, err error)

刷新 Cookie

type CopyUsers

type CopyUsers struct {
	PostCSRF
	http.CookieJar

	// 待复制用户 UID 用(,)间隔
	FIDs string `req:"query"`

	// 目标分组 id 列表 用(,)间隔
	TagIDs string `req:"query:tagids"`
}

复制关注到分组

func (CopyUsers) RawURL

func (CopyUsers) RawURL() string

type CopyUsersResponse

type CopyUsersResponse struct {
	Error
}

func PostCopyUsers

func PostCopyUsers(ctx context.Context, jar http.CookieJar, uid, tagid []int) (CopyUsersResponse, error)

复制关注到分组

type Correspond

type Correspond struct {
	req.Get
	http.CookieJar

	// 通过 GetCorrespondPath 获取
	CorrespondPath string
}

获取 refresh_csrf

func (Correspond) RawURL

func (c Correspond) RawURL() string

type Create

type Create struct {
	PostCSRF
	http.CookieJar

	// 分组名 最长 16 字符
	Tag string `req:"body"`
}

创建分组

func (Create) RawURL

func (Create) RawURL() string

type CreateResponse

type CreateResponse struct {
	Error
	Data struct {
		TagID int `json:"tagid"`
	} `json:"data"`
}

func PostCreate

func PostCreate(ctx context.Context, jar http.CookieJar, tag string) (CreateResponse, error)

创建分组

type Credential

type Credential struct {
	// 登录 Token
	SESSDATA string `cookie:"SESSDATA"`

	// CSRF Token
	BiliJct string `cookie:"bili_jct"`

	// 设备信息
	Buvid3 string `cookie:"buvid3"`

	// 数字型用户 UID
	DedeUserID string `cookie:"DedeUserID"`

	// 字符型用户 UID
	DedeUserIDckMd5 string `cookie:"DedeUserID__ckMd5"`

	// 持久化刷新口令,保存在浏览器 localStorage 中 ac_time_value 的值
	RefreshToken RefreshToken
}

Credential 凭据

func GetCredential

func GetCredential(ctx context.Context, qrcodeKey string) (*Credential, error)

登录成功后会自动将 Cookie 值写入返回值 *Credential 中

func (*Credential) Cookies

func (c *Credential) Cookies(*url.URL) (cookies []*http.Cookie)

func (*Credential) SetCookies

func (c *Credential) SetCookies(_ *url.URL, cookies []*http.Cookie)

type DanmuInfo

type DanmuInfo struct {
	req.Get
	http.CookieJar

	// 直播间真实 ID
	ID int `req:"query"`
}

获取信息流认证密钥

func (DanmuInfo) RawURL

func (DanmuInfo) RawURL() string

type DanmuInfoResponse

type DanmuInfoResponse struct {
	Error
	Data struct {
		Group            string  `json:"group"`              // "live"
		BusinessID       int     `json:"business_id"`        // 0
		RefreshRowFactor float64 `json:"refresh_row_factor"` // 0.125
		RefreshRate      int     `json:"refresh_rate"`       // 100
		MaxDelay         int     `json:"max_delay"`          // 5000
		Token            string  `json:"token"`              // "kCFEQiWeDA15-4KOmwu4IZ597OPNSEfHoYTGY0HOoWQEHVBKM4nGTGOWW6SLE2LJxnOKZINMCQxIExb7xkO8FIBZNs_kMflWYeojYTEV_jl9TsILOJRX1pC2kAOByp72j4WrKsc0GdvdUnxqwfnib8Ysps1Upwe2O2Db_uRSr6hVKEAAlwjifVvc"
		HostList         []struct {
			Host    string `json:"host"`     // "zj-cn-live-comet.chat.bilibili.com"
			Port    int    `json:"port"`     // 2243
			WssPort int    `json:"wss_port"` // 2245
			WsPort  int    `json:"ws_port"`  // 2244
		} `json:"host_list"`
	} `json:"data"`
}

func GetDanmuInfo

func GetDanmuInfo(ctx context.Context, jar http.CookieJar, roomid int) (DanmuInfoResponse, error)

获取信息流认证密钥

参数 roomid 为直播间真实 ID

type Del

type Del struct {
	PostCSRF
	http.CookieJar

	// 分组 id
	TagID int `req:"body:tagid"`
}

删除分组

func (Del) RawURL

func (Del) RawURL() string

type DelResponse

type DelResponse struct {
	Error
}

func PostDel

func PostDel(ctx context.Context, jar http.CookieJar, tagid int) (DelResponse, error)

删除分组

type EXPLog

type EXPLog struct {
	req.Get
	http.CookieJar

	JSONP       string `req:"query" default:"jsonp"`
	WebLocation string `req:"query" default:"333.33"`
}

最近一周的经验记录

func (EXPLog) RawURL

func (EXPLog) RawURL() string

type EXPLogResponse

type EXPLogResponse struct {
	Error
	Data struct {
		List []struct {
			Delta  int    `json:"delta"`
			Time   string `json:"time"`
			Reason string `json:"reason"`
		} `json:"list"`
		Count int `json:"count"`
	} `json:"data"`
}

func GetEXPLog

func GetEXPLog(ctx context.Context, jar http.CookieJar) (EXPLogResponse, error)

最近一周的经验记录

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	// contains filtered or unexported fields
}

Error 通用响应错误

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type FetchSessionMsgs

type FetchSessionMsgs struct {
	GetWBI
	http.CookieJar

	// 聊天对象的 ID
	TalkerID int `req:"query"`

	// 聊天对象的类型 (1)用户 (2)粉丝团
	SessionType int `req:"query"`

	// 列出消息条数
	// 最大 2000
	Size int `req:"query"`

	// 发送者设备
	SenderDeviceID int `req:"query" default:"1"`

	// 开始的序列号(开区间)
	// 默认 0 为全部
	BeginSeqno json.Number `req:"query,omitempty"`

	// 结束的序列号(开区间)
	// 默认 0 为全部
	EndSeqno json.Number `req:"query,omitempty"`
}

私信消息记录

func (FetchSessionMsgs) RawURL

func (FetchSessionMsgs) RawURL() string

type FetchSessionMsgsResponse

type FetchSessionMsgsResponse struct {
	Error
	Msg  string `json:"msg"`
	Data struct {
		Messages []Message   `json:"messages"`
		HasMore  int         `json:"has_more"`
		MinSeqno json.Number `json:"min_seqno"`
		MaxSeqno json.Number `json:"max_seqno"`
		EInfos   []struct {
			Text string `json:"text"`
			URL  string `json:"url"`
			Size int    `json:"size"`
		} `json:"e_infos"`
	} `json:"data"`
}

func GetFetchSessionMsgs

func GetFetchSessionMsgs(ctx context.Context, talkerID, sessionType, size int, beginSeqno, endSeqno string, jar http.CookieJar) (FetchSessionMsgsResponse, error)

私信消息记录

talkerID: 聊天对象的 ID

sessionType: 聊天对象的类型 (1)用户 (2)粉丝团

size: 列出消息条数 最大 2000

beginSeqno: 消息开始的序列号(开区间) 默认 0 为全部

endSeqno: 消息结束的序列号(开区间) 默认 0 为全部

type Followers

type Followers struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	Vmid int `req:"query"`

	// 分页页数 仅可查看前 1000 名粉丝
	Pn int `req:"query" default:"1"`

	// 分页大小
	Ps int `req:"query" default:"50"`
}

查询用户粉丝明细

func (Followers) RawURL

func (Followers) RawURL() string

type FollowersResponse

type FollowersResponse struct {
	Error
	Data struct {
		List      []RelationItem `json:"list"`
		ReVersion int            `json:"re_version"` // 0
		Total     int            `json:"total"`      // 1057249
	} `json:"data"`
}

func GetFollowers

func GetFollowers(ctx context.Context, jar http.CookieJar, uid int) (FollowersResponse, error)

查询用户粉丝明细

type FollowingsSearch

type FollowingsSearch struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	Vmid int `req:"query"`

	// 搜索关键词
	Name string `req:"query"`

	// 分页页数
	Pn int `req:"query" default:"1"`

	// 分页大小
	Ps int `req:"query" default:"50"`
}

搜索关注明细

func (FollowingsSearch) RawURL

func (FollowingsSearch) RawURL() string

type FollowingsSearchResponse

type FollowingsSearchResponse struct {
	Error
	Data struct {
		List  []RelationItem `json:"list"`
		Total int            `json:"total"` // 1
	} `json:"data"`
}

func GetFollowingsSearch

func GetFollowingsSearch(ctx context.Context, jar http.CookieJar, uid int, name string) (FollowingsSearchResponse, error)

搜索关注明细

type Friends

type Friends struct {
	req.Get
	http.CookieJar
}

查询互相关注明细

func (Friends) RawURL

func (Friends) RawURL() string

type FriendsResponse

type FriendsResponse struct {
	Error
	Data struct {
		List      []RelationItem `json:"list"`
		ReVersion int            `json:"re_version"` // 0
	} `json:"data"`
}

func GetFriends

func GetFriends(ctx context.Context, jar http.CookieJar) (FriendsResponse, error)

查询互相关注明细

type Generate

type Generate struct {
	req.Get
}

申请二维码

func (Generate) RawURL

func (Generate) RawURL() string

type GenerateResponse

type GenerateResponse struct {
	Error
	Data struct {
		URL       string `json:"url"`        // https://account.bilibili.com/h5/account-h5/auth/scan-web?navhide=1&callback=close&qrcode_key=52360fad71935c52ca33f4f24fd18e07&from=
		QRCodeKey string `json:"qrcode_key"` // 52360fad71935c52ca33f4f24fd18e07
	} `json:"data"`
}

func GetGenerate

func GetGenerate(ctx context.Context) (GenerateResponse, error)

申请二维码

type GetWBI

type GetWBI struct{ MixinKey }

需要添加 mixin_key 的 GET 请求

嵌入此字段后不用额外嵌入 MixinKey 字段

func (GetWBI) Method

func (GetWBI) Method() string

type HomepageCombine

type HomepageCombine struct {
	req.Get
	http.CookieJar
}

大积分中心信息

func (HomepageCombine) RawURL

func (HomepageCombine) RawURL() string

type HomepageCombineResponse

type HomepageCombineResponse struct {
	Error
	Data struct {
		VipInfo struct {
			Type       int   `json:"type"`         // 2
			Status     int   `json:"status"`       // 1
			DueDate    int64 `json:"due_date"`     // 1797264000000
			VipPayType int   `json:"vip_pay_type"` // 1
			Label      struct {
				Path                  string `json:"path"`                      // "http://i0.hdslb.com/bfs/vip/label_annual.png"
				TextColor             string `json:"text_color"`                // ""
				BgStyle               int    `json:"bg_style"`                  // 0
				BgColor               string `json:"bg_color"`                  // ""
				BorderColor           string `json:"border_color"`              // ""
				UseImgLabel           bool   `json:"use_img_label"`             // false
				ImgLabelURIHans       string `json:"img_label_uri_hans"`        // ""
				ImgLabelURIHant       string `json:"img_label_uri_hant"`        // ""
				ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"` // ""
				ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"` // ""
			} `json:"label"`
			StartTime     int `json:"start_time"`      // 1592710727
			PaidType      int `json:"paid_type"`       // 0
			MID           int `json:"mid"`             // 188888131
			Role          int `json:"role"`            // 3
			TvVipStatus   int `json:"tv_vip_status"`   // 0
			TvVipPayType  int `json:"tv_vip_pay_type"` // 0
			TvDueDate     int `json:"tv_due_date"`     // 0
			VipRecentTime int `json:"vip_recent_time"` // 1728292199
		} `json:"vip_info"`
		Content   string `json:"content"` // ""
		PointInfo struct {
			Point       int `json:"point"`        // 0
			ExpirePoint int `json:"expire_point"` // 0
			ExpireTime  int `json:"expire_time"`  // 0
			ExpireDays  int `json:"expire_days"`  // 0
		} `json:"point_info"`
		Task struct {
			TaskItem []struct {
				TaskCode      string `json:"task_code"`      // "bonus"
				State         int    `json:"state"`          // 1
				Title         string `json:"title"`          // "大会员福利大积分"
				Icon          string `json:"icon"`           // "https://i0.hdslb.com/bfs/activity-plat/static/20220607/b66bfe4ccfd6bed05bdb54008ff5c7aa/IbtMl6R3yt.png"
				Subtitle      string `json:"subtitle"`       // "大会员/年度大会员<br /><span class="active">+100/200大积分"
				Explain       string `json:"explain"`        // "在期大会员可领取100大积分,在期年度大会员可领取200大积分,每人限领1次。如当身份为大会员时已领取过本任务大积分,则后续成为年度大会员也无法补领取差值大积分。"
				VipLimit      int    `json:"vip_limit"`      // 1
				CompleteTimes int    `json:"complete_times"` // 0
				MaxTimes      int    `json:"max_times"`      // 1
				RecallNum     int    `json:"recall_num"`     // 0
				Link          string `json:"link,omitempty"` // "https://www.bilibili.com/h5/mall/home?f_source=vip&navhide=1"
			} `json:"task_item"`
			TaskCount int  `json:"task_count"` // 9
			Signed    bool `json:"signed"`     // false
			Score     int  `json:"score"`      // 5
			ExpValue  int  `json:"exp_value"`  // -1
		} `json:"task"`
		Banner        any `json:"banner"`
		GoodsCategory []struct {
			ID    int    `json:"id"`    // 110
			Name  string `json:"name"`  // "大会员"
			State int    `json:"state"` // 2
		} `json:"goods_category"`
		GoodsSkus []struct {
			Base struct {
				Token            string   `json:"token"`   // "1126774380639117732"
				Title            string   `json:"title"`   // "百草味50元礼盒直减券"
				Picture          string   `json:"picture"` // "https://i0.hdslb.com/bfs/activity-plat/9f7fe43bb6cd1692f10b9c0a2892ea63fc80041e.jpg"
				RotationPictures []string `json:"rotation_pictures"`
				Price            struct {
					Origin    int `json:"origin"` // 188
					Promotion any `json:"promotion"`
					Sale      int `json:"sale"` // 188
				} `json:"price"`
				Inventory struct {
					AvailableNum int `json:"available_num"` // 50000
					UsedNum      int `json:"used_num"`      // 44
					SurplusNum   int `json:"surplus_num"`   // 49956
				} `json:"inventory"`
				UserType          int `json:"user_type"`           // 2
				ExchangeLimitType int `json:"exchange_limit_type"` // 2
				ExchangeLimitNum  int `json:"exchange_limit_num"`  // 5
				StartTime         int `json:"start_time"`          // 1735198320
				EndTime           int `json:"end_time"`            // 1753977599
				State             int `json:"state"`               // 2
				Priority          int `json:"priority"`            // 90
			} `json:"base"`
		} `json:"goods_skus"`
		CurrentTs       int  `json:"current_ts"`       // 1735366429
		IntegrationTask bool `json:"integration_task"` // false
	} `json:"data"`
}

func GetHomepageCombine

func GetHomepageCombine(ctx context.Context, jar http.CookieJar) (HomepageCombineResponse, error)

大积分中心信息

type Image

type Image struct {
	URL      string `json:"url"`                // 图片链接 默认为相簿图片上传通道 也可用三方图床
	Width    int    `json:"width,omitempty"`    // 图片的宽	单位像素 非必要
	Height   int    `json:"height,omitempty"`   // 图片的高	单位像素 非必要
	Type     string `json:"type,omitempty"`     // 图片格式	非必要
	Original int    `json:"original,omitempty"` // 作用未知 默认值 1 非必要
	Size     int    `json:"size,omitempty"`     // 文件大小	单位千字节 非必要
}

Image 图片内容

func (Image) MsgType

func (Image) MsgType() MsgType

type LastPlayGame

type LastPlayGame struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	MID int `req:"query"`
}

查询用户最近玩过的游戏

func (LastPlayGame) RawURL

func (LastPlayGame) RawURL() string

type LastPlayGameResponse

type LastPlayGameResponse struct {
	Error
	Data struct {
		PageNum    int `json:"page_num"`    // 0
		PageSize   int `json:"page_size"`   // 15
		TotalCount int `json:"total_count"` // 1
		List       []struct {
			GameBaseID   int      `json:"game_base_id"` // 102216
			GameName     string   `json:"game_name"`    // "公主连结Re:Dive"
			GameIcon     string   `json:"game_icon"`    // "https://i0.hdslb.com/bfs/game/3bb819e010fe6d594d8f4d417ee380f40e8b5b06.png"
			Grade        float64  `json:"grade"`        // 8.5
			DetailURL    string   `json:"detail_url"`   // "https://www.biligame.com/detail/?id=102216"
			GameTags     []string `json:"game_tags"`
			Notice       string   `json:"notice"`         // "五周年庆典开启中!登录就送10000宝石!"
			GiftTitle    string   `json:"gift_title"`     // ""
			GameStatusV2 int      `json:"game_status_v2"` // 0
		} `json:"list"`
	} `json:"data"`
}

func GetLastPlayGame

func GetLastPlayGame(ctx context.Context, jar http.CookieJar, uid int) (LastPlayGameResponse, error)

查询用户最近玩过的游戏

type LikeVideo

type LikeVideo struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	Vmid int `req:"query"`
}

查询用户最近点赞视频(Web)

func (LikeVideo) RawURL

func (LikeVideo) RawURL() string

type LikeVideoResponse

type LikeVideoResponse struct {
	Error
	Data struct {
		List []VideoInfo `json:"list"`
	} `json:"data"`
}

func GetLikeVideo

func GetLikeVideo(ctx context.Context, jar http.CookieJar, uid int) (LikeVideoResponse, error)

查询用户最近点赞视频(Web)

type Live

type Live struct {
	// 开播状态
	// (0)未开播
	// (1)已开播
	LiveStatus int `json:"live_status"`

	// 直播链接
	JumpURL string `json:"jump_url"`
}

直播信息

type LoginLog

type LoginLog struct {
	req.Get
	http.CookieJar

	JSONP       string `req:"query" default:"jsonp"`
	WebLocation string `req:"query" default:"333.33"`
}

最近一周的登录情况

func (LoginLog) RawURL

func (LoginLog) RawURL() string

type LoginLogResponse

type LoginLogResponse struct {
	Error
	Data struct {
		Count int `json:"count"`
		List  []struct {
			IP     string `json:"ip"`
			Time   int    `json:"time"`
			TimeAt string `json:"time_at"`
			Status bool   `json:"status"`
			Type   int    `json:"type"`
			Geo    string `json:"geo"`
		} `json:"list"`
	} `json:"data"`
}

func GetLoginLog

func GetLoginLog(ctx context.Context, jar http.CookieJar) (LoginLogResponse, error)

最近一周的登录情况

type LoginNotice

type LoginNotice struct {
	req.Get
	http.CookieJar

	// 用户 UID(一般是自己的)
	MID int `req:"query"`

	// 设备虚拟 ID 可为空
	Buvid3 string `req:"query"`
}

查询登录记录

func (LoginNotice) RawURL

func (LoginNotice) RawURL() string

type LoginNoticeResponse

type LoginNoticeResponse struct {
	Error
	Data struct {
		MID        int    `json:"mid"`
		DeviceName string `json:"device_name"`
		LoginType  string `json:"login_type"`
		LoginTime  string `json:"login_time"`
		Location   string `json:"location"`
		IP         string `json:"ip"`
	} `json:"data"`
}

func GetLoginNotice

func GetLoginNotice(ctx context.Context, jar http.CookieJar, uid int) (LoginNoticeResponse, error)

查询登录记录

type Masterpiece

type Masterpiece struct {
	req.Get

	// 目标用户 UID
	Vmid int `req:"query"`
}

查询用户代表作视频列表

func (Masterpiece) RawURL

func (Masterpiece) RawURL() string

type MasterpieceCancel

type MasterpieceCancel struct {
	PostCSRF
	http.CookieJar

	// 取消置顶稿件 avid
	// 与 bvid 任选一个
	AID int `req:"body"`

	// 取消置顶稿件 bvid
	// 与 avid 任选一个
	BVID string `req:"body:bvid"`
}

删除代表作视频

func (MasterpieceCancel) RawURL

func (MasterpieceCancel) RawURL() string

type MasterpieceCancelResponse

type MasterpieceCancelResponse struct {
	Error
}

func PostMasterpieceCancel

func PostMasterpieceCancel(ctx context.Context, jar http.CookieJar, bvid string) (MasterpieceCancelResponse, error)

删除代表作视频

type MasterpieceResponse

type MasterpieceResponse struct {
	Error
	Data []VideoInfo `json:"data"`
}

func GetMasterpiece

func GetMasterpiece(ctx context.Context, uid int) (MasterpieceResponse, error)

查询用户代表作视频列表

type MedalWall

type MedalWall struct {
	req.Get
	http.CookieJar

	// 目标 UID
	TargetID int `req:"query"`
}

指定用户的所有粉丝勋章信息

func (MedalWall) RawURL

func (MedalWall) RawURL() string

type MedalWallResponse

type MedalWallResponse struct {
	Error
	Data struct {
		List []struct {
			MedalInfo struct {
				TargetID         int    `json:"target_id"`          // 7706705
				Level            int    `json:"level"`              // 28
				MedalName        string `json:"medal_name"`         // "小孩梓"
				MedalColorStart  int    `json:"medal_color_start"`  // 398668
				MedalColorEnd    int    `json:"medal_color_end"`    // 6850801
				MedalColorBorder int    `json:"medal_color_border"` // 6809855
				GuardLevel       int    `json:"guard_level"`        // 3
				WearingStatus    int    `json:"wearing_status"`     // 1
				MedalID          int    `json:"medal_id"`           // 13139
				Intimacy         int    `json:"intimacy"`           // 66132
				NextIntimacy     int    `json:"next_intimacy"`      // 160000
				TodayFeed        int    `json:"today_feed"`         // 0
				DayLimit         int    `json:"day_limit"`          // 250000
				GuardIcon        string `json:"guard_icon"`         // "https://i0.hdslb.com/bfs/live/143f5ec3003b4080d1b5f817a9efdca46d631945.png"
				HonorIcon        string `json:"honor_icon"`         // ""
			} `json:"medal_info"`
			TargetName string `json:"target_name"` // "阿梓从小就很可爱"
			TargetIcon string `json:"target_icon"` // "https://i2.hdslb.com/bfs/face/217b2cd3d069325244f7f64ff3d75b33c71f43c8.jpg"
			Link       string `json:"link"`        // "https://live.bilibili.com/80397?accept_quality=%5B10000%2C400%2C250%5D&av1_current_qn=0&broadcast_type=0&current_qn=10000&current_quality=10000&h264_current_qn=10000&h265_current_qn=10000&is_room_feed=1&live_from=28013&live_play_network=other&master_url=&p2p_type=-1&playurl_av1=&playurl_h264=http%3A%2F%2F123.234.3.207%2Flive-bvc%2F590881%2Flive_7706705_4063361_bluray.flv%3Fexpires%3D1735143025%26pt%3Dandroid%26deadline%3D1735143025%26len%3D0%26oi%3D1869969956%26platform%3Dandroid%26qn%3D10000%26trid%3D10000cc48f6d1b916d7f07e4c0e4be676c20%26uipk%3D100%26uipv%3D100%26nbs%3D1%26uparams%3Dcdn%2Cdeadline%2Clen%2Coi%2Cplatform%2Cqn%2Ctrid%2Cuipk%2Cuipv%2Cnbs%26cdn%3Dcn-gotcha01%26upsig%3D6e3a89585667751f71d1158bd00b653d%26site%3Df9ee5f4915d5bded29049b85ce6c4bc1%26free_type%3D0%26mid%3D188888131%26sche%3Dban%26sid%3Dcn-sdqd-cu-01-38%26chash%3D1%26bmt%3D1%26sg%3Ddf%26trace%3D4877%26isp%3Dother%26rg%3DNorthEast%26pv%3DLiaoning%26suffix%3Dbluray%26qp%3Dhv_10000%26source%3Dpuv3_batch%26sk%3D1304f646dfeb4df8b6e7ff33c167d3ad491555cae985818bb2a5ec341f048d3d%26deploy_env%3Dprod%26score%3D1%26pp%3Drtmp%26info_source%3Dcache%26hot_cdn%3D909513%26sl%3D4%26p2p_type%3D-1%26origin_bitrate%3D945259%26vd%3Dnc%26zoneid_l%3D151420932%26sid_l%3Dstream_name_cold%26src%3Dpuv3%26order%3D1&playurl_h265=http%3A%2F%2F223.111.250.61%2Flive-bvc%2F534453%2Flive_7706705_4063361_prohevc.flv%3Fexpires%3D1735143025%26pt%3Dandroid%26deadline%3D1735143025%26len%3D0%26oi%3D1869969956%26platform%3Dandroid%26qn%3D10000%26trid%3D10000cc48f6d1b916d7f07e4c0e4be676c20%26uipk%3D100%26uipv%3D100%26nbs%3D1%26uparams%3Dcdn%2Cdeadline%2Clen%2Coi%2Cplatform%2Cqn%2Ctrid%2Cuipk%2Cuipv%2Cnbs%26cdn%3Dcn-gotcha01%26upsig%3Ddf3e1ac3550756b70d49fb6468663495%26site%3Df9ee5f4915d5bded29049b85ce6c4bc1%26free_type%3D0%26mid%3D188888131%26sche%3Dban%26sid%3Dcn-jssz-cm-02-76%26chash%3D1%26bmt%3D1%26sg%3Ddf%26trace%3D13%26isp%3Dother%26rg%3DNorthEast%26pv%3DLiaoning%26pp%3Drtmp%26info_source%3Dcache%26suffix%3Dprohevc%26score%3D57%26deploy_env%3Dprod%26origin_bitrate%3D945259%26p2p_type%3D-1%26qp%3Dhv_10000%26source%3Dpuv3_batch%26sk%3D1304f646dfeb4df8b6e7ff33c167d3ad491555cae985818bb2a5ec341f048d3d%26hot_cdn%3D909513%26sl%3D4%26vd%3Dnc%26zoneid_l%3D151420932%26sid_l%3Dlive_7706705_4063361_prohevc%26src%3Dpuv3%26order%3D1&quality_description=%5B%7B%22qn%22%3A10000%2C%22desc%22%3A%22%E5%8E%9F%E7%94%BB%22%2C%22hdr_type%22%3A0%7D%2C%7B%22qn%22%3A400%2C%22desc%22%3A%22%E8%93%9D%E5%85%89%22%2C%22hdr_type%22%3A0%7D%2C%7B%22qn%22%3A250%2C%22desc%22%3A%22%E8%B6%85%E6%B8%85%22%2C%22hdr_type%22%3A0%7D%5D"
			LiveStatus int    `json:"live_status"` // 1
			Official   int    `json:"official"`    // 1
			UinfoMedal struct {
				Name               string `json:"name"`                  // "小孩梓"
				Level              int    `json:"level"`                 // 28
				ColorStart         int    `json:"color_start"`           // 398668
				ColorEnd           int    `json:"color_end"`             // 6850801
				ColorBorder        int    `json:"color_border"`          // 6809855
				Color              int    `json:"color"`                 // 0
				ID                 int    `json:"id"`                    // 13139
				Typ                int    `json:"typ"`                   // 0
				IsLight            int    `json:"is_light"`              // 1
				RUID               int    `json:"ruid"`                  // 7706705
				GuardLevel         int    `json:"guard_level"`           // 3
				Score              int    `json:"score"`                 // 0
				GuardIcon          string `json:"guard_icon"`            // "https://i0.hdslb.com/bfs/live/143f5ec3003b4080d1b5f817a9efdca46d631945.png"
				HonorIcon          string `json:"honor_icon"`            // ""
				V2MedalColorStart  string `json:"v2_medal_color_start"`  // "#4775EFCC"
				V2MedalColorEnd    string `json:"v2_medal_color_end"`    // "#4775EFCC"
				V2MedalColorBorder string `json:"v2_medal_color_border"` // "#58A1F8FF"
				V2MedalColorText   string `json:"v2_medal_color_text"`   // "#FFFFFFFF"
				V2MedalColorLevel  string `json:"v2_medal_color_level"`  // "#000B7099"
				UserReceiveCount   int    `json:"user_receive_count"`    // 0
			} `json:"uinfo_medal"`
		} `json:"list"`
		Count           int    `json:"count"`             // 1
		CloseSpaceMedal int    `json:"close_space_medal"` // 0
		OnlyShowWearing int    `json:"only_show_wearing"` // 1
		Name            string `json:"name"`              // "七海Nana7mi"
		Icon            string `json:"icon"`              // "https://i2.hdslb.com/bfs/face/3adb26401cfab0fe6b1a0d5b2c09220499108d64.jpg"
		UID             int    `json:"uid"`               // 188888131 (编者著:神金啊怎么返回的是查询者的 UID)
		Level           int    `json:"level"`             // 6
	} `json:"data"`
}

func GetMedalWall

func GetMedalWall(ctx context.Context, jar http.CookieJar, uid int) (MedalWallResponse, error)

指定用户的所有粉丝勋章信息

type Message

type Message struct {
	SenderUID      int         `json:"sender_uid"`
	ReceiverType   int         `json:"receiver_type"`
	ReceiverID     int         `json:"receiver_id"`
	MsgType        int         `json:"msg_type"`
	Content        string      `json:"content"`
	MsgSeqno       json.Number `json:"msg_seqno"`
	Timestamp      int         `json:"timestamp"`
	AtUIDs         []int       `json:"at_uids" gorm:"serializer:json"`
	MsgKey         int64       `json:"msg_key"`
	MsgStatus      int         `json:"msg_status"`
	NotifyCode     string      `json:"notify_code"`
	NewFaceVersion int         `json:"new_face_version,omitempty"`
}

func (Message) String

func (m Message) String() string

type MixinKey

type MixinKey struct{}

对于需要添加 mixin_key 的接口 只需要将 MixinKey 嵌入结构体即可

func (MixinKey) Query

func (MixinKey) Query(r *http.Request, value reflect.Value, query []reflect.StructField) (err error)

type MoralLog

type MoralLog struct {
	req.Get
	http.CookieJar

	JSONP       string `req:"query" default:"jsonp"`
	WebLocation string `req:"query" default:"333.33"`
}

最近一周的节操记录

func (MoralLog) RawURL

func (MoralLog) RawURL() string

type MoralLogResponse

type MoralLogResponse struct {
	Error
	Data struct {
		Moral int           `json:"moral"`
		List  []interface{} `json:"list"`
		Count int           `json:"count"`
	} `json:"data"`
}

func GetMoralLog

func GetMoralLog(ctx context.Context, jar http.CookieJar) (MoralLogResponse, error)

最近一周的节操记录

type MoveUsers

type MoveUsers struct {
	PostCSRF
	http.CookieJar

	// 原分组 id 列表 用(,)间隔
	BeforeTagIDs string `req:"body:beforeTagids"`

	// 新分组 id 列表 用(,)间隔
	AfterTagIDs string `req:"body:afterTagids"`

	// 待移动用户 UID 用(,)间隔
	FIDs string `req:"query"`
}

移动关注到分组

func (MoveUsers) RawURL

func (MoveUsers) RawURL() string

type MoveUsersResponse

type MoveUsersResponse struct {
	Error
}

func PostMoveUsers

func PostMoveUsers(ctx context.Context, jar http.CookieJar, uid, beforeTagid, afterTagid []int) (MoveUsersResponse, error)

移动关注到分组

type MsgType

type MsgType int

MsgType 表示消息类型的整数

type My

type My struct {
	req.Get
	http.CookieJar
}

卡券状态查询

func (My) RawURL

func (My) RawURL() string

type MyInfo

type MyInfo struct {
	req.Get
	http.CookieJar
}

登录用户空间详细信息

func (MyInfo) RawURL

func (MyInfo) RawURL() string

type MyInfoResponse

type MyInfoResponse struct {
	Error
	Data struct {
		MID            int    `json:"mid"`            // 188888131
		Name           string `json:"name"`           // "脆鲨12138"
		Sex            string `json:"sex"`            // "女"
		Face           string `json:"face"`           // "https://i1.hdslb.com/bfs/face/86faab4844dd2c45870fdafa8f2c9ce7be3e999f.jpg"
		Sign           string `json:"sign"`           // "虚拟艺人团体Vcslive成员,喜欢宅在家打游戏的脆鲨12138!!!"
		Rank           int    `json:"rank"`           // 10000
		Level          int    `json:"level"`          // 6
		Jointime       int    `json:"jointime"`       // 0
		Moral          int    `json:"moral"`          // 70
		Silence        int    `json:"silence"`        // 0
		EmailStatus    int    `json:"email_status"`   // 0
		TelStatus      int    `json:"tel_status"`     // 1
		Identification int    `json:"identification"` // 1
		Vip            struct {
			Type       int   `json:"type"`         // 2
			Status     int   `json:"status"`       // 1
			DueDate    int64 `json:"due_date"`     // 1797264000000
			VipPayType int   `json:"vip_pay_type"` // 1
			ThemeType  int   `json:"theme_type"`   // 0
			Label      struct {
				Path                  string `json:"path"`                      // ""
				Text                  string `json:"text"`                      // "年度大会员"
				LabelTheme            string `json:"label_theme"`               // "annual_vip"
				TextColor             string `json:"text_color"`                // "#FFFFFF"
				BgStyle               int    `json:"bg_style"`                  // 1
				BgColor               string `json:"bg_color"`                  // "#FB7299"
				BorderColor           string `json:"border_color"`              // ""
				UseImgLabel           bool   `json:"use_img_label"`             // true
				ImgLabelURIHans       string `json:"img_label_uri_hans"`        // ""
				ImgLabelURIHant       string `json:"img_label_uri_hant"`        // ""
				ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"` // "https://i0.hdslb.com/bfs/vip/8d4f8bfc713826a5412a0a27eaaac4d6b9ede1d9.png"
				ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"` // "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/VEW8fCC0hg.png"
			} `json:"label"`
			AvatarSubscript    int    `json:"avatar_subscript"`     // 1
			NicknameColor      string `json:"nickname_color"`       // "#FB7299"
			Role               int    `json:"role"`                 // 3
			AvatarSubscriptURL string `json:"avatar_subscript_url"` // ""
			TvVipStatus        int    `json:"tv_vip_status"`        // 0
			TvVipPayType       int    `json:"tv_vip_pay_type"`      // 0
			TvDueDate          int    `json:"tv_due_date"`          // 0
			AvatarIcon         struct {
				IconType     int `json:"icon_type"` // 1
				IconResource struct {
				} `json:"icon_resource"`
			} `json:"avatar_icon"`
		} `json:"vip"`
		Pendant struct {
			PID               int    `json:"pid"`                 // 4820
			Name              string `json:"name"`                // "七海演唱会"
			Image             string `json:"image"`               // "https://i1.hdslb.com/bfs/garb/item/7061b098537482bb78242a16cba5d44b426b429d.png"
			Expire            int    `json:"expire"`              // 0
			ImageEnhance      string `json:"image_enhance"`       // "https://i1.hdslb.com/bfs/garb/item/7061b098537482bb78242a16cba5d44b426b429d.png"
			ImageEnhanceFrame string `json:"image_enhance_frame"` // ""
			NPID              int    `json:"n_pid"`               // 4820
		} `json:"pendant"`
		Nameplate struct {
			NID        int    `json:"nid"`         // 62
			Name       string `json:"name"`        // "有爱大佬"
			Image      string `json:"image"`       // "https://i0.hdslb.com/bfs/face/a10ee6b613e0d68d2dfdac8bbf71b94824e10408.png"
			ImageSmall string `json:"image_small"` // "https://i0.hdslb.com/bfs/face/54f4c31ab9b1f1fa2c29dbbc967f66535699337e.png"
			Level      string `json:"level"`       // "普通勋章"
			Condition  string `json:"condition"`   // "当前持有粉丝勋章最高等级>=15级"
		} `json:"nameplate"`
		Official struct {
			Role  int    `json:"role"`  // 0
			Title string `json:"title"` // ""
			Desc  string `json:"desc"`  // ""
			Type  int    `json:"type"`  // -1
		} `json:"official"`
		Birthday      int  `json:"birthday"`
		IsTourist     int  `json:"is_tourist"`      // 0
		IsFakeAccount int  `json:"is_fake_account"` // 0
		PinPrompting  int  `json:"pin_prompting"`   // 0
		IsDeleted     int  `json:"is_deleted"`      // 0
		InRegAudit    int  `json:"in_reg_audit"`    // 0
		IsRipUser     bool `json:"is_rip_user"`     // false
		Profession    struct {
			ID              int    `json:"id"`               // 0
			Name            string `json:"name"`             // ""
			ShowName        string `json:"show_name"`        // ""
			IsShow          int    `json:"is_show"`          // 0
			CategoryOne     string `json:"category_one"`     // ""
			Realname        string `json:"realname"`         // ""
			Title           string `json:"title"`            // ""
			Department      string `json:"department"`       // ""
			CertificateNo   string `json:"certificate_no"`   // ""
			CertificateShow bool   `json:"certificate_show"` // false
		} `json:"profession"`
		FaceNft        int `json:"face_nft"`         // 0
		FaceNftNew     int `json:"face_nft_new"`     // 0
		IsSeniorMember int `json:"is_senior_member"` // 0
		Honours        struct {
			MID    int `json:"mid"` // 188888131
			Colour struct {
				Dark   string `json:"dark"`   // "#CE8620"
				Normal string `json:"normal"` // "#F0900B"
			} `json:"colour"`
			Tags              any `json:"tags"`
			IsLatest100Honour int `json:"is_latest_100honour"` // 0
		} `json:"honours"`
		DigitalID   string `json:"digital_id"`   // ""
		DigitalType int    `json:"digital_type"` // -2
		Attestation struct {
			Type       int `json:"type"` // 0
			CommonInfo struct {
				Title       string `json:"title"`        // ""
				Prefix      string `json:"prefix"`       // ""
				PrefixTitle string `json:"prefix_title"` // ""
			} `json:"common_info"`
			SpliceInfo struct {
				Title string `json:"title"` // ""
			} `json:"splice_info"`
			Icon string `json:"icon"` // ""
			Desc string `json:"desc"` // ""
		} `json:"attestation"`
		ExpertInfo struct {
			Title string `json:"title"` // ""
			State int    `json:"state"` // 0
			Type  int    `json:"type"`  // 0
			Desc  string `json:"desc"`  // ""
		} `json:"expert_info"`
		NameRender  any    `json:"name_render"`
		CountryCode string `json:"country_code"` // "86"
		LevelExp    struct {
			CurrentLevel int   `json:"current_level"` // 6
			CurrentMin   int   `json:"current_min"`   // 28800
			CurrentExp   int   `json:"current_exp"`   // 48539
			NextExp      int   `json:"next_exp"`      // -1
			LevelUp      int64 `json:"level_up"`      // -62135596800
		} `json:"level_exp"`
		Coins     float64 `json:"coins"`     // 1547.8
		Following int     `json:"following"` // 6601
		Follower  int     `json:"follower"`  // 6601
	} `json:"data"`
}

func GetMyInfo

func GetMyInfo(ctx context.Context, jar http.CookieJar) (MyInfoResponse, error)

登录用户空间详细信息

type MyResponse

type MyResponse struct {
	Error
	Data struct {
		List []struct {
			Type            int    `json:"type"`              // 1
			State           int    `json:"state"`             // 0
			ExpireTime      int    `json:"expire_time"`       // 0
			VipType         int    `json:"vip_type"`          // 2
			NextReceiveDays int    `json:"next_receive_days"` // 21
			PeriodEndUnix   int    `json:"period_end_unix"`   // 1737129600
			IsCount         bool   `json:"is_count"`          // true
			Name            string `json:"name"`              // ""
			CouponCode      string `json:"coupon_code"`       // ""
			AppDescribe     string `json:"app_describe"`      // ""
			ReciveState     int    `json:"recive_state"`      // 1
			SalaryType      int    `json:"salary_type"`       // 0
			ExpParams       struct {
				ExpGroupTag string `json:"exp_group_tag"` // "45476"
				HitValue    int    `json:"hit_value"`     // 2
			} `json:"exp_params"`
			ExtraParams any `json:"extra_params"`
		} `json:"list"`
		IsShortVip     bool   `json:"is_short_vip"`     // false
		IsFreightOpen  bool   `json:"is_freight_open"`  // true
		Level          int    `json:"level"`            // 6
		CurExp         int    `json:"cur_exp"`          // 48579
		NextExp        int    `json:"next_exp"`         // -1
		IsVip          bool   `json:"is_vip"`           // true
		IsSeniorMember int    `json:"is_senior_member"` // 0
		Format060102   int    `json:"format060102"`     // 241218
		IsOverdueVip   bool   `json:"is_overdue_vip"`   // false
		VipStatus      int    `json:"vip_status"`       // 1
		VipType        int    `json:"vip_type"`         // 2
		KeeptimeEnd    int    `json:"keeptime_end"`     // 1737129600
		VipDueDate     int    `json:"vip_due_date"`     // 1797264000
		VipIsAnnual    bool   `json:"vip_is_annual"`    // true
		VipIsMonth     bool   `json:"vip_is_month"`     // false
		VipIsNewUser   bool   `json:"vip_is_new_user"`  // false
		BindPhone      string `json:"bind_phone"`
		TaobaoAccount  any    `json:"taobao_account"`
	} `json:"data"`
}

func GetMy

func GetMy(ctx context.Context, jar http.CookieJar) (MyResponse, error)

卡券状态查询

type Nav struct {
	req.Get
	http.CookieJar
}

导航栏用户信息

func (Nav) RawURL() string
type NavNum struct {
	req.Get

	// 目标用户 UID
	MID int `req:"query"`
}

用户导航栏状态数

但是不知道为什么被禁止访问了

错误号:412 由于触发哔哩哔哩安全风控策略,该次访问请求被拒绝。 The request was rejected because of the bilibili security control policy.

func (NavNum) RawURL() string
type NavResponse struct {
	Error
	Data struct {
		IsLogin       bool   `json:"isLogin"` // false
		EmailVerified int    `json:"email_verified"`
		Face          string `json:"face"`
		FaceNft       int    `json:"face_nft"`
		FaceNftType   int    `json:"face_nft_type"`
		LevelInfo     struct {
			CurrentLevel int    `json:"current_level"`
			CurrentMin   int    `json:"current_min"`
			CurrentExp   int    `json:"current_exp"`
			NextExp      string `json:"next_exp"`
		} `json:"level_info"`
		MID            int     `json:"mid"`
		MobileVerified int     `json:"mobile_verified"`
		Money          float64 `json:"money"`
		Moral          int     `json:"moral"`
		Official       struct {
			Role  int    `json:"role"`
			Title string `json:"title"`
			Desc  string `json:"desc"`
			Type  int    `json:"type"`
		} `json:"official"`
		OfficialVerify struct {
			Type int    `json:"type"`
			Desc string `json:"desc"`
		} `json:"officialVerify"`
		Pendant struct {
			PID               int    `json:"pid"`
			Name              string `json:"name"`
			Image             string `json:"image"`
			Expire            int    `json:"expire"`
			ImageEnhance      string `json:"image_enhance"`
			ImageEnhanceFrame string `json:"image_enhance_frame"`
			NPID              int    `json:"n_pid"`
		} `json:"pendant"`
		Scores       int    `json:"scores"`
		Uname        string `json:"uname"`
		VipDueDate   int64  `json:"vipDueDate"`
		VipStatus    int    `json:"vipStatus"`
		VipType      int    `json:"vipType"`
		VipPayType   int    `json:"vip_pay_type"`
		VipThemeType int    `json:"vip_theme_type"`
		VipLabel     struct {
			Path                  string `json:"path"`
			Text                  string `json:"text"`
			LabelTheme            string `json:"label_theme"`
			TextColor             string `json:"text_color"`
			BgStyle               int    `json:"bg_style"`
			BgColor               string `json:"bg_color"`
			BorderColor           string `json:"border_color"`
			UseImgLabel           bool   `json:"use_img_label"`
			ImgLabelURIHans       string `json:"img_label_uri_hans"`
			ImgLabelURIHant       string `json:"img_label_uri_hant"`
			ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"`
			ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"`
		} `json:"vip_label"`
		VipAvatarSubscript int    `json:"vip_avatar_subscript"`
		VipNicknameColor   string `json:"vip_nickname_color"`
		Vip                struct {
			Type       int   `json:"type"`
			Status     int   `json:"status"`
			DueDate    int64 `json:"due_date"`
			VipPayType int   `json:"vip_pay_type"`
			ThemeType  int   `json:"theme_type"`
			Label      struct {
				Path                  string `json:"path"`
				Text                  string `json:"text"`
				LabelTheme            string `json:"label_theme"`
				TextColor             string `json:"text_color"`
				BgStyle               int    `json:"bg_style"`
				BgColor               string `json:"bg_color"`
				BorderColor           string `json:"border_color"`
				UseImgLabel           bool   `json:"use_img_label"`
				ImgLabelURIHans       string `json:"img_label_uri_hans"`
				ImgLabelURIHant       string `json:"img_label_uri_hant"`
				ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"`
				ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"`
			} `json:"label"`
			AvatarSubscript    int    `json:"avatar_subscript"`
			NicknameColor      string `json:"nickname_color"`
			Role               int    `json:"role"`
			AvatarSubscriptURL string `json:"avatar_subscript_url"`
			TvVipStatus        int    `json:"tv_vip_status"`
			TvVipPayType       int    `json:"tv_vip_pay_type"`
			TvDueDate          int    `json:"tv_due_date"`
			AvatarIcon         struct {
				IconType     int `json:"icon_type"`
				IconResource struct {
				} `json:"icon_resource"`
			} `json:"avatar_icon"`
		} `json:"vip"`
		Wallet struct {
			MID           int `json:"mid"`
			BcoinBalance  int `json:"bcoin_balance"`
			CouponBalance int `json:"coupon_balance"`
			CouponDueTime int `json:"coupon_due_time"`
		} `json:"wallet"`
		HasShop        bool   `json:"has_shop"`
		ShopURL        string `json:"shop_url"`
		AllowanceCount int    `json:"allowance_count"`
		AnswerStatus   int    `json:"answer_status"`
		IsSeniorMember int    `json:"is_senior_member"`
		WbiImg         struct {
			ImgURL string `json:"img_url"` // https://i0.hdslb.com/bfs/wbi/7cd084941338484aae1ad9425b84077c.png
			SubURL string `json:"sub_url"` // https://i0.hdslb.com/bfs/wbi/4932caff0ff746eab6f01bf08b70ac45.png
		} `json:"wbi_img"`
		IsJury     bool        `json:"is_jury"`
		NameRender interface{} `json:"name_render"`
	} `json:"data"`
}

完整返回值结构

type NavResponseSimple struct {
	Error
	Data struct {
		IsLogin bool `json:"isLogin"` // false
		WbiImg  struct {
			ImgURL string `json:"img_url"` // https://i0.hdslb.com/bfs/wbi/7cd084941338484aae1ad9425b84077c.png
			SubURL string `json:"sub_url"` // https://i0.hdslb.com/bfs/wbi/4932caff0ff746eab6f01bf08b70ac45.png
		} `json:"wbi_img"`
	} `json:"data"`
}

未登录返回值结构

func GetNav

导航栏用户信息

type NavStat struct {
	req.Get
	http.CookieJar
}

登录用户状态数

func (NavStat) RawURL() string
type NavStatResponse struct {
	Error
	Data struct {
		Following    int `json:"following"`
		Follower     int `json:"follower"`
		DynamicCount int `json:"dynamic_count"`
	} `json:"data"`
}

func GetNavStat

func GetNavStat(ctx context.Context, jar http.CookieJar) (NavStatResponse, error)

登录用户状态数

type Notice

type Notice struct {
	req.Get

	// 用户 UID
	MID int `req:"query"`
}

查看用户空间公告

func (Notice) RawURL

func (Notice) RawURL() string

type NoticeResponse

type NoticeResponse struct {
	Error
	Data string `json:"data"` // "新浪微博:七海Nana7mi"
}

func GetNotice

func GetNotice(ctx context.Context, uid int) (NoticeResponse, error)

查看用户空间公告

type NoticeSet

type NoticeSet struct {
	PostCSRF
	http.CookieJar

	// 要设置的公告内容
	Notice string `req:"body"`
}

修改空间公告

func (NoticeSet) RawURL

func (NoticeSet) RawURL() string

type NoticeSetResponse

type NoticeSetResponse struct {
	Error
}

func PostNoticeSet

func PostNoticeSet(ctx context.Context, jar http.CookieJar, notice string) (NoticeSetResponse, error)

修改空间公告

type Now

type Now struct {
	req.Get
}

获取当前时间戳

func (Now) RawURL

func (Now) RawURL() string

type NowResponse

type NowResponse struct {
	Error
	Data struct {
		Now int `json:"now"` // 1735223842
	} `json:"data"`
}

func GetNow

func GetNow(ctx context.Context) (NowResponse, error)

获取当前时间戳

type OfficialVerify

type OfficialVerify struct {
	// 用户认证类型
	// (-1)无
	// (0)UP 主认证
	// (1)机构认证
	Type int `json:"type"`

	// 用户认证信息
	Desc string `json:"desc"`
}

认证信息

type Poll

type Poll struct {
	req.Get
	http.CookieJar

	// 先前生成的二维码密钥
	QRCodeKey string `req:"query:qrcode_key"`
}

扫码登录

登录成功后会自动将 Cookie 值写入该结构体的 *Credential 字段中

func (Poll) RawURL

func (Poll) RawURL() string

type PollResponse

type PollResponse struct {
	Error
	Data struct {
		Error
		URL          string `json:"url"`
		RefreshToken string `json:"refresh_token"`
		Timestamp    int    `json:"timestamp"`
	} `json:"data"`
}

func GetPoll

func GetPoll(ctx context.Context, jar http.CookieJar, qrcodeKey string) (PollResponse, error)

登录成功后会自动将 Cookie 值写入 credential 变量中

func (PollResponse) Unwrap

func (r PollResponse) Unwrap() error

type PostCSRF

type PostCSRF struct {
	ContentType string `req:"header" default:"application/x-www-form-urlencoded"`
}

func (PostCSRF) Body

func (PostCSRF) Body(r *http.Request, value reflect.Value, body []reflect.StructField) (_ io.Reader, err error)

func (PostCSRF) Method

func (PostCSRF) Method() string

type QueryRelation

type QueryRelation struct {
	// 目标用户 UID
	MID int `json:"mid"`

	// 关系属性
	// (0)未关注
	// (2)已关注
	// (6)已互粉
	// (128)已拉黑
	Attribute int `json:"attribute"`

	// 关注对方时间 秒级时间戳
	Mtime int `json:"mtime"`

	// 分组 id
	Tag []int `json:"tag"`

	// 特别关注标志
	// (0)否
	// (1)是
	Special int `json:"special"`
}

查询关系属性

type RealnameStatus

type RealnameStatus struct {
	req.Get
	http.CookieJar
}

查询账号实名认证状态

func (RealnameStatus) RawURL

func (RealnameStatus) RawURL() string

type RealnameStatusResponse

type RealnameStatusResponse struct {
	Error
	Data struct {
		Status int `json:"status"`
	} `json:"data"`
}

func GetRealnameStatus

func GetRealnameStatus(ctx context.Context, jar http.CookieJar) (RealnameStatusResponse, error)

查询账号实名认证状态

type RefreshToken

type RefreshToken string

RefreshToken 保存在浏览器本地储存 ac_time_value 中的口令

func (*RefreshToken) IsValid

func (*RefreshToken) IsValid(ctx context.Context, jar http.CookieJar) (bool, error)

func (*RefreshToken) Refresh

func (r *RefreshToken) Refresh(ctx context.Context, jar http.CookieJar) error

type Relation

type Relation struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	FID int `req:"query"`
}

查询用户与自己关系(仅关注)

func (Relation) RawURL

func (Relation) RawURL() string

type RelationFollowings

type RelationFollowings struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	Vmid int `req:"query"`

	// 排序方式 当目标用户为自己时有效
	// ("")按照关注顺序排列
	// ("attention")按照最常访问排列
	OrderType string `req:"query,omitempty"`

	// 分页页数
	Pn int `req:"query" default:"1"`

	// 分页大小
	Ps int `req:"query" default:"50"`
}

查询用户关注明细

func (RelationFollowings) RawURL

func (RelationFollowings) RawURL() string

type RelationFollowingsResponse

type RelationFollowingsResponse struct {
	Error
	Data struct {
		List      []RelationItem `json:"list"`
		ReVersion int            `json:"re_version"` // 0
		Total     int            `json:"total"`      // 207
	} `json:"data"`
}

func GetRelationFollowings

func GetRelationFollowings(ctx context.Context, jar http.CookieJar, uid int) (RelationFollowingsResponse, error)

查询用户关注明细

type RelationItem

type RelationItem struct {
	// 用户 UID
	MID int64 `json:"mid"`

	// 对方对于自己的关系属性
	// (0)未关注
	// (1)悄悄关注(现已下线)
	// (2)已关注
	// (6)已互粉
	// (128)已拉黑
	Attribute int `json:"attribute"`

	// 对方关注目标用户时间
	// 秒级时间戳 互关后刷新
	Mtime int `json:"mtime"`

	// 目标用户将对方分组到的 id
	Tag []int `json:"tag"`

	// 特别关注标志
	// (0)否
	// (1)是
	Special int `json:"special"`

	// 契约计划相关信息
	ContractInfo ContractInfo `json:"contract_info"`

	// 用户昵称
	Uname string `json:"uname"`

	// 用户头像 URL
	Face string `json:"face"`

	// 用户签名
	Sign string `json:"sign"`

	// 是否为 NFT 头像
	// (0)非 NFT 头像
	// (1)是 NFT 头像
	FaceNFT int `json:"face_nft"`

	// 认证信息
	OfficialVerify OfficialVerify `json:"official_verify"`

	// 会员信息
	VIP VIP `json:"vip"`

	// 直播信息
	Live Live `json:"live"`

	NameRender struct {
	} `json:"name_render"`
	NFTIcon    string `json:"nft_icon"`
	RecReason  string `json:"rec_reason"`
	TrackID    string `json:"track_id"`
	FollowTime string `json:"follow_time"`
}

关系列表对象

func (RelationItem) String

func (r RelationItem) String() string

type RelationModify

type RelationModify struct {
	PostCSRF
	http.CookieJar
}

操作用户关系

func (RelationModify) RawURL

func (RelationModify) RawURL() string

type RelationResponse

type RelationResponse struct {
	Error
	Data QueryRelation `json:"data"`
}

func GetRelation

func GetRelation(ctx context.Context, jar http.CookieJar, uid int) (RelationResponse, error)

查询用户与自己关系(仅关注)

type RelationStat

type RelationStat struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	Vmid int `req:"query"`
}

关系状态数

func (RelationStat) RawURL

func (RelationStat) RawURL() string

type RelationStatResponse

type RelationStatResponse struct {
	Error
	Data struct {
		MID       int `json:"mid"`       // 434334701
		Following int `json:"following"` // 592
		Whisper   int `json:"whisper"`   // 0
		Black     int `json:"black"`     // 0
		Follower  int `json:"follower"`  // 1057173
	} `json:"data"`
}

func GetRelationStat

func GetRelationStat(ctx context.Context, jar http.CookieJar, uid int) (RelationStatResponse, error)

关系状态数

type Relations

type Relations struct {
	req.Get
	http.CookieJar

	// 目标用户 UID 用(,)间隔
	FIDs string `req:"query"`
}

批量查询用户与自己关系

func (Relations) RawURL

func (Relations) RawURL() string

type RelationsResponse

type RelationsResponse struct {
	Error
	Data map[string]QueryRelation `json:"data"`
}

func GetRelations

func GetRelations(ctx context.Context, jar http.CookieJar, uid []int) (RelationsResponse, error)

批量查询用户与自己关系

type Reward

type Reward struct {
	req.Get
	http.CookieJar
}

查询每日奖励状态

func (Reward) RawURL

func (Reward) RawURL() string

type RewardResponse

type RewardResponse struct {
	Error
	Data struct {
		Login        bool `json:"login"`
		Watch        bool `json:"watch"`
		Coins        int  `json:"coins"`
		Share        bool `json:"share"`
		Email        bool `json:"email"`
		Tel          bool `json:"tel"`
		SafeQuestion bool `json:"safe_question"`
		IdentifyCard bool `json:"identify_card"`
	} `json:"data"`
}

func GetReward

func GetReward(ctx context.Context, jar http.CookieJar) (RewardResponse, error)

查询每日奖励状态

type RoomInfo

type RoomInfo struct {
	req.Get

	// 直播间号	可以为短号
	RoomID int `req:"query"`
}

获取直播间信息

func (RoomInfo) RawURL

func (RoomInfo) RawURL() string

type RoomInfoResponse

type RoomInfoResponse struct {
	Error
	Msg  string `json:"msg"` // "ok"
	Data struct {
		UID              int      `json:"uid"`         // 434334701
		RoomID           int      `json:"room_id"`     // 21452505
		ShortID          int      `json:"short_id"`    // 0
		Attention        int      `json:"attention"`   // 1057100
		Online           int      `json:"online"`      // 0
		IsPortrait       bool     `json:"is_portrait"` // false
		Description      string   `json:"description"`
		LiveStatus       int      `json:"live_status"`        // 0
		AreaID           int      `json:"area_id"`            // 745
		ParentAreaID     int      `json:"parent_area_id"`     // 9
		ParentAreaName   string   `json:"parent_area_name"`   // "虚拟主播"
		OldAreaID        int      `json:"old_area_id"`        // 6
		Background       string   `json:"background"`         // "https://i0.hdslb.com/bfs/live/636d66a97d5f55099a9d8d6813558d6d4c95fd61.jpg"
		Title            string   `json:"title"`              // "看看大家的24年最值购物"
		UserCover        string   `json:"user_cover"`         // "https://i0.hdslb.com/bfs/live/new_room_cover/ef9375fd23aefb03e3c2fd48934fa51a30caacbc.jpg"
		Keyframe         string   `json:"keyframe"`           // ""
		IsStrictRoom     bool     `json:"is_strict_room"`     // false
		LiveTime         string   `json:"live_time"`          // "0000-00-00 00:00:00"
		Tags             string   `json:"tags"`               // "七海,海子姐,VirtuaReal"
		IsAnchor         int      `json:"is_anchor"`          // 0
		RoomSilentType   string   `json:"room_silent_type"`   // ""
		RoomSilentLevel  int      `json:"room_silent_level"`  // 0
		RoomSilentSecond int      `json:"room_silent_second"` // 0
		AreaName         string   `json:"area_name"`          // "虚拟Gamer"
		Pendants         string   `json:"pendants"`           // ""
		AreaPendants     string   `json:"area_pendants"`      // ""
		HotWords         []string `json:"hot_words"`
		HotWordsStatus   int      `json:"hot_words_status"` // 0
		Verify           string   `json:"verify"`           // ""
		NewPendants      struct {
			Frame struct {
				Name       string `json:"name"`         // "长红计划-Topstar"
				Value      string `json:"value"`        // "https://i0.hdslb.com/bfs/live/62e62f657d379aaaec2bbd4a6a16a938bcba76e6.png"
				Position   int    `json:"position"`     // 0
				Desc       string `json:"desc"`         // ""
				Area       int    `json:"area"`         // 0
				AreaOld    int    `json:"area_old"`     // 0
				BgColor    string `json:"bg_color"`     // ""
				BgPic      string `json:"bg_pic"`       // ""
				UseOldArea bool   `json:"use_old_area"` // false
			} `json:"frame"`
			Badge struct {
				Name     string `json:"name"`     // "v_person"
				Position int    `json:"position"` // 3
				Value    string `json:"value"`    // ""
				Desc     string `json:"desc"`     // "虚拟UP主、bilibili直播高能主播"
			} `json:"badge"`
			MobileFrame struct {
				Name       string `json:"name"`         // "长红计划-Topstar"
				Value      string `json:"value"`        // "https://i0.hdslb.com/bfs/live/62e62f657d379aaaec2bbd4a6a16a938bcba76e6.png"
				Position   int    `json:"position"`     // 0
				Desc       string `json:"desc"`         // ""
				Area       int    `json:"area"`         // 0
				AreaOld    int    `json:"area_old"`     // 0
				BgColor    string `json:"bg_color"`     // ""
				BgPic      string `json:"bg_pic"`       // ""
				UseOldArea bool   `json:"use_old_area"` // false
			} `json:"mobile_frame"`
			MobileBadge any `json:"mobile_badge"`
		} `json:"new_pendants"`
		UpSession            string `json:"up_session"`              // ""
		PkStatus             int    `json:"pk_status"`               // 0
		PkID                 int    `json:"pk_id"`                   // 0
		BattleID             int    `json:"battle_id"`               // 0
		AllowChangeAreaTime  int    `json:"allow_change_area_time"`  // 0
		AllowUploadCoverTime int    `json:"allow_upload_cover_time"` // 0
		StudioInfo           struct {
			Status     int   `json:"status"` // 0
			MasterList []any `json:"master_list"`
		} `json:"studio_info"`
	} `json:"data"`
}

func GetRoomInfo

func GetRoomInfo(ctx context.Context, roomid int) (RoomInfoResponse, error)

获取直播间信息

type SPI

type SPI struct {
	req.Get
}

接口获取 buvid3 / buvid4

func (SPI) RawURL

func (SPI) RawURL() string

type SPIResponse

type SPIResponse struct {
	Error
	Data struct {
		B3 string `json:"b_3"` // "E225B4F4-615F-F3D4-6AD3-EA4CDD9B3D5389718infoc"
		B4 string `json:"b_4"` // "160D49C2-BDF9-6152-15B5-3607E9641BF789718-024122614-kzVGhgiChnkj56LAFFA0BA=="
	} `json:"data"`
}

func GetSPI

func GetSPI(ctx context.Context) (SPIResponse, error)

接口获取 buvid3 / buvid4

type SameFollowings

type SameFollowings struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	Vmid int `req:"query"`

	// 分页页数
	Pn int `req:"query" default:"1"`

	// 分页大小
	Ps int `req:"query" default:"50"`
}

查询共同关注明细

func (SameFollowings) RawURL

func (SameFollowings) RawURL() string

type SameFollowingsResponse

type SameFollowingsResponse struct {
	Error
	Data struct {
		List      []RelationItem `json:"list"`
		ReVersion string         `json:"re_version"` // ""
		Total     int            `json:"total"`      // 7
	} `json:"data"`
}

func GetSameFollowings

func GetSameFollowings(ctx context.Context, jar http.CookieJar, uid int) (SameFollowingsResponse, error)

查询共同关注明细

type SendMsg

type SendMsg struct {
	PostCSRF
	MixinKey
	http.CookieJar

	// 发送者 UID
	WSenderUID int `req:"query"`

	// 接收者 UID
	WReceiverID int `req:"query"`

	// 发送者 UID
	SenderUID int `req:"body:msg[sender_uid]"`

	// 接收者 UID
	ReceiverID int `req:"body:msg[receiver_id]"`

	// 固定为 1
	ReceiverType int `req:"body" default:"1:msg[receiver_type]"`

	// 消息类型 详见 content.go
	MsgType MsgType `req:"body:msg[msg_type]"`

	// 设备信息
	DeviceID string `req:"body" default:"88A68CB6-CEFC-49BE-87DE-D2A22E549C1E:msg[dev_id]"`

	// 秒级时间戳
	Timestamp int `req:"body:msg[timestamp]"`

	// 消息内容
	Content Content `req:"body:msg[content]"`

	// 未知 非必要
	MsgStatus int `req:"body" default:"0:msg[msg_status]"`

	// 表情包版本 非必要
	NewFaceVersion int `req:"body" default:"0:msg[new_face_version]"`
}

发送私信

不知道叔叔发什么颠要求 query 和 body 都要写收发方 UID 猜测是为了加上 WBI 验证 因为这个验证是用 query 里的字段进行的

func (SendMsg) RawURL

func (SendMsg) RawURL() string

type SendMsgResponse

type SendMsgResponse struct {
	Error
	Data struct {
		MsgKey int64 `json:"msg_key"`
		EInfos []struct {
			Text string `json:"text"`
			URL  string `json:"url"`
			Size int    `json:"size"`
		} `json:"e_infos"`
		MsgContent  string `json:"msg_content"`
		KeyHitInfos struct {
		} `json:"key_hit_infos"`
	} `json:"data"`
}

func PostSendMsg

func PostSendMsg(ctx context.Context, sender int, receiver int, content Content, jar http.CookieJar) (SendMsgResponse, error)

发送私信

type SeriesArchives

type SeriesArchives struct {
	req.Get

	// 用户 mid
	MID int `req:"query"`

	// 系列 ID
	SeriesID int `req:"query"`

	// 作用尚不明确
	// 默认为 true
	OnlyNormal bool `req:"query"`

	// 排序方式
	// 默认排序 desc
	// 升序排序 asc
	Sort string `req:"query"`

	// 页码
	// 默认为 1
	Pn int `req:"query" default:"1"`

	// 每页项数
	// 默认为 30
	Ps int `req:"query" default:"30"`

	// 当前用户 UID
	CurrentMID int `req:"query"`
}

获取指定系列视频

func (SeriesArchives) RawURL

func (SeriesArchives) RawURL() string

type SeriesArchivesResponse

type SeriesArchivesResponse struct {
	Error
	Data struct {
		AIDs []int64 `json:"aids"`
		Page struct {
			Num   int `json:"num"`   // 1
			Size  int `json:"size"`  // 20
			Total int `json:"total"` // 777
		} `json:"page"`
		Archives []Archive `json:"archives"`
	} `json:"data"`
}

func GetSeriesArchives

func GetSeriesArchives(ctx context.Context, uid int, seriesID int) (SeriesArchivesResponse, error)

获取指定系列视频

type Set

type Set struct {
	PostCSRF
	http.CookieJar

	// 置顶目标稿件 avid
	// 与 bvid 任选一个
	AID int `req:"body"`

	// 置顶目标稿件 bvid
	// 与 avid 任选一个
	BVID string `req:"body:bvid"`

	// 置顶视频备注 最大 40 字符
	Reason string `req:"body"`
}

设置置顶视频

func (Set) RawURL

func (Set) RawURL() string

type SetResponse

type SetResponse struct {
	Error
}

func PostSet

func PostSet(ctx context.Context, jar http.CookieJar, bvid, reason string) (SetResponse, error)

设置置顶视频

type SetToutu

type SetToutu struct {
	PostCSRF
	http.CookieJar

	// 头图 ID
	ID int `req:"body"`
}

设置空间头图 (Web端)

func (SetToutu) RawURL

func (SetToutu) RawURL() string

type SetToutuResponse

type SetToutuResponse struct {
	Status bool   `json:"status"`
	Data   string `json:"data"`
}

func PostSetToutu

func PostSetToutu(ctx context.Context, jar http.CookieJar, id int) (SetToutuResponse, error)

设置空间头图 (Web端)

type Settings

type Settings struct {
	req.Get

	// 用户 UID
	MID int `req:"query"`
}

查询空间设置

func (Settings) RawURL

func (Settings) RawURL() string

type SettingsResponse

type SettingsResponse struct {
	Status bool `json:"status"` // true
	Data   struct {
		Privacy struct {
			Bangumi           int `json:"bangumi"`             // 0
			Bbq               int `json:"bbq"`                 // 1
			Channel           int `json:"channel"`             // 1
			ChargeVideo       int `json:"charge_video"`        // 1
			CloseSpaceMedal   int `json:"close_space_medal"`   // 0
			CoinsVideo        int `json:"coins_video"`         // 1
			Comic             int `json:"comic"`               // 0
			DisableFollowing  int `json:"disable_following"`   // 1
			DisableShowFans   int `json:"disable_show_fans"`   // 0
			DisableShowNft    int `json:"disable_show_nft"`    // 0
			DisableShowSchool int `json:"disable_show_school"` // 0
			DressUp           int `json:"dress_up"`            // 1
			FavVideo          int `json:"fav_video"`           // 0
			Groups            int `json:"groups"`              // 0
			LessonVideo       int `json:"lesson_video"`        // 1
			LikesVideo        int `json:"likes_video"`         // 1
			LivePlayback      int `json:"live_playback"`       // 0
			OnlyShowWearing   int `json:"only_show_wearing"`   // 1
			PlayedGame        int `json:"played_game"`         // 0
			Tags              int `json:"tags"`                // 0
			UserInfo          int `json:"user_info"`           // 1
		} `json:"privacy"`
		ShowNftSwitch bool `json:"show_nft_switch"` // true
		IndexOrder    []struct {
			ID   int    `json:"id"`   // 1
			Name string `json:"name"` // "我的稿件"
		} `json:"index_order"`
		Theme               string `json:"theme"`                  // "default"
		ThemePreviewImgPath string `json:"theme_preview_img_path"` // ""
		Toutu               struct {
			SID          int    `json:"sid"`           // 1
			Expire       int64  `json:"expire"`        // 2996777597
			SImg         string `json:"s_img"`         // "bfs/space/768cc4fd97618cf589d23c2711a1d1a729f42235.png"
			LImg         string `json:"l_img"`         // "bfs/space/cb1c3ef50e22b6096fde67febe863494caefebad.png"
			AndroidImg   string `json:"android_img"`   // ""
			IphoneImg    string `json:"iphone_img"`    // ""
			IpadImg      string `json:"ipad_img"`      // ""
			ThumbnailImg string `json:"thumbnail_img"` // ""
			Platform     int    `json:"platform"`      // 0
		} `json:"toutu"`
	} `json:"data"`
}

func GetSettings

func GetSettings(ctx context.Context, uid int) (SettingsResponse, error)

查询空间设置

type SignUpdate

type SignUpdate struct {
	PostCSRF
	http.CookieJar

	// 要设置的签名内容 可为空
	UserSign string `req:"body"`
}

修改个人签名

func (SignUpdate) RawURL

func (SignUpdate) RawURL() string

type SignUpdateResponse

type SignUpdateResponse struct {
	Error
}

func PostSignUpdate

func PostSignUpdate(ctx context.Context, jar http.CookieJar, sign string) (SignUpdateResponse, error)

修改个人签名

type SingleUnread

type SingleUnread struct {
	req.Get
	http.CookieJar

	Build      int    `req:"query,omitempty"`
	MobiApp    string `req:"query,omitempty"`
	UnreadType int    `req:"query,omitempty"`
}

未读私信数

func (SingleUnread) RawURL

func (SingleUnread) RawURL() string

type SingleUnreadResponse

type SingleUnreadResponse struct {
	Error
	Msg  string `json:"msg"`
	Data struct {
		UnfollowUnread       int `json:"unfollow_unread"`
		FollowUnread         int `json:"follow_unread"`
		UnfollowPushMsg      int `json:"unfollow_push_msg"`
		DustbinPushMsg       int `json:"dustbin_push_msg"`
		DustbinUnread        int `json:"dustbin_unread"`
		BizMsgUnfollowUnread int `json:"biz_msg_unfollow_unread"`
		BizMsgFollowUnread   int `json:"biz_msg_follow_unread"`
		CustomUnread         int `json:"custom_unread"`
	} `json:"data"`
}

func GetSingleUnread

func GetSingleUnread(ctx context.Context, jar http.CookieJar) (SingleUnreadResponse, error)

未读私信数

type SiteUserInfo

type SiteUserInfo struct {
	req.Get
	http.CookieJar
}

查询账号安全情况

func (SiteUserInfo) RawURL

func (SiteUserInfo) RawURL() string

type SiteUserInfoResponse

type SiteUserInfoResponse struct {
	Error
	Data struct {
		AccountInfo struct {
			HideTel           string `json:"hide_tel"`
			HideMail          string `json:"hide_mail"`
			BindTel           bool   `json:"bind_tel"`
			BindMail          bool   `json:"bind_mail"`
			TelVerify         bool   `json:"tel_verify"`
			MailVerify        bool   `json:"mail_verify"`
			UnneededCheck     bool   `json:"unneeded_check"`
			RealnameCertified bool   `json:"realname_certified"`
		} `json:"account_info"`
		AccountSafe struct {
			Score    int  `json:"Score"`
			ScoreNew int  `json:"score_new"`
			PwdLevel int  `json:"pwd_level"`
			Security bool `json:"security"`
		} `json:"account_safe"`
		AccountSns struct {
			WeiboBind  int `json:"weibo_bind"`
			QqBind     int `json:"qq_bind"`
			WechatBind int `json:"wechat_bind"`
		} `json:"account_sns"`
		AccountOther struct {
			SkipVerify bool `json:"skipVerify"`
		} `json:"account_other"`
	} `json:"data"`
}

func GetSiteUserInfo

func GetSiteUserInfo(ctx context.Context, jar http.CookieJar) (SiteUserInfoResponse, error)

查询账号安全情况

type SongUpper

type SongUpper struct {
	req.Get

	// 目标用户 UID
	UID int `req:"query"`

	// 页码
	// 默认为 1
	Pn int `req:"query" default:"1"`

	// 每页项数
	// 默认为 30
	Ps int `req:"query" default:"30"`

	// 排序方式
	// 最新发布 1
	// 最多播放 2
	// 最多收藏 3
	Order string `req:"query"`
}

查询用户投稿音频明细

func (SongUpper) RawURL

func (SongUpper) RawURL() string

type SongUpperResponse

type SongUpperResponse struct {
	Error
	Msg  string `json:"msg"` // "success"
	Data struct {
		CurPage   int `json:"curPage"`   // 1
		PageCount int `json:"pageCount"` // 1
		TotalSize int `json:"totalSize"` // 2
		PageSize  int `json:"pageSize"`  // 2
		Data      []struct {
			ID         int    `json:"id"`         // 378521
			UID        int    `json:"uid"`        // 8047632
			Uname      string `json:"uname"`      // "哔哩哔哩弹幕网"
			Author     string `json:"author"`     // ""
			Title      string `json:"title"`      // "《B TOGETHER》-bilibili九周年主题曲"
			Cover      string `json:"cover"`      // "http://i0.hdslb.com/bfs/music/109136c63e16d83fbad5ec9282a6fb96498d8144.jpg"
			Intro      string `json:"intro"`      // ""
			Lyric      string `json:"lyric"`      // "http://i0.hdslb.com/bfs/music/1529979007378521.lrc"
			Crtype     int    `json:"crtype"`     // 1
			Duration   int    `json:"duration"`   // 0
			Passtime   int    `json:"passtime"`   // 1529928347
			Curtime    int    `json:"curtime"`    // 0
			AID        int    `json:"aid"`        // 0
			BVID       string `json:"bvid"`       // ""
			CID        int    `json:"cid"`        // 0
			MsID       int    `json:"msid"`       // 0
			Attr       int    `json:"attr"`       // 0
			Limit      int    `json:"limit"`      // 0
			ActivityID int    `json:"activityId"` // 0
			Limitdesc  string `json:"limitdesc"`  // ""
			CoinNum    int    `json:"coin_num"`   // 3640
			Ctime      int64  `json:"ctime"`      // 1529928235000
			Statistic  struct {
				SID     int `json:"sid"`     // 378521
				Play    int `json:"play"`    // 123582
				Collect int `json:"collect"` // 5510
				Comment int `json:"comment"` // 1591
				Share   int `json:"share"`   // 535
			} `json:"statistic"`
			VipInfo    any `json:"vipInfo"`
			CollectIds any `json:"collectIds"`
			IsCooper   int `json:"is_cooper"` // 0
		} `json:"data"`
	} `json:"data"`
}

func GetSongUpper

func GetSongUpper(ctx context.Context, uid int) (SongUpperResponse, error)

查询用户投稿音频明细

type Special

type Special struct {
	req.Get
	http.CookieJar
}

查询所有特别关注 UID

func (Special) RawURL

func (Special) RawURL() string

type SpecialResponse

type SpecialResponse struct {
	Error
	Data []int `json:"data"`
}

func GetSpecial

func GetSpecial(ctx context.Context, jar http.CookieJar) (SpecialResponse, error)

查询所有特别关注 UID

type Tag

type Tag struct {
	req.Get
	http.CookieJar

	// 分组 id
	TagID int `req:"query:tagid"`

	// 排序方式 当目标用户为自己时有效
	// ("")按照关注顺序排列
	// ("attention")按照最常访问排列
	OrderType string `req:"query,omitempty"`

	// 分页页数
	Pn int `req:"query" default:"1"`

	// 分页大小
	Ps int `req:"query" default:"20"`
}

查询关注分组明细

func (Tag) RawURL

func (Tag) RawURL() string

type TagResponse

type TagResponse struct {
	Error
	Data []RelationItem `json:"data"`
}

func GetTag

func GetTag(ctx context.Context, jar http.CookieJar, tagid int) (TagResponse, error)

查询关注分组明细

type Tags

type Tags struct {
	req.Get
	http.CookieJar
}

查询关注分组列表

func (Tags) RawURL

func (Tags) RawURL() string

type TagsResponse

type TagsResponse struct {
	Error
	Data []struct {
		TagID int    `json:"tagid"` // -10
		Name  string `json:"name"`  // "特别关注"
		Count int    `json:"count"` // 2
		Tip   string `json:"tip"`   // "第一时间收到该分组下用户更新稿件的通知"
	} `json:"data"`
}

func GetTags

func GetTags(ctx context.Context, jar http.CookieJar) (TagsResponse, error)

查询关注分组列表

type TagsSet

type TagsSet struct {
	PostCSRF
	http.CookieJar

	// 要设置的 TAG 内容 用(,)间隔
	Tags string `req:"body"`
}

修改个人 TAG

func (TagsSet) RawURL

func (TagsSet) RawURL() string

type TagsSetResponse

type TagsSetResponse struct {
	Error
}

func PostTagsSet

func PostTagsSet(ctx context.Context, jar http.CookieJar, tags []string) (TagsSetResponse, error)

修改个人 TAG

type TaskSign

type TaskSign struct {
	PostCSRF
	http.CookieJar
}

大积分签到

func (TaskSign) RawURL

func (TaskSign) RawURL() string

type TaskSignResponse

type TaskSignResponse struct {
	Error
}

func PostTaskSign

func PostTaskSign(ctx context.Context, jar http.CookieJar) (TaskSignResponse, error)

大积分签到

type Text

type Text string

Text 纯文本内容

func (Text) MarshalString

func (t Text) MarshalString() string

func (Text) MsgType

func (Text) MsgType() MsgType

type Timestamp

type Timestamp struct {
	req.Get
}

获取适用于 RTC 的时间戳

func (Timestamp) RawURL

func (Timestamp) RawURL() string

type TimestampResponse

type TimestampResponse struct {
	Error
	Data struct {
		Timestamp int   `json:"timestamp"` // 1735223942
		Microtime int64 `json:"microtime"` // 1735223942970
	} `json:"data"`
}

func GetTimestamp

func GetTimestamp(ctx context.Context) (TimestampResponse, error)

获取适用于 RTC 的时间戳

type TopPhotoList

type TopPhotoList struct {
	req.Get

	// 用户 UID
	MID int `req:"query"`
}

查询可用头图列表 (Web端)

func (TopPhotoList) RawURL

func (TopPhotoList) RawURL() string

type TopPhotoListResponse

type TopPhotoListResponse struct {
	Status bool `json:"status"` // true
	Data   []struct {
		ID           int    `json:"id"`            // 1
		ProductName  string `json:"product_name"`  // "bilibili春"
		Price        int    `json:"price"`         // 0
		CoinType     int    `json:"coin_type"`     // 0
		VipFree      int    `json:"vip_free"`      // 0
		SImg         string `json:"s_img"`         // "bfs/space/768cc4fd97618cf589d23c2711a1d1a729f42235.png"
		LImg         string `json:"l_img"`         // "bfs/space/cb1c3ef50e22b6096fde67febe863494caefebad.png"
		ThumbnailImg string `json:"thumbnail_img"` // ""
		SortNum      int    `json:"sort_num"`      // 19
		IsDisable    int    `json:"is_disable"`    // 0
		Expire       int64  `json:"expire"`        // 2890206564
		Had          int    `json:"had"`           // 1
	} `json:"data"`
}

func GetTopPhotoList

func GetTopPhotoList(ctx context.Context, uid int) (TopPhotoListResponse, error)

查询可用头图列表 (Web端)

type UPStat

type UPStat struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	MID int `req:"query"`
}

UP 主状态数

func (UPStat) RawURL

func (UPStat) RawURL() string

type UPStatResponse

type UPStatResponse struct {
	Error
	Data struct {
		Archive struct {
			EnableVt int `json:"enable_vt"` // 0
			View     int `json:"view"`      // 57937010
			Vt       int `json:"vt"`        // 0
		} `json:"archive"`
		Article struct {
			View int `json:"view"` // 123793
		} `json:"article"`
		Likes int `json:"likes"` // 9789775
	} `json:"data"`
}

func GetUPStat

func GetUPStat(ctx context.Context, jar http.CookieJar, uid int) (UPStatResponse, error)

UP 主状态数

type Unread

type Unread struct {
	req.Get
	http.CookieJar
}

未读消息数

func (Unread) RawURL

func (Unread) RawURL() string

type UnreadResponse

type UnreadResponse struct {
	Error
	Data struct {
		At          int `json:"at"`
		Chat        int `json:"chat"`
		Coin        int `json:"coin"`
		Danmu       int `json:"danmu"`
		Favorite    int `json:"favorite"`
		Like        int `json:"like"`
		RecvLike    int `json:"recv_like"`
		RecvReply   int `json:"recv_reply"`
		Reply       int `json:"reply"`
		SysMsg      int `json:"sys_msg"`
		SysMsgStyle int `json:"sys_msg_style"`
		Up          int `json:"up"`
	} `json:"data"`
}

func GetUnread

func GetUnread(ctx context.Context, jar http.CookieJar) (UnreadResponse, error)

未读消息数

type Update

type Update struct {
	PostCSRF
	http.CookieJar

	// 分组 id
	TagID int `req:"body:tagid"`

	// 新分组名 最长 16 字符
	Name string `req:"body"`
}

重命名分组

func (Update) RawURL

func (Update) RawURL() string

type UpdateResponse

type UpdateResponse struct {
	Error
}

func PostUpdate

func PostUpdate(ctx context.Context, jar http.CookieJar, tag int, name string) (UpdateResponse, error)

重命名分组

type UploadCount

type UploadCount struct {
	req.Get

	// 目标用户 UID
	UID int `req:"query"`
}

相簿投稿数

func (UploadCount) RawURL

func (UploadCount) RawURL() string

type UploadCountResponse

type UploadCountResponse struct {
	Error
	Data struct {
		AllCount   int `json:"all_count"`   // 1018
		DrawCount  int `json:"draw_count"`  // 0
		PhotoCount int `json:"photo_count"` // 0
		DailyCount int `json:"daily_count"` // 1018
	} `json:"data"`
}

func GetUploadCount

func GetUploadCount(ctx context.Context, uid int) (UploadCountResponse, error)

相簿投稿数

type User

type User struct {
	req.Get
	http.CookieJar

	// 目标用户 UID
	FID int `req:"query"`
}

查询目标用户所在的分组

func (User) RawURL

func (User) RawURL() string

type UserResponse

type UserResponse struct {
	Error
	Data map[string]string `json:"data"`
}

func GetUser

func GetUser(ctx context.Context, jar http.CookieJar, uid int) (UserResponse, error)

查询目标用户所在的分组

type VIP

type VIP struct {
	// 会员类型
	// (0)无
	// (1)月度大会员
	// (2)年度以上大会员
	VIPType int `json:"vipType"`

	// 会员到期时间	毫秒级时间戳
	VIPDueDate int64 `json:"vipDueDate"`

	DueRemark    string `json:"dueRemark"`
	AccessStatus int    `json:"accessStatus"`

	// 大会员状态
	// (0)无
	// (1)有
	VIPStatus int `json:"vipStatus"`

	VIPStatusWarn string `json:"vipStatusWarn"`
	ThemeType     int    `json:"themeType"`
	Label         struct {
		Path        string `json:"path"`
		Text        string `json:"text"`
		LabelTheme  string `json:"label_theme"`
		TextColor   string `json:"text_color"`
		BgStyle     int    `json:"bg_style"`
		BgColor     string `json:"bg_color"`
		BorderColor string `json:"border_color"`
	} `json:"label"`
	AvatarSubscript    int    `json:"avatar_subscript"`
	NicknameColor      string `json:"nickname_color"`
	AvatarSubscriptURL string `json:"avatar_subscript_url"`
}

会员信息

type VIPCenterCombine

type VIPCenterCombine struct {
	req.Get
	http.CookieJar

	// 平台 web端(web) 安卓APP(android)
	Platform string `req:"query,omitempty"`

	Build   int    `req:"query,omitempty"`
	MobiApp string `req:"query,omitempty"`
}

大会员中心信息

func (VIPCenterCombine) RawURL

func (VIPCenterCombine) RawURL() string

type VIPCenterCombineResponse

type VIPCenterCombineResponse struct {
	Error
	Data struct {
		User struct {
			Account struct {
				MID            int    `json:"mid"`              // 188888131
				Name           string `json:"name"`             // "脆鲨12138"
				Sex            string `json:"sex"`              // "女"
				Face           string `json:"face"`             // "https://i1.hdslb.com/bfs/face/86faab4844dd2c45870fdafa8f2c9ce7be3e999f.jpg"
				Sign           string `json:"sign"`             // "虚拟艺人团体Vcslive成员,喜欢宅在家打游戏的脆鲨12138!!!"
				Rank           int    `json:"rank"`             // 10000
				Birthday       int    `json:"birthday"`         //
				IsFakeAccount  int    `json:"is_fake_account"`  // 0
				IsDeleted      int    `json:"is_deleted"`       // 0
				InRegAudit     int    `json:"in_reg_audit"`     // 0
				IsSeniorMember int    `json:"is_senior_member"` // 0
				NameRender     any    `json:"name_render"`
			} `json:"account"`
			Vip struct {
				MID        int   `json:"mid"`          // 188888131
				VipType    int   `json:"vip_type"`     // 2
				VipStatus  int   `json:"vip_status"`   // 1
				VipDueDate int64 `json:"vip_due_date"` // 1797264000000
				VipPayType int   `json:"vip_pay_type"` // 1
				ThemeType  int   `json:"theme_type"`   // 0
				Label      struct {
					Text                  string `json:"text"`                      // "年度大会员"
					LabelTheme            string `json:"label_theme"`               // "annual_vip"
					TextColor             string `json:"text_color"`                // "#FFFFFF"
					BgStyle               int    `json:"bg_style"`                  // 1
					BgColor               string `json:"bg_color"`                  // "#FB7299"
					BorderColor           string `json:"border_color"`              // ""
					UseImgLabel           bool   `json:"use_img_label"`             // true
					ImgLabelURIHans       string `json:"img_label_uri_hans"`        // ""
					ImgLabelURIHant       string `json:"img_label_uri_hant"`        // ""
					ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"` // "https://i0.hdslb.com/bfs/vip/8d4f8bfc713826a5412a0a27eaaac4d6b9ede1d9.png"
					ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"` // "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/VEW8fCC0hg.png"
				} `json:"label"`
				AvatarSubscript    int    `json:"avatar_subscript"`     // 1
				AvatarSubscriptURL string `json:"avatar_subscript_url"` // "https://i0.hdslb.com/bfs/activity-plat/static/20231122/a5480f18ac08c1e30876e3fde84db784/r9dln6E2Uo.png"
				NicknameColor      string `json:"nickname_color"`       // "#FB7299"
				IsNewUser          bool   `json:"is_new_user"`          // false
				TipMaterial        any    `json:"tip_material"`
				VipIsAnnual        bool   `json:"vip_is_annual"`   // true
				VipIsMonth         bool   `json:"vip_is_month"`    // false
				IsAutoRenew        bool   `json:"is_auto_renew"`   // true
				VipIsValid         bool   `json:"vip_is_valid"`    // true
				VipIsOverdue       bool   `json:"vip_is_overdue"`  // false
				VipKeepTime        int    `json:"vip_keep_time"`   // 0
				VipExpireDays      int    `json:"vip_expire_days"` // 717
			} `json:"vip"`
			Tv struct {
				Type       int `json:"type"`         // 0
				VipPayType int `json:"vip_pay_type"` // 0
				Status     int `json:"status"`       // 0
				DueDate    int `json:"due_date"`     // 0
			} `json:"tv"`
			BackgroundImageSmall string `json:"background_image_small"` // ""
			BackgroundImageBig   string `json:"background_image_big"`   // ""
			PanelTitle           string `json:"panel_title"`            // "脆鲨12138"
			PanelSubTitle        string `json:"panel_sub_title"`        // ""
			AvatarPendant        struct {
				Image             string `json:"image"`               // "https://i0.hdslb.com/bfs/garb/item/7061b098537482bb78242a16cba5d44b426b429d.png"
				ImageEnhance      string `json:"image_enhance"`       // "https://i0.hdslb.com/bfs/garb/item/7061b098537482bb78242a16cba5d44b426b429d.png"
				ImageEnhanceFrame string `json:"image_enhance_frame"` // ""
			} `json:"avatar_pendant"`
			VipOverdueExplain    string `json:"vip_overdue_explain"`    // "年度大会员有效期 2026/12/15"
			TvOverdueExplain     string `json:"tv_overdue_explain"`     // "超级大会员未开通"
			AccountExceptionText string `json:"account_exception_text"` // ""
			IsAutoRenew          bool   `json:"is_auto_renew"`          // true
			IsTvAutoRenew        bool   `json:"is_tv_auto_renew"`       // false
			SurplusSeconds       int    `json:"surplus_seconds"`        // 61897858
			VipKeepTime          int    `json:"vip_keep_time"`          // 1600185600
			Renew                struct {
				Text string `json:"text"` // ""
				Link string `json:"link"` // ""
			} `json:"renew"`
			Notice struct {
				Text             string `json:"text"`               // ""
				TvText           string `json:"tv_text"`            // ""
				Type             int    `json:"type"`               // 0
				CanClose         bool   `json:"can_close"`          // false
				SurplusSeconds   int    `json:"surplus_seconds"`    // 0
				TvSurplusSeconds int    `json:"tv_surplus_seconds"` // 0
			} `json:"notice"`
			Face struct {
				ContainerSize struct {
					Width  float64 `json:"width"`  // 1.375
					Height float64 `json:"height"` // 1.375
				} `json:"container_size"`
				FallbackLayers struct {
					Layers []struct {
						Visible     bool `json:"visible"` // true
						GeneralSpec struct {
							PosSpec struct {
								CoordinatePos int     `json:"coordinate_pos"` // 2
								AxisX         float64 `json:"axis_x"`         // 0.6875
								AxisY         float64 `json:"axis_y"`         // 0.6875
							} `json:"pos_spec"`
							SizeSpec struct {
								Width  float64 `json:"width"`  // 0.787
								Height float64 `json:"height"` // 0.787
							} `json:"size_spec"`
							RenderSpec struct {
								Opacity int `json:"opacity"` // 1
							} `json:"render_spec"`
						} `json:"general_spec"`
						LayerConfig struct {
							Tags struct {
								AVATARLAYER struct {
								} `json:"AVATAR_LAYER"`
								GENERALCFG struct {
									ConfigType    int `json:"config_type"` // 1
									GeneralConfig struct {
										WebCSSStyle struct {
											BorderRadius string `json:"borderRadius"` // "50%"
										} `json:"web_css_style"`
									} `json:"general_config"`
								} `json:"GENERAL_CFG"`
							} `json:"tags"`
							IsCritical bool `json:"is_critical"` // true
						} `json:"layer_config"`
						Resource struct {
							ResType  int `json:"res_type"` // 3
							ResImage struct {
								ImageSrc struct {
									SrcType     int `json:"src_type"`    // 1
									Placeholder int `json:"placeholder"` // 6
									Remote      struct {
										URL      string `json:"url"`       // "https://i1.hdslb.com/bfs/face/86faab4844dd2c45870fdafa8f2c9ce7be3e999f.jpg"
										BfsStyle string `json:"bfs_style"` // "widget-layer-avatar"
									} `json:"remote"`
								} `json:"image_src"`
							} `json:"res_image"`
						} `json:"resource"`
					} `json:"layers"`
					IsCriticalGroup bool `json:"is_critical_group"` // true
				} `json:"fallback_layers"`
				MID string `json:"mid"` // "188888131"
			} `json:"face"`
		} `json:"user"`
		Wallet struct {
			Coupon            int  `json:"coupon"`             // 0
			Point             int  `json:"point"`              // 0
			PrivilegeReceived bool `json:"privilege_received"` // false
		} `json:"wallet"`
		UnionVip      any `json:"union_vip"`
		OtherOpenInfo any `json:"other_open_info"`
		Privileges    []struct {
			ID              int    `json:"id"`   // 3
			Name            string `json:"name"` // "视听特权"
			ChildPrivileges []struct {
				FirstID            int    `json:"first_id"`             // 3
				ReportID           string `json:"report_id"`            // "clearwatch"
				Name               string `json:"name"`                 // "超清看"
				Desc               string `json:"desc"`                 // "会员用户超清晰观看"
				Explain            string `json:"explain"`              // "大会员可专享高帧率、高码率画质(最高可达超清4k),觉醒超凡视觉体验。"
				IconURL            string `json:"icon_url"`             // "http://i0.hdslb.com/bfs/vip/b0faebe1b6b5178c49d6d9500c0ded88c0d677ad.png"
				IconGrayURL        string `json:"icon_gray_url"`        // ""
				BackgroundImageURL string `json:"background_image_url"` // "http://i0.hdslb.com/bfs/vip/21d79540e10618ee9bbaf8874ae711442d10edf0.png"
				Link               string `json:"link"`                 // "https://big.bilibili.com/mobile/explainDetails?name=%E8%B6%85%E6%B8%85%E7%9C%8B&closable=1&navhide=1"
				ImageURL           string `json:"image_url"`            // "http://i0.hdslb.com/bfs/vip/fbe4cf2288571d7b0a509c7014d5182789ffdd74.png"
				Type               int    `json:"type"`                 // 0
				HotType            int    `json:"hot_type"`             // 0
				NewType            int    `json:"new_type"`             // 1
				ID                 int    `json:"id"`                   // 3
			} `json:"child_privileges"`
		} `json:"privileges"`
		Banners any `json:"banners"`
		Welfare struct {
			Count int `json:"count"` // 6
			List  []struct {
				ID          int    `json:"id"`           // 120
				Name        string `json:"name"`         // "移动免费领4G流量"
				HomepageURI string `json:"homepage_uri"` // "https://i1.hdslb.com/bfs/vip/abec6a734d8ca1a2b8bf2cc036aafe28d43c0e99.png"
				BackdropURI string `json:"backdrop_uri"` // "https://i1.hdslb.com/bfs/vip/202df1b0786c66c2d5e41db1b048f0a8cdc219ac.png"
				TID         int    `json:"tid"`          // 0
				Rank        int    `json:"rank"`         // 1
				ReceiveURI  string `json:"receive_uri"`  // "https://wx.10086.cn/qwhdhub/leadin/1024120650?A_C_CODE=KXGxyMb60d"
			} `json:"list"`
		} `json:"welfare"`
		RecommendPendants struct {
			List []struct {
				ID      int    `json:"id"`       // 1758
				Name    string `json:"name"`     // "至尊戒"
				Image   string `json:"image"`    // "https://i0.hdslb.com/bfs/garb/item/025d07fa04d38236bc2258be2faf2867e2c48fe1.png"
				JumpURL string `json:"jump_url"` // "https://www.bilibili.com/h5/mall/preview/pendant/1758?navhide=1"
			} `json:"list"`
			JumpURL string `json:"jump_url"` // "https://www.bilibili.com/h5/mall/pendant/home?navhide=1&tab_id=22"
		} `json:"recommend_pendants"`
		RecommendCards struct {
			List []struct {
				ID      int    `json:"id"`       // 18
				Name    string `json:"name"`     // "阿维"
				Image   string `json:"image"`    // "https://i0.hdslb.com/bfs/vip/ffa3e8c1cf92eb0c01db61abe5741419e9302a70.png"
				JumpURL string `json:"jump_url"` // "https://www.bilibili.com/h5/mall/preview/feed/18?navhide=1"
			} `json:"list"`
			JumpURL string `json:"jump_url"` // "https://www.bilibili.com/h5/mall/card/detail?navhide=1&tab_id=5"
		} `json:"recommend_cards"`
		Sort []struct {
			Key  string `json:"key"`  // "union_vip"
			Sort int    `json:"sort"` // 1
		} `json:"sort"`
		InReview bool `json:"in_review"` // false
		BigPoint struct {
			PointInfo struct {
				Point       int `json:"point"`        // 0
				ExpirePoint int `json:"expire_point"` // 0
				ExpireTime  int `json:"expire_time"`  // 0
				ExpireDays  int `json:"expire_days"`  // 0
			} `json:"point_info"`
			SignInfo struct {
				SignRemind   bool `json:"sign_remind"`   // true
				Benefit      int  `json:"benefit"`       // 5
				BonusBenefit int  `json:"bonus_benefit"` // 200
				NormalRemind bool `json:"normal_remind"` // true
				MuggleTask   bool `json:"muggle_task"`   // true
				ExpValue     int  `json:"exp_value"`     // -1
			} `json:"sign_info"`
			SkuInfo struct {
				Skus []struct {
					Base struct {
						Token            string   `json:"token"`   // "1126774380639117732"
						Title            string   `json:"title"`   // "百草味50元礼盒直减券"
						Picture          string   `json:"picture"` // "https://i0.hdslb.com/bfs/activity-plat/9f7fe43bb6cd1692f10b9c0a2892ea63fc80041e.jpg"
						RotationPictures []string `json:"rotation_pictures"`
						Price            struct {
							Origin    int `json:"origin"` // 188
							Promotion any `json:"promotion"`
							Sale      int `json:"sale"` // 188
						} `json:"price"`
						Inventory struct {
							AvailableNum int `json:"available_num"` // 50000
							UsedNum      int `json:"used_num"`      // 44
							SurplusNum   int `json:"surplus_num"`   // 49956
						} `json:"inventory"`
						UserType          int `json:"user_type"`           // 2
						ExchangeLimitType int `json:"exchange_limit_type"` // 2
						ExchangeLimitNum  int `json:"exchange_limit_num"`  // 5
						StartTime         int `json:"start_time"`          // 1735198320
						EndTime           int `json:"end_time"`            // 1753977599
						State             int `json:"state"`               // 2
						Priority          int `json:"priority"`            // 90
					} `json:"base"`
				} `json:"skus"`
			} `json:"sku_info"`
			PointSwitchOff bool `json:"point_switch_off"` // false
			Tips           []struct {
				Content string `json:"content"` // "200大积分待领取"
			} `json:"tips"`
		} `json:"big_point"`
		HotList struct {
			Taps []struct {
				OID       string `json:"oid"`            // "{season_type:0,style_id:0,day:3,rank_type:5}"
				RankID    int    `json:"rank_id"`        // 279
				RankTitle string `json:"rank_title"`     // "会员"
				Type      int    `json:"type,omitempty"` // 1
			} `json:"taps"`
		} `json:"hot_list"`
		IntegrationTask bool `json:"integration_task"` // false
		FreeWelfare     []struct {
			ID             int    `json:"id"`             // 4290081
			Icon           string `json:"icon"`           // "https://i0.hdslb.com/bfs/bangumi/image/5a0027a21d5298fe62266968a0b65f1ab84efa72.png"
			Title          string `json:"title"`          // "开通联通王卡"
			TitleColor     string `json:"titleColor"`     // "#000000"
			Subtitle       string `json:"subtitle"`       // "每年享960G流量"
			SubtitleColor  string `json:"subtitleColor"`  // "#9499A0"
			Subtitle2      string `json:"subtitle2"`      // "领24个月大会员"
			Subtitle2Color string `json:"subtitle2Color"` // "#FF6699"
			TaskState      int    `json:"task_state"`     // 1
			Link           string `json:"link"`           // "https://www.bilibili.com/blackboard/activity-amrPj9oRBu.html?taskId=4290081&channel=cucc_king"
			Channel        string `json:"channel"`        // "cucc_king"
		} `json:"free_welfare"`
		ExtraParamas struct {
			SwitchOn            bool   `json:"switch_on"`               // false
			BirthdaySkuSwitchOn bool   `json:"birthday_sku_switch_on"`  // false
			IsBuyBirthdaySku    bool   `json:"is_buy_birthday_sku"`     // false
			IsBirthdayOff       bool   `json:"is_birthday_off"`         // false
			PhoneBindState      int    `json:"phone_bind_state"`        // 3
			AppTimes            int    `json:"app_times"`               // 0
			NaAb                int    `json:"na_ab"`                   // 0
			NaAbGroupID         string `json:"na_ab_group_id"`          // ""
			IsSameToLastSession bool   `json:"is_same_to_last_session"` // false
			IsWhiteList         bool   `json:"is_white_list"`           // false
			CloudAb             int    `json:"cloud_ab"`                // 0
			CloudAbGroupID      string `json:"cloud_ab_group_id"`       // ""
			BannerAb            int    `json:"banner_ab"`               // 0
			BannerAbGroupID     string `json:"banner_ab_group_id"`      // ""
			NowTime             int    `json:"now_time"`                // 0
			FreeWelfareAb       int    `json:"free_welfare_ab"`         // 0
			DeviceLimitAb       int    `json:"device_limit_ab"`         // 0
		} `json:"extra_paramas"`
		HitAb bool `json:"hit_ab"` // false
	} `json:"data"`
}

func GetVIPCenterCombine

func GetVIPCenterCombine(ctx context.Context, jar http.CookieJar) (VIPCenterCombineResponse, error)

大会员中心信息

type VIPEXPAdd

type VIPEXPAdd struct {
	PostCSRF
	http.CookieJar
}

大会员每日经验

func (VIPEXPAdd) RawURL

func (VIPEXPAdd) RawURL() string

type VIPEXPAddResponse

type VIPEXPAddResponse struct {
	Error
	Data struct {
		Type    int  `json:"type"`     // 0
		IsGrant bool `json:"is_grant"` // true
	} `json:"data"`
}

func PostVIPEXPAdd

func PostVIPEXPAdd(ctx context.Context, jar http.CookieJar) (VIPEXPAddResponse, error)

大会员每日经验

type VIPPointList

type VIPPointList struct {
	req.Get
	http.CookieJar

	// 改变类型
	// (0)所有类型
	// (1)获取记录
	// (2)消耗记录
	ChangeType int `req:"query" default:"0"`

	// 分页页数
	Pn int `req:"query" default:"1"`

	// 分页大小
	Ps int `req:"query" default:"20"`
}

大积分改变记录

func (VIPPointList) RawURL

func (VIPPointList) RawURL() string

type VIPPointListResponse

type VIPPointListResponse struct {
	Error
	Data struct {
		Total        int `json:"total"` // 2
		BigPointList []struct {
			Point      int    `json:"point"`       // 50
			ChangeTime int    `json:"change_time"` // 1680253998
			Remark     string `json:"remark"`      // "领取大会员卡券包权益"
			OrderNo    string `json:"order_no"`    // "nt-s-c-1018922562"
			ImageURL   string `json:"image_url"`   // ""
		} `json:"big_point_list"`
	} `json:"data"`
}

func GetVIPPointList

func GetVIPPointList(ctx context.Context, jar http.CookieJar) (VIPPointListResponse, error)

大积分改变记录

type VideoInfo

type VideoInfo struct {
	AID       int    `json:"aid"`                  // 78090377
	Videos    int    `json:"videos"`               // 1
	TID       int    `json:"tid"`                  // 47
	Tname     string `json:"tname"`                // "同人·手书"
	Copyright int    `json:"copyright"`            // 1
	Pic       string `json:"pic"`                  // "http://i2.hdslb.com/bfs/archive/7fe8272ef4c90d07ba2dba968638392f8d5bf490.jpg"
	Title     string `json:"title"`                // "【七海】七海的偶像宣言/私、アイドル宣言【手书PV】"
	Pubdate   int    `json:"pubdate"`              // 1575540036
	Ctime     int    `json:"ctime"`                // 1575483142
	Desc      string `json:"desc"`                 // "本家:sm32825363 ...
	State     int    `json:"state"`                // 0
	Attribute int    `json:"attribute"`            // 16793984
	Duration  int    `json:"duration"`             // 268
	MissionID int    `json:"mission_id,omitempty"` // 271861
	Rights    struct {
		Bp            int `json:"bp"`              // 0
		Elec          int `json:"elec"`            // 0
		Download      int `json:"download"`        // 0
		Movie         int `json:"movie"`           // 0
		Pay           int `json:"pay"`             // 0
		Hd5           int `json:"hd5"`             // 1
		NoReprint     int `json:"no_reprint"`      // 1
		Autoplay      int `json:"autoplay"`        // 1
		UgcPay        int `json:"ugc_pay"`         // 0
		IsCooperation int `json:"is_cooperation"`  // 1
		UgcPayPreview int `json:"ugc_pay_preview"` // 0
		NoBackground  int `json:"no_background"`   // 0
		ArcPay        int `json:"arc_pay"`         // 0
		PayFreeWatch  int `json:"pay_free_watch"`  // 0
	} `json:"rights"`
	Owner struct {
		MID  int    `json:"mid"`  // 434334701
		Name string `json:"name"` // "七海Nana7mi"
		Face string `json:"face"` // "https://i2.hdslb.com/bfs/face/3adb26401cfab0fe6b1a0d5b2c09220499108d64.jpg"
	} `json:"owner"`
	Stat struct {
		AID      int `json:"aid"`      // 78090377
		View     int `json:"view"`     // 403958
		Danmaku  int `json:"danmaku"`  // 1325
		Reply    int `json:"reply"`    // 1181
		Favorite int `json:"favorite"` // 10626
		Coin     int `json:"coin"`     // 13492
		Share    int `json:"share"`    // 1273
		NowRank  int `json:"now_rank"` // 0
		HisRank  int `json:"his_rank"` // 0
		Like     int `json:"like"`     // 18030
		Dislike  int `json:"dislike"`  // 0
		Vt       int `json:"vt"`       // 518998
		Vv       int `json:"vv"`       // 403958
		FavG     int `json:"fav_g"`    // 0
		LikeG    int `json:"like_g"`   // 0
	} `json:"stat"`
	Dynamic   string `json:"dynamic"` // "脆脆鲨组从我关注数到1w的时候就开始企划的手书 ...
	CID       int    `json:"cid"`     // 133606284
	Dimension struct {
		Width  int `json:"width"`  // 1920
		Height int `json:"height"` // 1080
		Rotate int `json:"rotate"` // 0
	} `json:"dimension"`
	ShortLinkV2      string `json:"short_link_v2"`          // "https://b23.tv/BV1vJ411B7ng"
	UpFromV2         int    `json:"up_from_v2,omitempty"`   // 35
	FirstFrame       string `json:"first_frame"`            // "http://i1.hdslb.com/bfs/storyff/n211202qn8mrsxajbj4fpwsrexvbo7ju_firsti.jpg"
	PubLocation      string `json:"pub_location,omitempty"` // "广东"
	VtDisplay        string `json:"vt_display"`             // "51.9万"
	Cover43          string `json:"cover43"`                // ""
	TIDv2            int    `json:"tidv2"`                  // 2020
	Tnamev2          string `json:"tnamev2"`                // "翻唱"
	PidV2            int    `json:"pid_v2"`                 // 1008
	PidNameV2        string `json:"pid_name_v2"`            // "游戏"
	BVID             string `json:"bvid"`                   // "BV1vJ411B7ng"
	Coins            int    `json:"coins"`                  // 2
	Time             int    `json:"time"`                   // 1745738818
	IP               string `json:"ip"`                     // ""
	InterVideo       bool   `json:"inter_video"`            // false
	ResourceType     string `json:"resource_type"`          // "ugc"
	Subtitle         string `json:"subtitle"`               // ""
	EnableVt         int    `json:"enable_vt"`              // 0
	SeasonID         int    `json:"season_id,omitempty"`    // 2832677
	Reason           string `json:"reason"`                 // ""
	IsChargingArc    bool   `json:"is_charging_arc"`        // false
	ElecArcType      int    `json:"elec_arc_type"`          // 0
	PlaybackPosition int    `json:"playback_position"`      // 0
	IsSelfView       bool   `json:"is_self_view"`           // false
}

视频信息

type WebUserInfo

type WebUserInfo struct {
	req.Get
	http.CookieJar
}

查询大会员状态

func (WebUserInfo) RawURL

func (WebUserInfo) RawURL() string

type WebUserInfoResponse

type WebUserInfoResponse struct {
	Error
	Data struct {
		VipPayType         int    `json:"vip_pay_type"`
		VipIsAnnual        bool   `json:"vip_is_annual"`
		VipKeepTime        int    `json:"vip_keep_time"`
		MID                int    `json:"mid"`
		VipIsValid         bool   `json:"vip_is_valid"`
		AvatarSubscriptURL string `json:"avatar_subscript_url"`
		IsAutoRenew        bool   `json:"is_auto_renew"`
		NicknameColor      string `json:"nickname_color"`
		IsNewUser          bool   `json:"is_new_user"`
		VipDueDate         int64  `json:"vip_due_date"`
		VipIsOverdue       bool   `json:"vip_is_overdue"`
		VipType            int    `json:"vip_type"`
		Label              struct {
			Text                  string `json:"text"`
			LabelTheme            string `json:"label_theme"`
			ImgLabelURIHans       string `json:"img_label_uri_hans"`
			ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"`
			TextColor             string `json:"text_color"`
			BgStyle               int    `json:"bg_style"`
			BorderColor           string `json:"border_color"`
			BgColor               string `json:"bg_color"`
			UseImgLabel           bool   `json:"use_img_label"`
			ImgLabelURIHant       string `json:"img_label_uri_hant"`
			ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"`
		} `json:"label"`
		VipStatus       int  `json:"vip_status"`
		AvatarSubscript int  `json:"avatar_subscript"`
		VipExpireDays   int  `json:"vip_expire_days"`
		ThemeType       int  `json:"theme_type"`
		TipMaterial     any  `json:"tip_material"`
		VipIsMonth      bool `json:"vip_is_month"`
	} `json:"data"`
}

func GetWebUserInfo

func GetWebUserInfo(ctx context.Context, jar http.CookieJar) (WebUserInfoResponse, error)

查询大会员状态

type Whispers

type Whispers struct {
	req.Get
	http.CookieJar
}

查询悄悄关注明细

func (Whispers) RawURL

func (Whispers) RawURL() string

type WhispersResponse

type WhispersResponse struct {
	Error
	Data struct {
		List      []RelationItem `json:"list"`
		ReVersion int            `json:"re_version"` // 0
	} `json:"data"`
}

func GetWhispers

func GetWhispers(ctx context.Context, jar http.CookieJar) (WhispersResponse, error)

查询悄悄关注明细

type Withdraw

type Withdraw string

Withdraw 撤回消息内容

func (Withdraw) MsgType

func (Withdraw) MsgType() MsgType

Directories

Path Synopsis
cookie module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL