bilibili

package module
v2.0.0-...-e10c806 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

README

哔哩哔哩-API-Go版本

本项目是基于Go语言编写的哔哩哔哩API调用。目前常用的接口已经基本完成。

本项目不会编写单元测试代码。一则因为各项数据会频繁变动,难以写成固定的结果;二则因为每次单元测试都要大量请求B站API,会对其产生不必要的压力。 如果你发现有接口bug或者有你需要但是本库尚未实现的接口,可以提交issue或者提交pull request。 如果因为B站修改了接口导致接口突然不可用,不一定能够及时更新,很大程度上需要依赖各位的告知。

[!IMPORTANT] 现在是v2版本,v2版本需要Go1.19及以上。如果还想使用v1版本可以点击这里跳转

如果你觉得本项目对你有帮助,点亮右上角的↗ ⭐ 不迷路

声明

  1. 本项目遵守 AGPL 开源协议。
  2. 本项目基于 SocialSisterYi/bilibili-API-collect 中描述的接口编写。请尊重该项目作者的努力,遵循该项目的开源要求,禁止一切商业使用。
  3. 请勿滥用,本项目仅用于学习和测试!利用本项目提供的接口、文档等造成不良影响及后果与本人无关。
  4. 由于本项目的特殊性,可能随时停止开发或删档
  5. 本项目为开源项目,不接受任何形式的催单和索取行为,更不容许存在付费内容

PS:目前,B站调用接口时强制使用 https 协议

快速开始

安装
go get -u github.com/CuteReimu/bilibili/v2

在项目中引用即可使用

import "github.com/CuteReimu/bilibili/v2"

var client = bilibili.New()
首次登录

[!TIP] 下文为了篇幅更短,示例中把很多显而易见的err校验忽略成了_,实际使用请自行校验err

方法一:扫码登录

首先获取二维码:

qrCode, _ := client.GetQRCode()
buf, _ := qrCode.Encode()
img, _ := png.Decode(buf) // 或者写入文件 os.WriteFile("qrcode.png", buf, 0644)
// 也可以调用 qrCode.Print() 将二维码打印在控制台

扫码并确认成功后,发送登录请求:

result, err := client.LoginWithQRCode(bilibili.LoginWithQRCodeParam{
    QrcodeKey: qrCode.QrcodeKey,
})
if err == nil && result.Code == 0 {
    log.Println("登录成功")
}
方法二:账号密码登录

首先获取人机验证参数:

captchaResult, _ := client.Captcha()

captchaResult中的gtchallenge值保存下来,自行使用 手动验证器 进行人机验证,并获得validateseccode。然后使用账号密码进行登录即可:

result, err := client.LoginWithPassword(bilibili.LoginWithPasswordParam{
    Username:  userName,
    Password:  password,
    Token:     captchaResult.Token,
    Challenge: captchaResult.Geetest.Challenge,
    Validate:  validate,
    Seccode:   seccode,
})
if err == nil && result.Status == 0 {
    log.Println("登录成功")
}
方法三:使用短信验证码登录(不推荐)

首先用上述方法二相同的方式获取人机验证参数并进行人机验证。然后获取国际地区代码:

countryCrownResult, _ := client.GetCountryCrown()

当然,如果你已经确定cid的值,这一步可以跳过。中国大陆的cid就是86

然后发送短信验证码:这个接口大概率返回86103错误

sendSMSResult, _ := client.SendSMS(bilibili.SendSMSParam{
    Cid:       cid,
    Tel:       tel,
    Source:    "main_web",
    Token:     captchaResult.Token,
    Challenge: captchaResult.Geetest.Challenge,
    Validate:  validate,
    Seccode:   seccode,
})

然后就可以使用手机验证码登录了:

result, err := client.LoginWithSMS(bilibili.LoginWithSMSParam{
    Cid:        cid,
    Tel:        tel,
    Code:       123456, // 短信验证码
    Source:     "main_web",
    CaptchaKey: sendSMSResult.CaptchaKey,
})
if err == nil && result.Status == 0 {
    log.Println("登录成功")
}
储存Cookies

使用上述任意方式登录成功后,Cookies值就已经设置好了。你可以保存Cookies值方便下次启动程序时不需要重新登录。

// 获取cookiesString,自行存储,方便下次启动程序时不需要重新登录
cookiesString := client.GetCookiesString()

// 设置cookiesString,就不需要登录操作了
client.SetCookiesString(cookiesString)
// 你也可以直接把浏览器的Cookie复制过来调用SetCookiesString,这样也可以不需要登录操作了
其它接口

你可以很方便的调用其它接口,以下举个例子:

videoInfo, err := client.GetVideoInfo(bilibili.VideoParam{
    Aid: 12345678,
})

参数中非必填字段你可以不填(可以通过是否有omitempty来判断这个字段是否为非必填字段)。

方法都是按照对应功能的英文翻译命名的,因此你可以方便地使用IDE找到想要的方法,配合注释便能够知道如何使用。

对B站返回的错误码进行处理

因为B站的返回内容是这样的格式:

{
   "code": 0,
   "message": "错误信息",
   "data": {}
}

而我们这个库的接口只会返回data数据和一个error,若code0errornil,否则我们并不会把codemessage字段直接返回。

在一般情况下,调用者不太需要关心codemessage字段,只需要关心是否有error即可。 但如果你实在需要codemessage字段,我们也提供了一个办法:

videoInfo, err := client.GetVideoInfo(bilibili.VideoParam{
    Aid: 12345678,
})
if err != nil {
    var e bilibili.Error
    if errors.As(err, &e) { // B站返回的错误
        log.Printf("错误码: %d, 错误信息: %s", e.Code, e.Message)
    } else { // 其它错误
        log.Printf("%+v", err)
    }
}

[!TIP] 我们的所有error都包含堆栈信息。如有需要,你可以用log.Printf("%+v", err)打印出堆栈信息,方便追踪错误。

可能用到的工具接口
// 解析短连接
typ, id, err := client.UnwrapShortUrl("https://b23.tv/xxxxxx")

// 获取服务器当前时间
now, err := client.Now()

// av号转bv号
bvid := bilibili.AvToBv(111298867365120)

// bv号转av号
aid := bilibili.BvToAv("BV1L9Uoa9EUx")

// 通过ip确定地理位置
zoneLocation, err := client.GetZoneLocation()

// 获取分区当日投稿稿件数
regionDailyCount, err := client.GetRegionDailyCount()
设置*resty.Client的一些参数

调用client.Resty()就可以获取到*resty.Client,然后自行操作即可。但是不要做一些离谱的操作(比如把Cookies删了)

client.Resty().SetTimeout(20 * time.Second) // 设置超时时间
client.Resty().SetLogger(logger) // 自定义logger

Star History

Star History Chart

如何为仓库做贡献?

不知道在哪些方面可以做贡献?点击这里看看吧!

命名规范和编码风格请参考CONTRIBUTING.md

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResourceTypeVideo     ResourceType = 2  // 视频稿件
	ResourceTypeAudio                  = 12 // 音频
	ResourceTypeVideoList              = 21 // 视频合集
)

Functions

func Av2Bv

func Av2Bv(aid int) string

Av2Bv 将av号转换为bv号,返回格式为"BV1xxxxxxxxx"。

func Bv2Av

func Bv2Av(bvid string) int

Bv2Av 将bv号转换为av号,传入的bv号格式为"BV1xxxxxxxxx",前面的"BV"不区分大小写。

Types

type AccountInformation

type AccountInformation struct {
	Mid      int    `json:"mid"`       // 我的mid
	Uname    string `json:"uname"`     // 我的昵称
	Userid   string `json:"userid"`    // 我的用户名
	Sign     string `json:"sign"`      // 我的签名
	Birthday string `json:"birthday"`  // 我的生日。YYYY-MM-DD
	Sex      string `json:"sex"`       // 我的性别。男 女 保密
	NickFree bool   `json:"nick_free"` // 是否未设置昵称。false:设置过昵称。true:未设置昵称
	Rank     string `json:"rank"`      // 我的会员等级
}

type AddFavourFolderParam

type AddFavourFolderParam struct {
	Title   string `json:"title"`                                       // 收藏夹标题
	Intro   string `json:"intro,omitempty" request:"query,omitempty"`   // 收藏夹简介。默认为空
	Privacy int    `json:"privacy,omitempty" request:"query,omitempty"` // 是否公开。默认为公开。0:公开。1:私密
	Cover   string `json:"cover,omitempty" request:"query,omitempty"`   // 封面图url。封面会被审核
}

type AllFavourFolderInfo

type AllFavourFolderInfo struct {
	Count int `json:"count"` // 创建的收藏夹总数
	List  []struct {
		Id         int    `json:"id"`          // 收藏夹mlid(完整id),收藏夹原始id+创建者mid尾号2位
		Fid        int    `json:"fid"`         // 收藏夹原始id
		Mid        int    `json:"mid"`         // 创建者mid
		Attr       int    `json:"attr"`        // 属性位(?)
		Title      string `json:"title"`       // 收藏夹标题
		FavState   int    `json:"fav_state"`   // 目标id是否存在于该收藏夹,存在于该收藏夹:1,不存在于该收藏夹:0
		MediaCount int    `json:"media_count"` // 收藏夹内容数量
	} `json:"list"`
}

type ArgueInfo

type ArgueInfo struct {
	ArgueLink string `json:"argue_link"` // 作用尚不明确
	ArgueMsg  string `json:"argue_msg"`  // 警告/争议提示信息
	ArgueType int    `json:"argue_type"` // 作用尚不明确
}

type Article

type Article struct {
	Id              int          `json:"id"`         // 专栏文章id
	Category        Category     `json:"category"`   // 分类
	Categories      []Category   `json:"categories"` // 分类
	Title           string       `json:"title"`      // 标题
	Summary         string       `json:"summary"`    // 摘要
	BannerUrl       string       `json:"banner_url"` // 封面图
	TemplateId      int          `json:"template_id"`
	State           int          `json:"state"`
	Author          *Author      `json:"author"` // UP主信息
	Reprint         int          `json:"reprint"`
	ImageUrls       []string     `json:"image_urls"`
	PublishTime     int          `json:"publish_time"` // 发布时间戳。单位:秒
	Ctime           int          `json:"ctime"`        // 提交时间戳。单位:秒
	Stats           ArticleStats `json:"stats"`        // 专栏文章数据统计
	Tags            []ArticleTag `json:"tags"`         // 标签
	Words           int          `json:"words"`
	Dynamic         string       `json:"dynamic"` // 粉丝动态文案
	OriginImageUrls []string     `json:"origin_image_urls"`
	IsLike          bool         `json:"is_like"`
	Media           *Media       `json:"media"`
	ApplyTime       string       `json:"apply_time"` // 空串
	CheckTime       string       `json:"check_time"` // 空串
	Original        int          `json:"original"`
	ActId           int          `json:"act_id"`
	CoverAvid       int          `json:"cover_avid"`
	Type            int          `json:"type"`
	LikeState       int          `json:"like_state"` // 是否点赞。0:未点赞。1:已点赞。需要登录(Cookie) 。未登录为0
}

type ArticleInfo

type ArticleInfo struct {
	Like            int            `json:"like"`              // 是否点赞。0:未点赞。1:已点赞。需要登录(Cookie) 。未登录为0
	Attention       bool           `json:"attention"`         // 是否关注文章作者。false:未关注。true:已关注。需要登录(Cookie) 。未登录为false
	Favorite        bool           `json:"favorite"`          // 是否收藏。false:未收藏。true:已收藏。需要登录(Cookie) 。未登录为false
	Coin            int            `json:"coin"`              // 为文章投币数
	Stats           ArticleStats   `json:"stats"`             // 状态数信息
	Title           string         `json:"title"`             // 文章标题
	BannerUrl       string         `json:"banner_url"`        // 文章头图url
	Mid             int            `json:"mid"`               // 文章作者mid
	AuthorName      string         `json:"author_name"`       // 文章作者昵称
	IsAuthor        bool           `json:"is_author"`         // true。作用尚不明确
	ImageUrls       []string       `json:"image_urls"`        // 动态封面
	OriginImageUrls []string       `json:"origin_image_urls"` // 封面图片
	Shareable       bool           `json:"shareable"`         // true。作用尚不明确
	ShowLaterWatch  bool           `json:"show_later_watch"`  // true。作用尚不明确
	ShowSmallWindow bool           `json:"show_small_window"` // true。作用尚不明确
	InList          bool           `json:"in_list"`           // 是否收于文集。false:否。true:是
	Pre             int            `json:"pre"`               // 上一篇文章cvid。无为0
	Next            int            `json:"next"`              // 下一篇文章cvid。无为0
	ShareChannels   []ShareChannel `json:"share_channels"`    // 分享方式列表
	Type            int            `json:"type"`              // 文章类别。0:文章。2:笔记
}

type ArticleStats

type ArticleStats struct {
	View     int `json:"view"`     // 阅读数
	Favorite int `json:"favorite"` // 收藏数
	Like     int `json:"like"`     // 点赞数
	Dislike  int `json:"dislike"`  // 点踩数
	Reply    int `json:"reply"`    // 评论数
	Share    int `json:"share"`    // 分享数
	Coin     int `json:"coin"`     // 投币数
	Dynamic  int `json:"dynamic"`  // 动态转发数
}

type ArticleTag

type ArticleTag struct {
	Tid  int    `json:"tid"`  // 标签id
	Name string `json:"name"` // 标签名称
}

type Articles

type Articles struct {
	Id            int    `json:"id"`             // 文集rlid
	Mid           int    `json:"mid"`            // 文集作者mid
	Name          string `json:"name"`           // 文集名称
	ImageUrl      string `json:"image_url"`      // 文集封面图片url
	UpdateTime    int    `json:"update_time"`    // 文集更新时间。时间戳
	Ctime         int    `json:"ctime"`          // 文集创建时间。时间戳
	PublishTime   int    `json:"publish_time"`   // 文集发布时间。时间戳
	Summary       string `json:"summary"`        // 文集简介
	Words         int    `json:"words"`          // 文集字数
	Read          int    `json:"read"`           // 文集阅读量
	ArticlesCount int    `json:"articles_count"` // 文集内文章数量
	State         int    `json:"state"`          // 1或3。作用尚不明确
	Reason        string `json:"reason"`         // 空。作用尚不明确
	ApplyTime     string `json:"apply_time"`     // 空。作用尚不明确
	CheckTime     string `json:"check_time"`     // 空。作用尚不明确
}

type ArticlesInfo

type ArticlesInfo struct {
	List      Articles  `json:"list"`      // 文集概览
	Articles  []Article `json:"articles"`  // 文集内的文章列表
	Author    Author    `json:"author"`    // 文集作者信息
	Last      Article   `json:"last"`      // -。作用尚不明确。结构与data.articles[]中相似
	Attention bool      `json:"attention"` // 是否关注文集作者。false:未关注。true:已关注。需要登录(Cookie) 。未登录为false
}

type Author

type Author struct {
	Mid            int            `json:"mid"`             // 作者mid
	Name           string         `json:"name"`            // 作者昵称
	Face           string         `json:"face"`            // 作者头像url
	OfficialVerify OfficialVerify `json:"official_verify"` // 作者认证信息
	Nameplate      Nameplate      `json:"nameplate"`       // 作者勋章
	Vip            Vip            `json:"vip"`             // 作者大会员状态
}

type AvatarPendant

type AvatarPendant struct {
	Image             string `json:"image"`               // 头像框 url
	ImageEnhance      string `json:"image_enhance"`       // 头像框 url。动态图
	ImageEnhanceFrame string `json:"image_enhance_frame"` // 动态头像框帧波普版 url
}

type Badge

type Badge struct {
	Name     string `json:"name"`     // 类型。v_person: 个人认证(黄) 。 v_company: 企业认证(蓝)
	Position int    `json:"position"` // 位置
	Value    string `json:"value"`    // 值
	Desc     string `json:"desc"`     // 描述
}
type Banner struct {
	Id          int    `json:"id"`           // banner 卡片 id
	Index       int    `json:"index"`        // banner 卡片排序
	Image       string `json:"image"`        // banner 卡片图片 url
	Title       string `json:"title"`        // banner 卡片标题
	Uri         string `json:"uri"`          // banner 卡片跳转页 url
	TrackParams any    `json:"track_params"` // 上报参数
}

type BigPoint

type BigPoint struct {
	PointInfo      PointInfo `json:"point_info"` // 点数信息
	SignInfo       SignInfo  `json:"sign_info"`  // 签到信息
	SkuInfo        any       `json:"sku_info"`   // 大积分商品预览
	Tips           bool      `json:"tips"`
	PointSwitchOff any       `json:"point_switch_off"`
}

type CaptchaResult

type CaptchaResult struct {
	Geetest Geetest `json:"geetest"` // 极验captcha数据
	Tencent any     `json:"tencent"` // (?)。**作用尚不明确**
	Token   string  `json:"token"`   // 登录 API token。与 captcha 无关,与登录接口有关
	Type    string  `json:"type"`    // 验证方式。用于判断使用哪一种验证方式,目前所见只有极验。geetest:极验
}

type CardLabel

type CardLabel struct {
	Rpid             int    `json:"rpid"`              // 评论 rpid
	TextContent      string `json:"text_content"`      // 标签文本。已知有妙评
	TextColorDay     string `json:"text_color_day"`    // 日间文本颜色。十六进制颜色值,下同
	TextColorNight   string `json:"text_color_night"`  // 夜间文本颜色
	LabelColorDay    string `json:"label_color_day"`   // 日间标签颜色
	LabelColorNight  string `json:"label_color_night"` // 夜间标签颜色
	Image            string `json:"image"`             // 作用不明
	Type             string `json:"type"`              // 1。作用不明
	Background       string `json:"background"`        // 背景图片 url
	BackgroundWidth  int    `json:"background_width"`  // 背景图片宽度
	BackgroundHeight int    `json:"background_height"` // 背景图片高度
	JumpUrl          string `json:"jump_url"`          // 跳转链接
	Effect           int    `json:"effect"`            // 0。作用不明,可能用于控制动画,下同
	EffectStartTime  int    `json:"effect_start_time"` // 0
}

type CardSpace

type CardSpace struct {
	SImg string `json:"s_img"` // 主页头图url 小图
	LImg string `json:"l_img"` // 主页头图url 正常
}

type CardVip

type CardVip struct {
	Type               int    `json:"type"`                 // 会员类型。0:无。1:月大会员。2:年度及以上大会员
	Status             int    `json:"status"`               // 会员状态。0:无。1:有
	DueDate            int    `json:"due_date"`             // 会员过期时间。Unix时间戳(毫秒)
	VipPayType         int    `json:"vip_pay_type"`         // 支付类型。0:未支付(常见于官方账号)。1:已支付(以正常渠道获取的大会员均为此值)
	ThemeType          int    `json:"theme_type"`           // 0。作用尚不明确
	Label              Label  `json:"label"`                // 会员标签
	AvatarSubscript    int    `json:"avatar_subscript"`     // 是否显示会员图标。0:不显示。1:显示
	NicknameColor      string `json:"nickname_color"`       // 会员昵称颜色。颜色码,一般为#FB7299,曾用于愚人节改变大会员配色
	Role               int    `json:"role"`                 // 大角色类型。1:月度大会员。3:年度大会员。7:十年大会员。15:百年大会员
	AvatarSubscriptUrl string `json:"avatar_subscript_url"` // 大会员角标地址
	TvVipStatus        int    `json:"tv_vip_status"`        // 电视大会员状态。0:未开通
	TvVipPayType       int    `json:"tv_vip_pay_type"`      // 电视大会员支付类型
}

type Cardbg

type Cardbg struct {
	Id      int    `json:"id"`       // 评论条目装扮 id
	Name    string `json:"name"`     // 评论条目装扮名称
	Image   string `json:"image"`    // 评论条目装扮图片 url
	JumpUrl string `json:"jump_url"` // 评论条目装扮商城页面 url
	Fan     Fan    `json:"fan"`      // 粉丝专属信息
	Type    string `json:"type"`     // 装扮类型。suit:一般装扮。vip_suit:vip 装扮
}

type Category

type Category struct {
	Id       int    `json:"id"`        // 分类id
	ParentId int    `json:"parent_id"` // 父级分类id
	Name     string `json:"name"`      // 分类名称
}

type CheckNickNameParam

type CheckNickNameParam struct {
	Nickname string `json:"nickName"` // 目标昵称。最长为16字符
}

type ChildPrivilege

type ChildPrivilege struct {
	FirstId            int    `json:"first_id"`             // 特权父类 id
	ReportId           string `json:"report_id"`            // 上报 id。该特权的代号?
	Name               string `json:"name"`                 // 特权名称
	Desc               string `json:"desc"`                 // 特权简介文案
	Explain            string `json:"explain"`              // 特权介绍正文
	IconUrl            string `json:"icon_url"`             // 特权图标 url
	IconGrayUrl        string `json:"icon_gray_url"`        // 特权图标灰色主题 url。某些项目无此字段
	BackgroundImageUrl string `json:"background_image_url"` // 背景图片 url
	Link               string `json:"link"`                 // 特权介绍页 url
	ImageUrl           string `json:"image_url"`            // 特权示例图 url
	Type               int    `json:"type"`                 // 类型?。目前为0
	HotType            int    `json:"hot_type"`             // 是否热门特权。0:普通特权。1:热门特权
	NewType            int    `json:"new_type"`             // 是否新特权。0:普通特权。1:新特权
	Id                 int    `json:"id"`                   // 特权子类 id
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New() *Client

New 返回一个默认的 bilibili.Client

func NewWithClient

func NewWithClient(restyClient *resty.Client) *Client

NewWithClient 接收一个自定义的*resty.Client为参数

func (*Client) AddFavourFolder

func (c *Client) AddFavourFolder(param AddFavourFolderParam) (*FavourFolderInfo, error)

AddFavourFolder 新建收藏夹

func (*Client) Captcha

func (c *Client) Captcha() (*CaptchaResult, error)

Captcha 申请验证码参数

func (*Client) CheckNickName

func (c *Client) CheckNickName(param CheckNickNameParam) error

CheckNickName 检查昵称是否可注册

func (*Client) CleanFavourResources

func (c *Client) CleanFavourResources(param MediaIdParam) error

CleanFavourResources 清空所有失效收藏内容

func (*Client) ClearHistory

func (c *Client) ClearHistory() error

ClearHistory 清空历史记录

func (*Client) CoinArticle

func (c *Client) CoinArticle(param CoinArticleParam) (*CoinArticleResult, error)

CoinArticle 投币文章

func (*Client) CoinVideo

func (c *Client) CoinVideo(param CoinVideoParam) (*CoinVideoResult, error)

CoinVideo 投币视频

func (*Client) CopyFavourResources

func (c *Client) CopyFavourResources(param MoveFavourResourcesParam) error

CopyFavourResources 批量复制收藏内容

func (*Client) CreateDynamic

func (c *Client) CreateDynamic(param CreateDynamicParam) (*CreateDynamicResult, error)

CreateDynamic 发表纯文本动态

func (*Client) DeleteFavourFolder

func (c *Client) DeleteFavourFolder(param DeleteFavourFolderParam) error

DeleteFavourFolder 删除收藏夹

func (*Client) DeleteFavourResources

func (c *Client) DeleteFavourResources(param DeleteFavourResourcesParam) error

DeleteFavourResources 批量删除收藏内容

func (*Client) EditFavourFolder

func (c *Client) EditFavourFolder(param EditFavourFolderParam) (*FavourFolderInfo, error)

EditFavourFolder 修改收藏夹

func (*Client) FavoritesArticle

func (c *Client) FavoritesArticle(param FavoritesArticleParam) error

FavoritesArticle 收藏文章

func (*Client) FavourVideo

func (c *Client) FavourVideo(param FavourVideoParam) (*FavourVideoResult, error)

FavourVideo 收藏视频

func (*Client) GetAccountInformation

func (c *Client) GetAccountInformation() (*AccountInformation, error)

GetAccountInformation 获取我的信息

func (*Client) GetAllFavourFolderInfo

func (c *Client) GetAllFavourFolderInfo(param GetAllFavourFolderInfoParam) (*AllFavourFolderInfo, error)

GetAllFavourFolderInfo 获取指定用户创建的所有收藏夹信息

func (*Client) GetArticleInfo

func (c *Client) GetArticleInfo(param GetArticleInfoParam) (*ArticleInfo, error)

GetArticleInfo 获取专栏文章基本信息

func (*Client) GetArticlesInfo

func (c *Client) GetArticlesInfo(param GetArticlesInfoParam) (*ArticlesInfo, error)

GetArticlesInfo 获取文集基本信息

func (*Client) GetCommentReply

func (c *Client) GetCommentReply(param GetCommentReplyParam) (*CommentReply, error)

GetCommentReply 获取指定评论的回复,按照回复顺序排序

func (*Client) GetCommentsDetail

func (c *Client) GetCommentsDetail(param GetCommentsDetailParam) (*CommentsDetail, error)

GetCommentsDetail 获取评论区明细

func (*Client) GetCommentsHotReply

func (c *Client) GetCommentsHotReply(param GetCommentsHotReplyParam) (*CommentsHotReply, error)

GetCommentsHotReply 获取评论区热评

func (*Client) GetCookies

func (c *Client) GetCookies() []*http.Cookie

GetCookies 获取当前的cookies

func (*Client) GetCookiesString

func (c *Client) GetCookiesString() string

GetCookiesString 获取字符串格式的cookies,方便自行存储后下次使用。配合下面的 SetCookiesString 使用。

func (*Client) GetCountryCrown

func (c *Client) GetCountryCrown() (*GetCountryCrownResult, error)

GetCountryCrown 获取国际冠字码

func (*Client) GetDynamicDetail

func (c *Client) GetDynamicDetail(param GetDynamicDetailParam) (*DynamicDetail, error)

GetDynamicDetail 获取特定动态卡片信息

func (*Client) GetDynamicLikeList

func (c *Client) GetDynamicLikeList(param GetDynamicLikeListParam) (*DynamicLikeList, error)

GetDynamicLikeList 获取动态点赞列表

func (*Client) GetDynamicLiveUserList

func (c *Client) GetDynamicLiveUserList(param GetDynamicLiveUserListParam) (*DynamicLiveUserList, error)

GetDynamicLiveUserList 获取正在直播的已关注者

func (*Client) GetDynamicPortal

func (c *Client) GetDynamicPortal() (*DynamicPortal, error)

GetDynamicPortal 获取最近更新UP主列表(其实就是获取自己的动态门户)

func (*Client) GetDynamicRepostDetail

func (c *Client) GetDynamicRepostDetail(param GetDynamicRepostDetailParam) (*DynamicRepostDetail, error)

GetDynamicRepostDetail 获取动态转发列表

https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/dynamic/basicInfo.md

func (*Client) GetDynamicUpList

func (c *Client) GetDynamicUpList(param GetDynamicUpListParam) (*DynamicUpList, error)

GetDynamicUpList 获取发布新动态的已关注者

func (*Client) GetFavourFolderInfo

func (c *Client) GetFavourFolderInfo(param MediaIdParam) (*FavourFolderInfo, error)

GetFavourFolderInfo 获取收藏夹元数据

func (*Client) GetFavourIds

func (c *Client) GetFavourIds(param GetFavourIdsParam) ([]FavourId, error)

GetFavourIds 获取收藏夹全部内容id

func (*Client) GetFavourInfo

func (c *Client) GetFavourInfo(param GetFavourInfoParam) ([]FavourInfo, error)

GetFavourInfo 获取收藏内容

func (*Client) GetFavourList

func (c *Client) GetFavourList(param GetFavourListParam) (*FavourList, error)

GetFavourList 获取收藏夹内容明细列表

func (*Client) GetLiveAreaList

func (c *Client) GetLiveAreaList() ([]LiveAreaList, error)

GetLiveAreaList 获取全部直播间分区列表

func (*Client) GetLiveRoomInfo

func (c *Client) GetLiveRoomInfo(param GetLiveRoomInfoParam) (*RoomInfo, error)

GetLiveRoomInfo 获取直播间信息

func (*Client) GetPrivateMessageList

func (c *Client) GetPrivateMessageList(param GetPrivateMessageListParam) (*PrivateMessageList, error)

GetPrivateMessageList 获取消息列表 session_type,1:系统,2:用户,3:应援团

参照 https://github.com/CuteReimu/bilibili/issues/8

func (*Client) GetPrivateMessageRecords

func (c *Client) GetPrivateMessageRecords(param GetPrivateMessageRecordsParam) (*PrivateMessageRecords, error)

GetPrivateMessageRecords 获取私信消息记录

func (*Client) GetQRCode

func (c *Client) GetQRCode() (*QRCode, error)

GetQRCode 申请二维码

func (*Client) GetRegionDailyCount

func (c *Client) GetRegionDailyCount() (*RegionDailyCount, error)

GetRegionDailyCount 获取分区当日投稿稿件数

func (*Client) GetTopRecommendVideo

func (c *Client) GetTopRecommendVideo(param GetTopRecommendVideoParam) ([]VideoInfo, error)

GetTopRecommendVideo 获取首页视频推荐列表

func (*Client) GetUnreadMessage

func (c *Client) GetUnreadMessage() (*UnreadMessage, error)

GetUnreadMessage 获取未读消息数

func (*Client) GetUnreadPrivateMessage

func (c *Client) GetUnreadPrivateMessage() (*UnreadPrivateMessage, error)

GetUnreadPrivateMessage 获取未读私信数

func (*Client) GetUserArticleList

func (c *Client) GetUserArticleList(param GetUserArticleListParam) (*UserArticleList, error)

GetUserArticleList 获取用户专栏文章列表

func (*Client) GetUserArticlesList

func (c *Client) GetUserArticlesList(param GetUserArticlesListParam) (*UserArticlesList, error)

GetUserArticlesList 获取用户专栏文集列表

func (*Client) GetUserSpaceDynamic

func (c *Client) GetUserSpaceDynamic(param GetUserSpaceDynamicParam) (*DynamicInfo, error)

GetUserSpaceDynamic 获取用户空间动态,mid就是用户UID,无需登录。

返回结构较为繁琐,见 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/dynamic/space.md

func (*Client) GetUserVideos

func (c *Client) GetUserVideos(param GetUserVideosParam) (*UserVideos, error)

GetUserVideos 查询用户投稿视频明细

func (*Client) GetVideoDesc

func (c *Client) GetVideoDesc(param VideoParam) (string, error)

GetVideoDesc 获取视频简介

func (*Client) GetVideoDetailInfo

func (c *Client) GetVideoDetailInfo(param VideoParam) (*VideoDetailInfo, error)

GetVideoDetailInfo 获取视频超详细信息

func (*Client) GetVideoInfo

func (c *Client) GetVideoInfo(param VideoParam) (*VideoInfo, error)

GetVideoInfo 获取视频详细信息

func (*Client) GetVideoOnlineInfo

func (c *Client) GetVideoOnlineInfo(param VideoCidParam) (*VideoOnlineInfo, error)

GetVideoOnlineInfo 获取视频在线人数

func (*Client) GetVideoPageList

func (c *Client) GetVideoPageList(param VideoParam) ([]VideoPage, error)

GetVideoPageList 获取视频分P列表

func (*Client) GetVideoRecommendList

func (c *Client) GetVideoRecommendList(param VideoParam) ([]VideoInfo, error)

GetVideoRecommendList 获取单视频推荐列表

func (*Client) GetVideoSeriesInfo

func (c *Client) GetVideoSeriesInfo(param GetVideoSeriesInfoParam) (*VideoCollectionInfo, error)

GetVideoSeriesInfo 获取视频列表信息(在个人空间里创建的叫做视频列表,在创作中心里创建的叫合集,注意区分)

func (*Client) GetVideoStatusNumber

func (c *Client) GetVideoStatusNumber(param VideoParam) (*VideoStatusNumber, error)

GetVideoStatusNumber 获取视频状态数视频

func (*Client) GetVideoTags

func (c *Client) GetVideoTags(param VideoParam) ([]VideoTag, error)

GetVideoTags 获取视频TAG

func (*Client) GetVipCenterInfo

func (c *Client) GetVipCenterInfo(param GetVipCenterInfoParam) (*VipCenterInfo, error)

GetVipCenterInfo 获取大会员中心信息

func (*Client) GetVipPrivilege

func (c *Client) GetVipPrivilege() (*VipPrivilege, error)

GetVipPrivilege 卡券状态查询

func (*Client) GetZoneLocation

func (c *Client) GetZoneLocation() (*ZoneLocation, error)

GetZoneLocation 通过ip确定地理位置

func (*Client) HateVideoTag

func (c *Client) HateVideoTag(param VideoTagParam) error

HateVideoTag 点踩视频TAG,重复访问为取消

func (*Client) LikeArticle

func (c *Client) LikeArticle(param LikeArticleParam) error

LikeArticle 点赞文章

func (*Client) LikeCoinFavourVideo

func (c *Client) LikeCoinFavourVideo(param VideoParam) (*LikeCoinFavourResult, error)

LikeCoinFavourVideo 一键三连视频

func (*Client) LikeVideo

func (c *Client) LikeVideo(param LikeVideoParam) error

LikeVideo 点赞视频

func (*Client) LikeVideoTag

func (c *Client) LikeVideoTag(param VideoTagParam) error

LikeVideoTag 点赞视频TAG,重复请求为取消

func (*Client) LoginWithPassword

func (c *Client) LoginWithPassword(param LoginWithPasswordParam) (*LoginWithPasswordResult, error)

LoginWithPassword 账号密码登录,其中validate, seccode字段需要在极验人机验证后获取

func (*Client) LoginWithQRCode

func (c *Client) LoginWithQRCode(param LoginWithQRCodeParam) (*LoginWithQRCodeResult, error)

LoginWithQRCode 使用扫码登录。

该方法会阻塞直到扫码成功或者已经无法扫码。

func (*Client) LoginWithSMS

func (c *Client) LoginWithSMS(param LoginWithSMSParam) (*LoginWithSMSResult, error)

LoginWithSMS 使用短信验证码登录

func (*Client) MoveFavourResources

func (c *Client) MoveFavourResources(param MoveFavourResourcesParam) error

MoveFavourResources 批量复制收藏内容

func (*Client) Now

func (c *Client) Now() (time.Time, error)

Now 获取服务器当前时间

func (*Client) ReceiveVipPrivilege

func (c *Client) ReceiveVipPrivilege(param ReceiveVipPrivilegeParam) error

ReceiveVipPrivilege 兑换大会员卡券,1:B币券,2:会员购优惠券,3:漫画福利券,4:会员购包邮券,5:漫画商城优惠券

func (*Client) RemoveDynamic

func (c *Client) RemoveDynamic(param RemoveDynamicParam) error

RemoveDynamic 删除动态

func (*Client) Resty

func (c *Client) Resty() *resty.Client

func (*Client) SearchDynamicAt

func (c *Client) SearchDynamicAt(param SearchDynamicAtParam) (*SearchDynamicAtResult, error)

SearchDynamicAt 根据关键字搜索用户(at别人时的填充列表)

func (*Client) SendPrivateMessage

func (c *Client) SendPrivateMessage(param SendPrivateMessageParam) (*SendPrivateMessageResult, error)

SendPrivateMessage 发送私信(文字消息)

func (*Client) SendSMS

func (c *Client) SendSMS(param SendSMSParam) (*SendSMSResult, error)

SendSMS 发送短信验证码

func (*Client) SetCookies

func (c *Client) SetCookies(cookies []*http.Cookie)

SetCookies 设置cookies

func (*Client) SetCookiesString

func (c *Client) SetCookiesString(cookiesString string)

SetCookiesString 设置Cookies,但是是字符串格式,配合 GetCookiesString 使用。有些功能必须登录或设置Cookies后才能使用。

你也可以将浏览器中的Cookie传入这个函数使用。

func (*Client) SignVipScore

func (c *Client) SignVipScore() error

SignVipScore 大积分签到

func (*Client) StartLive

func (c *Client) StartLive(param StartLiveParam) (*StartLiveResult, error)

StartLive 开始直播

func (*Client) StopLive

func (c *Client) StopLive(param StopLiveParam) (*StopLiveResult, error)

StopLive 关闭直播

func (*Client) UnwrapShortUrl

func (c *Client) UnwrapShortUrl(shortUrl string) (string, any, error)

UnwrapShortUrl 解析短链接,传入一个完整的短链接。

第一个返回值如果是"bvid",则第二个返回值是视频的bvid (string)。 第一个返回值如果是"live",则第二个返回值是直播间id (int)。

func (*Client) UpdateLiveRoomTitle

func (c *Client) UpdateLiveRoomTitle(param UpdateLiveRoomTitleParam) error

UpdateLiveRoomTitle 更新直播间标题

func (*Client) UploadDynamicBfs

func (c *Client) UploadDynamicBfs(fileName string, file io.Reader, category string) (url string, size Size, err error)

UploadDynamicBfs 为图片动态上传图片

type CntInfo

type CntInfo struct {
	Collect int `json:"collect"`  // 收藏数
	Play    int `json:"play"`     // 播放数
	ThumbUp int `json:"thumb_up"` // 点赞数
	Share   int `json:"share"`    // 分享数
}

type CoinArticleParam

type CoinArticleParam struct {
	Aid      int `json:"aid"`      // 文章cvid
	Upid     int `json:"upid"`     // 文章作者mid
	Multiply int `json:"multiply"` // 投币数量。上限为2
	Avtype   int `json:"avtype"`   // 2。必须为2
}

type CoinArticleResult

type CoinArticleResult struct {
	Like bool `json:"like"` // 是否点赞成功。true:成功。false:失败。已赞过则附加点赞失败
}

type CoinVideoParam

type CoinVideoParam struct {
	Aid        int    `json:"aid,omitempty" request:"query,omitempty"`         // 稿件 avid。avid 与 bvid 任选一个
	Bvid       string `json:"bvid,omitempty" request:"query,omitempty"`        // 稿件 bvid。avid 与 bvid 任选一个
	Multiply   int    `json:"multiply"`                                        // 投币数量。上限为2
	SelectLike int    `json:"select_like,omitempty" request:"query,omitempty"` // 是否附加点赞。0:不点赞。1:同时点赞。默认为0
}

type CoinVideoResult

type CoinVideoResult struct {
	Like bool `json:"like"` // 是否点赞成功。true:成功。false:失败。已赞过则附加点赞失败
}

type CollectionMeta

type CollectionMeta struct {
	Category    int    `json:"category"`    // 0
	Covr        string `json:"covr"`        // 合集封面 URL
	Description string `json:"description"` // 合集描述
	Mid         int    `json:"mid"`         // UP 主 ID
	Name        int    `json:"name"`        // 合集标题
	Ptime       int    `json:"ptime"`       // 发布时间。Unix 时间戳
	SeasonId    int    `json:"season_id"`   // 合集 ID
	Total       int    `json:"total"`       // 合集内视频数量
}

type CollectionPage

type CollectionPage struct {
	PageNum  int `json:"page_num"`  // 分页页码
	PageSize int `json:"page_size"` // 单页个数
	Total    int `json:"total"`     // 合集内视频数量
}

type CollectionVideo

type CollectionVideo struct {
	Aid              int                 `json:"aid"`               // 稿件avid
	Bvid             string              `json:"bvid"`              // 稿件bvid
	Ctime            int                 `json:"ctime"`             // 创建时间。Unix 时间戳
	Duration         int                 `json:"duration"`          // 视频时长。单位为秒
	EnableVt         any                 `json:"enable_vt"`         // int or bool
	InteractiveVideo bool                `json:"interactive_video"` // false
	Pic              string              `json:"pic"`               // 封面 URL
	PlaybackPosition int                 `json:"playback_position"` // 会随着播放时间增长,播放完成后为 -1 。单位未知
	Pubdate          int                 `json:"pubdate"`           // 发布日期。Unix 时间戳
	Stat             CollectionVideoStat `json:"stat"`              // 稿件信息
	State            int                 `json:"state"`             // 0
	Title            string              `json:"title"`             // 稿件标题
	UgcPay           int                 `json:"ugc_pay"`           // 0
	VtDisplay        string              `json:"vt_display"`
}

type CollectionVideoStat

type CollectionVideoStat struct {
	View int `json:"view"` // 稿件播放量
	Vt   int `json:"vt"`   // 0
}

type Comment

type Comment struct {
	Rpid         int            `json:"rpid"`          // 评论 rpid
	Oid          int            `json:"oid"`           // 评论区对象 id
	Type         int            `json:"type"`          // 评论区类型代码。
	Mid          int            `json:"mid"`           // 发送者 mid
	Root         int            `json:"root"`          // 根评论 rpid。若为一级评论则为 0。大于一级评论则为根评论 id
	Parent       int            `json:"parent"`        // 回复父评论 rpid。若为一级评论则为 0。若为二级评论则为根评论 rpid。大于二级评论为上一级评 论 rpid
	Dialog       int            `json:"dialog"`        // 回复对方 rpid。若为一级评论则为 0。若为二级评论则为该评论 rpid。大于二级评论为上一级评论 rpid
	Count        int            `json:"count"`         // 二级评论条数
	Rcount       int            `json:"rcount"`        // 回复评论条数
	Floor        int            `json:"floor"`         // 评论楼层号。**注:若不支持楼层则无此项**
	State        int            `json:"state"`         // (?)
	Fansgrade    int            `json:"fansgrade"`     // 是否具有粉丝标签。0:无。1:有
	Attr         int            `json:"attr"`          // 某属性位?
	Ctime        int            `json:"ctime"`         // 评论发送时间。时间戳
	RpidStr      string         `json:"rpid_str"`      // 评论rpid。字串格式
	RootStr      string         `json:"root_str"`      // 根评论rpid。字串格式
	ParentStr    string         `json:"parent_str"`    // 回复父评论rpid。字串格式
	Like         int            `json:"like"`          // 评论获赞数
	Action       int            `json:"action"`        // 当前用户操作状态。需要登录(Cookie 或 APP) 。否则恒为 0。0:无。1:已点赞。2:已点踩
	Member       Member         `json:"member"`        // 评论发送者信息
	Content      CommentContent `json:"content"`       // 评论信息
	Replies      []*Comment     `json:"replies"`       // 评论回复条目预览。**仅嵌套一层**。否则为 null
	Assist       int            `json:"assist"`        // (?)
	Folder       Folder         `json:"folder"`        // 折叠信息
	UpAction     UpAction       `json:"up_action"`     // 评论 UP 主操作信息
	ShowFollow   bool           `json:"show_follow"`   // (?)
	Invisible    bool           `json:"invisible"`     // 评论是否被隐藏
	CardLabel    CardLabel      `json:"card_label"`    // 右上角卡片标签信息
	ReplyControl ReplyControl   `json:"reply_control"` // 评论提示文案信息
}

type CommentContent

type CommentContent struct {
	Message  string    `json:"message"`  // 评论内容。**重要**
	Plat     int       `json:"plat"`     // 评论发送端。1:web端。2:安卓客户端。3:ios 客户端。4:wp 客户端
	Device   string    `json:"device"`   // 评论发送平台设备
	Members  []Member  `json:"members"`  // at 到的用户信息
	Emote    any       `json:"emote"`    // 需要渲染的表情转义。评论内容无表情则无此项
	JumpUrl  any       `json:"jump_url"` // 需要高亮的超链转义
	MaxLine  int       `json:"max_line"` // 6。收起最大行数
	Pictures []Picture `json:"pictures"` // 评论图片数组
}

type CommentReply

type CommentReply struct {
	Config   CommentsConfig  `json:"config"`    // 评论区显示控制
	Control  CommentsControl `json:"control"`   // 评论区输入属性
	Page     CommentsPage    `json:"page"`      // 页面信息
	Replies  []*Comment      `json:"replies"`   // 评论对话树列表。最大内容数为20
	Root     *Comment        `json:"root"`      // 根评论信息
	ShowBvid bool            `json:"show_bvid"` // 显示 bvid?
	ShowText string          `json:"show_text"` // (?)
	ShowType int             `json:"show_type"` // (?)
	Upper    Upper           `json:"upper"`     // UP主 mid
}

type CommentsConfig

type CommentsConfig struct {
	Showadmin  int  `json:"showadmin"`    // 是否显示管理置顶
	Showentry  int  `json:"showentry"`    // (?)
	Showfloor  int  `json:"showfloor"`    // 是否显示楼层号
	Showtopic  int  `json:"showtopic"`    // 是否显示话题
	ShowUpFlag bool `json:"show_up_flag"` // 是否显示“UP 觉得很赞”标志
	ReadOnly   bool `json:"read_only"`    // 是否只读评论区
	ShowDelLog bool `json:"show_del_log"` // 是否显示删除记录
}

type CommentsControl

type CommentsControl struct {
	InputDisable          bool   `json:"input_disable"`            // 是否禁止新增评论。用户涉及合约争议,锁定该用户所有稿件、动态的评论区,不允许新增评论,root_input_text和child_input_text值为“当前评论区不可新增评论”
	RootInputText         string `json:"root_input_text"`          // 评论框文字
	ChildInputText        string `json:"child_input_text"`         // 评论框文字
	BgText                string `json:"bg_text"`                  // 空评论区文字
	WebSelection          bool   `json:"web_selection"`            // 评论是否筛选后可见。false:无需筛选。true:需要筛选
	AnswerGuideText       string `json:"answer_guide_text"`        // 答题页面链接文字
	AnswerGuideIconUrl    string `json:"answer_guide_icon_url"`    // 答题页面图标 url
	AnswerGuideIosUrl     string `json:"answer_guide_ios_url"`     // 答题页面 ios url
	AnswerGuideAndroidUrl string `json:"answer_guide_android_url"` // 答题页面安卓 url
}

type CommentsDetail

type CommentsDetail struct {
	Page        CommentsPage    `json:"page"`         // 页信息
	Config      CommentsConfig  `json:"config"`       // 评论区显示控制
	Replies     []*Comment      `json:"replies"`      // 评论列表
	Hots        []*Comment      `json:"hots"`         // 热评列表
	Upper       *Comment        `json:"upper"`        // 置顶评论
	Top         any             `json:"top"`          // (?)
	Notice      *Notice         `json:"notice"`       // 评论区公告信息
	Vote        int             `json:"vote"`         // 投票评论?
	Blacklist   int             `json:"blacklist"`    // (?)
	Assist      int             `json:"assist"`       // (?)
	Mode        int             `json:"mode"`         // 评论区类型id
	SupportMode []int           `json:"support_mode"` // 评论区支持的类型id
	Folder      Folder          `json:"folder"`       // 折叠相关信息
	LotteryCard any             `json:"lottery_card"` // (?)
	ShowBvid    bool            `json:"show_bvid"`    // 显示bvid?
	Control     CommentsControl `json:"control"`      // 评论区输入属性
}

type CommentsHotReply

type CommentsHotReply struct {
	Page    CommentsPage `json:"page"`    // 页面信息
	Replies []Comment    `json:"replies"` // 热评列表
}

type CommentsPage

type CommentsPage struct {
	Num    int `json:"num"`    // 当前页码
	Size   int `json:"size"`   // 每页项数
	Count  int `json:"count"`  // 根评论条数
	Acount int `json:"acount"` // 总计评论条数
}

type CountryCrown

type CountryCrown struct {
	Id        int    `json:"id"`         // 国际代码值
	Cname     string `json:"cname"`      // 国家或地区名
	CountryId string `json:"country_id"` // 国家或地区区号
}

type CreateDynamicParam

type CreateDynamicParam struct {
	DynamicId       int          `json:"dynamic_id"`                                            // 0
	Type            int          `json:"type"`                                                  // 4
	Rid             int          `json:"rid"`                                                   // 0
	Content         string       `json:"content"`                                               // 动态内容
	UpChooseComment int          `json:"up_choose_comment,omitempty" request:"query,omitempty"` // 0
	UpCloseComment  int          `json:"up_close_comment,omitempty" request:"query,omitempty"`  // 0
	Extension       string       `json:"extension,omitempty" request:"query,omitempty"`         // 位置信息,参考 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/dynamic/publish.md
	AtUids          string       `json:"at_uids,omitempty" request:"query,omitempty"`           // 动态中 at 到的用户的 uid。使用逗号,分隔
	Ctrl            []FormatCtrl `json:"ctrl,omitempty" request:"query,omitempty"`              // 特殊格式控制 (如 at 别人时的蓝字体和链接)
}

type CreateDynamicResult

type CreateDynamicResult struct {
	Result       int    `json:"result"`         // 0
	Errmsg       string `json:"errmsg"`         // 像是服务器日志一样的东西
	DynamicId    int    `json:"dynamic_id"`     // 动态 id
	CreateResult int    `json:"create_result"`  // 1
	DynamicIdStr string `json:"dynamic_id_str"` // 动态 id。字符串格式
	Gt           int    `json:"_gt_"`           // 0
}

type DeleteFavourFolderParam

type DeleteFavourFolderParam struct {
	MediaIds []int `json:"media_ids"` // 目标收藏夹mdid列表
}

type DeleteFavourResourcesParam

type DeleteFavourResourcesParam struct {
	Resources []int  `json:"resources"`                                    // 目标内容id列表。格式:{内容id}:{内容类型}。类型:2:视频稿件。12:音频。21:视频合集。内容id:。视频稿件:视频稿件avid。音频:音频auid。视频合集:视频合集id
	MediaId   int    `json:"media_id"`                                     // 目标收藏夹id
	Platform  string `json:"platform,omitempty" request:"query,omitempty"` // 平台标识。可为web
}

type DescV2

type DescV2 struct {
	RawText string `json:"raw_text"` // 简介内容。type=1时显示原文。type=2时显示'@'+raw_text+' '并链接至biz_id的主页
	Type    int    `json:"type"`     // 类型。1:普通,2:@他人
	BizId   int    `json:"biz_id"`   // 被@用户的mid。=0,当type=1
}

type Dimension

type Dimension struct {
	Width  int `json:"width"`  // 当前分P 宽度
	Height int `json:"height"` // 当前分P 高度
	Rotate int `json:"rotate"` // 是否将宽高对换。0:正常。1:对换
}

type DynamicCard

type DynamicCard struct {
	ActivityInfos map[string]any `json:"activity_infos"` // 该条动态参与的活动
	Card          string         `json:"card"`           // 动态详细信息
	Desc          map[string]any `json:"desc"`           // 动态相关信息
	Display       map[string]any `json:"display"`        // 动态部分的可操作项
	ExtendJson    string         `json:"extend_json"`    // 动态扩展项
}

DynamicCard 动态卡片内容。因为 ActivityInfos 、 Desc 、 Display 等字段会随着此动态类型不同发生一定的变化,无法统一,因此都转换成了 map[string]any ,请自行解析

type DynamicDetail

type DynamicDetail struct {
	Card   *DynamicCard `json:"card"` // 动态卡片内容
	Result int          `json:"result"`
	Gt     int          `json:"_gt_"`
}

type DynamicGroup

type DynamicGroup struct {
	GroupType int                `json:"group_type"` // 2:我的关注。4:其他
	GroupName string             `json:"group_name"` // 分组名字
	Items     []DynamicGroupItem `json:"items"`      // 用户信息
}

type DynamicGroupItem

type DynamicGroupItem struct {
	Uid                int    `json:"uid"`                  // 用户id
	Uname              string `json:"uname"`                // 用户昵称
	Face               string `json:"face"`                 // 用户头像url
	Fans               int    `json:"fans"`                 // 用户粉丝数
	OfficialVerifyType int    `json:"official_verify_type"` // 认证信息?
}

type DynamicInfo

type DynamicInfo struct {
	HasMore        bool          `json:"has_more"`        // 是否有更多数据
	Items          []DynamicItem `json:"items"`           // 数据数组
	Offset         string        `json:"offset"`          // 偏移量,等于items中最后一条记录的id,获取下一页时使用
	UpdateBaseline string        `json:"update_baseline"` // 更新基线,等于items中第一条记录的id
	UpdateNum      int           `json:"update_num"`      // 本次获取获取到了多少条新动态,在更新基线以上的动态条数
}

type DynamicItem

type DynamicItem struct {
	Basic struct {
		CommentIdStr string `json:"comment_id_str"`
		CommentType  int    `json:"comment_type"`
		LikeIcon     struct {
			ActionUrl string `json:"action_url"`
			EndUrl    string `json:"end_url"`
			Id        int    `json:"id"`
			StartUrl  string `json:"start_url"`
		} `json:"like_icon"`
		RidStr string `json:"rid_str"`
	} `json:"basic"`
	IdStr   any `json:"id_str"` // 这个字段,B站返回的数据有时是number,有时是string,不知道为什么。这里用any会带来一个问题,number会解析成为float64,有可能存在丢失精度问题。请谨慎使用
	Modules struct {
		ModuleAuthor struct {
			Avatar struct {
				ContainerSize struct {
					Height float64 `json:"height"`
					Width  float64 `json:"width"`
				} `json:"container_size"`
				FallbackLayers struct {
					IsCriticalGroup bool `json:"is_critical_group"`
					Layers          []struct {
						GeneralSpec struct {
							PosSpec struct {
								AxisX         float64 `json:"axis_x"`
								AxisY         float64 `json:"axis_y"`
								CoordinatePos int     `json:"coordinate_pos"`
							} `json:"pos_spec"`
							RenderSpec struct {
								Opacity int `json:"opacity"`
							} `json:"render_spec"`
							SizeSpec struct {
								Height float64 `json:"height"`
								Width  float64 `json:"width"`
							} `json:"size_spec"`
						} `json:"general_spec"`
						LayerConfig struct {
							IsCritical bool `json:"is_critical,omitempty"`
							Tags       struct {
								AvatarLayer struct {
								} `json:"AVATAR_LAYER,omitempty"`
								GeneralCfg struct {
									ConfigType    int `json:"config_type"`
									GeneralConfig struct {
										WebCssStyle struct {
											BorderRadius    string `json:"borderRadius"`
											BackgroundColor string `json:"background-color,omitempty"`
											Border          string `json:"border,omitempty"`
											BoxSizing       string `json:"boxSizing,omitempty"`
										} `json:"web_css_style"`
									} `json:"general_config"`
								} `json:"GENERAL_CFG"`
								IconLayer struct{} `json:"ICON_LAYER,omitempty"`
							} `json:"tags"`
						} `json:"layer_config"`
						Resource struct {
							ResAnimation struct {
								WebpSrc struct {
									Placeholder int `json:"placeholder"`
									Remote      struct {
										BfsStyle string `json:"bfs_style"`
										Url      string `json:"url"`
									} `json:"remote"`
									SrcType int `json:"src_type"`
								} `json:"webp_src"`
							} `json:"res_animation,omitempty"`
							ResType  int `json:"res_type"`
							ResImage struct {
								ImageSrc struct {
									Local   int `json:"local"`
									SrcType int `json:"src_type"`
								} `json:"image_src"`
							} `json:"res_image,omitempty"`
						} `json:"resource"`
						Visible bool `json:"visible"`
					} `json:"layers"`
				} `json:"fallback_layers"`
				Mid string `json:"mid"`
			} `json:"avatar"`
			Face           string `json:"face"`
			FaceNft        bool   `json:"face_nft"`
			Following      any    `json:"following"`
			JumpUrl        string `json:"jump_url"`
			Label          string `json:"label"`
			Mid            int    `json:"mid"`
			Name           string `json:"name"`
			OfficialVerify struct {
				Desc string `json:"desc"`
				Type int    `json:"type"`
			} `json:"official_verify"`
			Pendant struct {
				Expire            int    `json:"expire"`
				Image             string `json:"image"`
				ImageEnhance      string `json:"image_enhance"`
				ImageEnhanceFrame string `json:"image_enhance_frame"`
				NPid              int    `json:"n_pid"`
				Name              string `json:"name"`
				Pid               int    `json:"pid"`
			} `json:"pendant"`
			PubAction       string `json:"pub_action"`
			PubLocationText string `json:"pub_location_text"`
			PubTime         string `json:"pub_time"`
			PubTs           int    `json:"pub_ts"`
			Type            string `json:"type"`
			Vip             struct {
				AvatarSubscript    int    `json:"avatar_subscript"`
				AvatarSubscriptUrl string `json:"avatar_subscript_url"`
				DueDate            int64  `json:"due_date"`
				Label              struct {
					BgColor               string `json:"bg_color"`
					BgStyle               int    `json:"bg_style"`
					BorderColor           string `json:"border_color"`
					ImgLabelUriHans       string `json:"img_label_uri_hans"`
					ImgLabelUriHansStatic string `json:"img_label_uri_hans_static"`
					ImgLabelUriHant       string `json:"img_label_uri_hant"`
					ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"`
					LabelTheme            string `json:"label_theme"`
					Path                  string `json:"path"`
					Text                  string `json:"text"`
					TextColor             string `json:"text_color"`
					UseImgLabel           bool   `json:"use_img_label"`
				} `json:"label"`
				NicknameColor string `json:"nickname_color"`
				Status        int    `json:"status"`
				ThemeType     int    `json:"theme_type"`
				Type          int    `json:"type"`
			} `json:"vip"`
		} `json:"module_author"`
		ModuleDynamic struct {
			Additional any `json:"additional"`
			Desc       *struct {
				RichTextNodes []struct {
					OrigText string `json:"orig_text"`
					Text     string `json:"text"`
					Type     string `json:"type"`
					JumpUrl  string `json:"jump_url,omitempty"`
					Style    any    `json:"style"`
					Emoji    struct {
						IconUrl string `json:"icon_url"`
						Size    int    `json:"size"`
						Text    string `json:"text"`
						Type    int    `json:"type"`
					} `json:"emoji,omitempty"`
					Rid string `json:"rid,omitempty"`
				} `json:"rich_text_nodes"`
				Text string `json:"text"`
			} `json:"desc"`
			Major *struct {
				Draw struct {
					Id    int `json:"id"`
					Items []struct {
						Height int     `json:"height"`
						Size   float64 `json:"size"`
						Src    string  `json:"src"`
						Tags   []any   `json:"tags"`
						Width  int     `json:"width"`
					} `json:"items"`
				} `json:"draw,omitempty"`
				Type    string `json:"type"`
				Archive struct {
					Aid   string `json:"aid"`
					Badge struct {
						BgColor string `json:"bg_color"`
						Color   string `json:"color"`
						IconUrl any    `json:"icon_url"`
						Text    string `json:"text"`
					} `json:"badge"`
					Bvid           string `json:"bvid"`
					Cover          string `json:"cover"`
					Desc           string `json:"desc"`
					DisablePreview int    `json:"disable_preview"`
					DurationText   string `json:"duration_text"`
					JumpUrl        string `json:"jump_url"`
					Stat           struct {
						Danmaku string `json:"danmaku"`
						Play    string `json:"play"`
					} `json:"stat"`
					Title string `json:"title"`
					Type  int    `json:"type"`
				} `json:"archive,omitempty"`
			} `json:"major"`
			Topic any `json:"topic"`
		} `json:"module_dynamic"`
		ModuleMore struct {
			ThreePointItems []struct {
				Label string `json:"label"`
				Type  string `json:"type"`
			} `json:"three_point_items"`
		} `json:"module_more"`
		ModuleStat struct {
			Comment struct {
				Count     int  `json:"count"`
				Forbidden bool `json:"forbidden"`
			} `json:"comment"`
			Forward struct {
				Count     int  `json:"count"`
				Forbidden bool `json:"forbidden"`
			} `json:"forward"`
			Like struct {
				Count     int  `json:"count"`
				Forbidden bool `json:"forbidden"`
				Status    bool `json:"status"`
			} `json:"like"`
		} `json:"module_stat"`
	} `json:"modules"`
	Orig struct {
		Basic struct {
			CommentIdStr string `json:"comment_id_str"`
			CommentType  int    `json:"comment_type"`
			LikeIcon     struct {
				ActionUrl string `json:"action_url"`
				EndUrl    string `json:"end_url"`
				Id        int    `json:"id"`
				StartUrl  string `json:"start_url"`
			} `json:"like_icon"`
			RidStr string `json:"rid_str"`
		} `json:"basic"`
		IdStr   any `json:"id_str"`
		Modules struct {
			ModuleAuthor struct {
				Avatar struct {
					ContainerSize struct {
						Height float64 `json:"height"`
						Width  float64 `json:"width"`
					} `json:"container_size"`
					FallbackLayers struct {
						IsCriticalGroup bool `json:"is_critical_group"`
						Layers          []struct {
							GeneralSpec struct {
								PosSpec struct {
									AxisX         float64 `json:"axis_x"`
									AxisY         float64 `json:"axis_y"`
									CoordinatePos int     `json:"coordinate_pos"`
								} `json:"pos_spec"`
								RenderSpec struct {
									Opacity int `json:"opacity"`
								} `json:"render_spec"`
								SizeSpec struct {
									Height float64 `json:"height"`
									Width  float64 `json:"width"`
								} `json:"size_spec"`
							} `json:"general_spec"`
							LayerConfig struct {
								IsCritical bool `json:"is_critical,omitempty"`
								Tags       struct {
									AVATARLAYER struct {
									} `json:"AVATAR_LAYER,omitempty"`
									GENERALCFG struct {
										ConfigType    int `json:"config_type"`
										GeneralConfig struct {
											WebCssStyle struct {
												BorderRadius    string `json:"borderRadius"`
												BackgroundColor string `json:"background-color,omitempty"`
												Border          string `json:"border,omitempty"`
												BoxSizing       string `json:"boxSizing,omitempty"`
											} `json:"web_css_style"`
										} `json:"general_config"`
									} `json:"GENERAL_CFG,omitempty"`
									PENDENTLAYER struct {
									} `json:"PENDENT_LAYER,omitempty"`
									ICONLAYER struct {
									} `json:"ICON_LAYER,omitempty"`
								} `json:"tags"`
							} `json:"layer_config"`
							Resource struct {
								ResImage struct {
									ImageSrc struct {
										Placeholder int `json:"placeholder,omitempty"`
										Remote      struct {
											BfsStyle string `json:"bfs_style"`
											Url      string `json:"url"`
										} `json:"remote,omitempty"`
										SrcType int `json:"src_type"`
										Local   int `json:"local,omitempty"`
									} `json:"image_src"`
								} `json:"res_image"`
								ResType int `json:"res_type"`
							} `json:"resource"`
							Visible bool `json:"visible"`
						} `json:"layers"`
					} `json:"fallback_layers"`
					Mid string `json:"mid"`
				} `json:"avatar"`
				Decorate struct {
					CardUrl string `json:"card_url"`
					Fan     struct {
						Color  string `json:"color"`
						IsFan  bool   `json:"is_fan"`
						NumStr string `json:"num_str"`
						Number int    `json:"number"`
					} `json:"fan"`
					Id      int    `json:"id"`
					JumpUrl string `json:"jump_url"`
					Name    string `json:"name"`
					Type    int    `json:"type"`
				} `json:"decorate,omitempty"`
				Face           string `json:"face"`
				FaceNft        bool   `json:"face_nft"`
				Following      any    `json:"following"`
				JumpUrl        string `json:"jump_url"`
				Label          string `json:"label"`
				Mid            int    `json:"mid"`
				Name           string `json:"name"`
				OfficialVerify struct {
					Desc string `json:"desc"`
					Type int    `json:"type"`
				} `json:"official_verify"`
				Pendant struct {
					Expire            int    `json:"expire"`
					Image             string `json:"image"`
					ImageEnhance      string `json:"image_enhance"`
					ImageEnhanceFrame string `json:"image_enhance_frame"`
					NPid              int    `json:"n_pid"`
					Name              string `json:"name"`
					Pid               int    `json:"pid"`
				} `json:"pendant"`
				PubAction string `json:"pub_action"`
				PubTime   string `json:"pub_time"`
				PubTs     int    `json:"pub_ts"`
				Type      string `json:"type"`
				Vip       struct {
					AvatarSubscript    int    `json:"avatar_subscript"`
					AvatarSubscriptUrl string `json:"avatar_subscript_url"`
					DueDate            int64  `json:"due_date"`
					Label              struct {
						BgColor               string `json:"bg_color"`
						BgStyle               int    `json:"bg_style"`
						BorderColor           string `json:"border_color"`
						ImgLabelUriHans       string `json:"img_label_uri_hans"`
						ImgLabelUriHansStatic string `json:"img_label_uri_hans_static"`
						ImgLabelUriHant       string `json:"img_label_uri_hant"`
						ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"`
						LabelTheme            string `json:"label_theme"`
						Path                  string `json:"path"`
						Text                  string `json:"text"`
						TextColor             string `json:"text_color"`
						UseImgLabel           bool   `json:"use_img_label"`
					} `json:"label"`
					NicknameColor string `json:"nickname_color"`
					Status        int    `json:"status"`
					ThemeType     int    `json:"theme_type"`
					Type          int    `json:"type"`
				} `json:"vip"`
			} `json:"module_author"`
			ModuleDynamic struct {
				Additional any `json:"additional"`
				Desc       *struct {
					RichTextNodes []struct {
						JumpUrl  string `json:"jump_url,omitempty"`
						OrigText string `json:"orig_text"`
						Text     string `json:"text"`
						Type     string `json:"type"`
						Emoji    struct {
							IconUrl string `json:"icon_url"`
							Size    int    `json:"size"`
							Text    string `json:"text"`
							Type    int    `json:"type"`
						} `json:"emoji,omitempty"`
					} `json:"rich_text_nodes"`
					Text string `json:"text"`
				} `json:"desc"`
				Major struct {
					Archive struct {
						Aid   string `json:"aid"`
						Badge struct {
							BgColor string `json:"bg_color"`
							Color   string `json:"color"`
							IconUrl any    `json:"icon_url"`
							Text    string `json:"text"`
						} `json:"badge"`
						Bvid           string `json:"bvid"`
						Cover          string `json:"cover"`
						Desc           string `json:"desc"`
						DisablePreview int    `json:"disable_preview"`
						DurationText   string `json:"duration_text"`
						JumpUrl        string `json:"jump_url"`
						Stat           struct {
							Danmaku string `json:"danmaku"`
							Play    string `json:"play"`
						} `json:"stat"`
						Title string `json:"title"`
						Type  int    `json:"type"`
					} `json:"archive,omitempty"`
					Type string `json:"type"`
					Draw struct {
						Id    int `json:"id"`
						Items []struct {
							Height int     `json:"height"`
							Size   float64 `json:"size"`
							Src    string  `json:"src"`
							Tags   []any   `json:"tags"`
							Width  int     `json:"width"`
						} `json:"items"`
					} `json:"draw,omitempty"`
				} `json:"major"`
				Topic any `json:"topic"`
			} `json:"module_dynamic"`
		} `json:"modules"`
		Type    string `json:"type"`
		Visible bool   `json:"visible"`
	} `json:"orig,omitempty"`
	Type    string `json:"type"`
	Visible bool   `json:"visible"`
}

type DynamicLikeList

type DynamicLikeList struct {
	ItemLikes []struct {
		Uid      int    `json:"uid"`
		Time     int    `json:"time"`
		FaceUrl  string `json:"face_url"`
		Uname    string `json:"uname"`
		UserInfo struct {
			Uid            int    `json:"uid"`
			Uname          string `json:"uname"`
			Face           string `json:"face"`
			Rank           string `json:"rank"`
			OfficialVerify struct {
				Type int    `json:"type"`
				Desc string `json:"desc"`
			} `json:"official_verify"`
			Vip struct {
				VipType    int   `json:"vipType"`
				VipDueDate int64 `json:"vipDueDate"`
				VipStatus  int   `json:"vipStatus"`
				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"`
				Role               int    `json:"role"`
				AvatarSubscriptUrl string `json:"avatar_subscript_url"`
			} `json:"vip"`
			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"`
			} `json:"pendant"`
			Sign      string `json:"sign"`
			LevelInfo struct {
				CurrentLevel int `json:"current_level"`
			} `json:"level_info"`
		} `json:"user_info"`
		Attend int `json:"attend"`
	} `json:"item_likes"`
	HasMore    int `json:"has_more"`    // 是否还有下一页
	TotalCount int `json:"total_count"` // 总计点赞数
	Gt         int `json:"_gt_"`        // 固定值0
}

type DynamicList

type DynamicList struct {
	Cards         *DynamicCard `json:"cards"` // 动态列表
	FounderUid    int          `json:"founder_uid,omitempty"`
	HasMore       int          `json:"has_more"` // 当前话题是否有额外的动态,0:无额外动态,1:有额外动态
	IsDrawerTopic int          `json:"is_drawer_topic,omitempty"`
	Offset        string       `json:"offset"` // 接下来获取列表时的偏移值,一般为当前获取的话题列表下最后一个动态id
	Gt            int          `json:"_gt_"`   // 固定值0,作用尚不明确
}

DynamicList 包含置顶及热门的动态列表

TODO: 因为不清楚 attentions 字段(关注列表)的格式,暂未对此字段进行解析

type DynamicLiveUserList

type DynamicLiveUserList struct {
	Count int    `json:"count"` // 直播者数量
	Group string `json:"group"` // 固定值"default",作用尚不明确
	Items []struct {
		Uid   int    `json:"uid"`   // 直播者id
		Uname string `json:"uname"` // 直播者昵称
		Face  string `json:"face"`  // 直播者头像
		Link  string `json:"link"`  // 直播链接
		Title string `json:"title"` // 直播标题
	} `json:"items"`
	Gt int `json:"_gt_"` // 固定值0,作用尚不明确
}

type DynamicPortal

type DynamicPortal struct {
	MyInfo struct {
		Dyns      int    `json:"dyns"`      // 个人动态
		Face      string `json:"face"`      // 头像url
		FaceNft   int    `json:"face_nft"`  // 含义尚不明确
		Follower  int    `json:"follower"`  // 粉丝数量
		Following int    `json:"following"` // 我的关注
		LevelInfo struct {
			CurrentExp   int   `json:"current_exp"`
			CurrentLevel int   `json:"current_level"` // 当前等级,0-6级
			CurrentMin   int   `json:"current_min"`
			LevelUp      int64 `json:"level_up"`
			NextExp      int   `json:"next_exp"`
		} `json:"level_info"`
		Mid      int    `json:"mid"`  // 账户mid
		Name     string `json:"name"` // 账户名称
		Official struct {
			Desc  string `json:"desc"`  // 认证备注
			Role  int    `json:"role"`  // 认证类型,0:无,1 2 7:个人认证,3 4 5 6:机构认证
			Title string `json:"title"` // 认证信息
			Type  int    `json:"type"`  // 是否认证,-1:无,0:认证
		} `json:"official"`
		SpaceBg string `json:"space_bg"` // 账户个人中心的背景横幅url
		Vip     struct {
			AvatarSubscript    int    `json:"avatar_subscript"`     // 是否显示会员图标,0:不显示,1:显示
			AvatarSubscriptUrl string `json:"avatar_subscript_url"` // 大会员角标地址
			DueDate            int64  `json:"due_date"`             // 会员过期时间,Unix时间戳(毫秒)
			Label              struct {
				BgColor               string `json:"bg_color"`                  // 会员标签背景颜色,颜色码,一般为#FB7299,曾用于愚人节改变大会员配色
				BgStyle               int    `json:"bg_style"`                  // 固定值1,作用尚不明确
				BorderColor           string `json:"border_color"`              // 会员标签边框颜色,未使用
				ImgLabelUriHans       string `json:"img_label_uri_hans"`        // 固定值空
				ImgLabelUriHansStatic string `json:"img_label_uri_hans_static"` // 大会员牌子图片,简体版
				ImgLabelUriHant       string `json:"img_label_uri_hant"`        // 固定值空
				ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"` // 大会员牌子图片,繁体版
				LabelTheme            string `json:"label_theme"`               // 会员标签,vip,annual_vip,ten_annual_vip,hundred_annual_vip,fools_day_hundred_annual_vip
				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"`  // 会员昵称颜色,颜色码,一般为#FB7299,曾用于愚人节改变大会员配色
			Role          int    `json:"role"`            // 大会员类型,1:月度大会员,3:年度大会员,7:十年大会员,15:百年大会员
			Status        int    `json:"status"`          // 会员状态,0:无,1:有
			ThemeType     int    `json:"theme_type"`      // 固定值0,作用尚不明确
			TvVipPayType  int    `json:"tv_vip_pay_type"` // 电视大会员支付类型
			TvVipStatus   int    `json:"tv_vip_status"`   // 电视大会员状态,0:未开通
			Type          int    `json:"type"`            // 会员类型,0:无,1:月大会员,2:年度及以上大会员
			VipPayType    int    `json:"vip_pay_type"`    // 支付类型,0:未支付,1:已支付
		} `json:"vip"`
	} `json:"my_info"`
	UpList []struct {
		Face            string `json:"face"`       // UP主头像
		HasUpdate       bool   `json:"has_update"` // 最近是否有更新
		IsReserveRecall bool   `json:"is_reserve_recall"`
		Mid             int    `json:"mid"`   // UP主mid
		Uname           string `json:"uname"` // UP主昵称
	} `json:"up_list"`
}

type DynamicRepostDetail

type DynamicRepostDetail struct {
	HasMore int `json:"has_more"` // 是否还有下一页
	Total   int `json:"total"`    // 总计包含
	Items   []struct {
		Desc struct {
			Uid         int   `json:"uid"`
			Type        int   `json:"type"`
			Rid         int64 `json:"rid"`
			Acl         int   `json:"acl"`
			View        int   `json:"view"`
			Repost      int   `json:"repost"`
			Like        int   `json:"like"`
			IsLiked     int   `json:"is_liked"`
			DynamicId   int64 `json:"dynamic_id"`
			Timestamp   int   `json:"timestamp"`
			PreDyId     int64 `json:"pre_dy_id"`
			OrigDyId    int64 `json:"orig_dy_id"`
			OrigType    int   `json:"orig_type"`
			UserProfile struct {
				Info struct {
					Uid     int    `json:"uid"`
					Uname   string `json:"uname"`
					Face    string `json:"face"`
					FaceNft int    `json:"face_nft"`
				} `json:"info"`
				Card struct {
					OfficialVerify struct {
						Type int    `json:"type"`
						Desc string `json:"desc"`
					} `json:"official_verify"`
				} `json:"card"`
				Vip struct {
					VipType    int   `json:"vipType"`
					VipDueDate int64 `json:"vipDueDate"`
					VipStatus  int   `json:"vipStatus"`
					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"`
					Role               int    `json:"role"`
					AvatarSubscriptUrl string `json:"avatar_subscript_url"`
				} `json:"vip"`
				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"`
				} `json:"pendant"`
				Rank      string `json:"rank"`
				Sign      string `json:"sign"`
				LevelInfo struct {
					CurrentLevel int `json:"current_level"`
				} `json:"level_info"`
			} `json:"user_profile"`
			UidType      int    `json:"uid_type"`
			Stype        int    `json:"stype"`
			RType        int    `json:"r_type"`
			InnerId      int    `json:"inner_id"`
			Status       int    `json:"status"`
			DynamicIdStr string `json:"dynamic_id_str"`
			PreDyIdStr   string `json:"pre_dy_id_str"`
			OrigDyIdStr  string `json:"orig_dy_id_str"`
			RidStr       string `json:"rid_str"`
			Origin       struct {
				Uid          int    `json:"uid"`
				Type         int    `json:"type"`
				Rid          int    `json:"rid"`
				Acl          int    `json:"acl"`
				View         int    `json:"view"`
				Repost       int    `json:"repost"`
				Like         int    `json:"like"`
				DynamicId    int64  `json:"dynamic_id"`
				Timestamp    int    `json:"timestamp"`
				PreDyId      int    `json:"pre_dy_id"`
				OrigDyId     int    `json:"orig_dy_id"`
				UidType      int    `json:"uid_type"`
				Stype        int    `json:"stype"`
				RType        int    `json:"r_type"`
				InnerId      int    `json:"inner_id"`
				Status       int    `json:"status"`
				DynamicIdStr string `json:"dynamic_id_str"`
				PreDyIdStr   string `json:"pre_dy_id_str"`
				OrigDyIdStr  string `json:"orig_dy_id_str"`
				RidStr       string `json:"rid_str"`
			} `json:"origin"`
			Previous struct {
				Uid          int    `json:"uid"`
				Type         int    `json:"type"`
				Rid          int64  `json:"rid"`
				Acl          int    `json:"acl"`
				View         int    `json:"view"`
				Repost       int    `json:"repost"`
				Like         int    `json:"like"`
				DynamicId    int64  `json:"dynamic_id"`
				Timestamp    int    `json:"timestamp"`
				PreDyId      int64  `json:"pre_dy_id"`
				OrigDyId     int64  `json:"orig_dy_id"`
				UidType      int    `json:"uid_type"`
				Stype        int    `json:"stype"`
				RType        int    `json:"r_type"`
				InnerId      int    `json:"inner_id"`
				Status       int    `json:"status"`
				DynamicIdStr string `json:"dynamic_id_str"`
				PreDyIdStr   string `json:"pre_dy_id_str"`
				OrigDyIdStr  string `json:"orig_dy_id_str"`
				RidStr       string `json:"rid_str"`
			} `json:"previous"`
		} `json:"desc"`
		Card       string `json:"card"`
		ExtendJson string `json:"extend_json"`
		Display    struct {
			Origin struct {
				EmojiInfo struct {
					EmojiDetails []struct {
						EmojiName string `json:"emoji_name"`
						Id        int    `json:"id"`
						PackageId int    `json:"package_id"`
						State     int    `json:"state"`
						Type      int    `json:"type"`
						Attr      int    `json:"attr"`
						Text      string `json:"text"`
						Url       string `json:"url"`
						Meta      struct {
							Size int `json:"size"`
						} `json:"meta"`
						Mtime int `json:"mtime"`
					} `json:"emoji_details"`
				} `json:"emoji_info"`
				Relation struct {
					Status     int `json:"status"`
					IsFollow   int `json:"is_follow"`
					IsFollowed int `json:"is_followed"`
				} `json:"relation"`
			} `json:"origin"`
			Relation struct {
				Status     int `json:"status"`
				IsFollow   int `json:"is_follow"`
				IsFollowed int `json:"is_followed"`
			} `json:"relation"`
		} `json:"display"`
	} `json:"items"`
	Gt int `json:"_gt_"` // 固定值0
}

type DynamicUpList

type DynamicUpList struct {
	ButtonStatement string `json:"button_statement"` // 固定值空,作用尚不明确
	Items           []struct {
		UserProfile struct {
			Info struct {
				Uid   int    `json:"uid"`
				Uname string `json:"uname"`
				Face  string `json:"face"`
			} `json:"info"`
			Card struct {
				OfficialVerify struct {
					Type int    `json:"type"`
					Desc string `json:"desc"`
				} `json:"official_verify"`
			} `json:"card"`
			Vip struct {
				VipType       int    `json:"vipType"`
				VipDueDate    int64  `json:"vipDueDate"`
				DueRemark     string `json:"dueRemark"`
				AccessStatus  int    `json:"accessStatus"`
				VipStatus     int    `json:"vipStatus"`
				VipStatusWarn string `json:"vipStatusWarn"`
				ThemeType     int    `json:"themeType"`
				Label         struct {
					Path string `json:"path"`
				} `json:"label"`
			} `json:"vip"`
			Pendant struct {
				Pid          int    `json:"pid"`
				Name         string `json:"name"`
				Image        string `json:"image"`
				Expire       int    `json:"expire"`
				ImageEnhance string `json:"image_enhance"`
			} `json:"pendant"`
			Rank      string `json:"rank"`
			Sign      string `json:"sign"`
			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"`
		} `json:"user_profile"`
		HasUpdate int `json:"has_update"`
	} `json:"items"`
	Gt int `json:"_gt_"` // 固定值0,作用尚不明确
}

type EInfo

type EInfo struct {
	Text string `json:"text"` // 表情名称
	Uri  string `json:"uri"`  // 表情链接
	Size int    `json:"size"` // 表情尺寸。1
}

type EditFavourFolderParam

type EditFavourFolderParam struct {
	MediaId int    `json:"media_id"`                                    // 目标收藏夹mdid
	Title   string `json:"title"`                                       // 修改收藏夹标题
	Intro   string `json:"intro,omitempty" request:"query,omitempty"`   // 修改收藏夹简介
	Privacy int    `json:"privacy,omitempty" request:"query,omitempty"` // 是否公开。默认为公开。。0:公开。1:私密
	Cover   string `json:"cover,omitempty" request:"query,omitempty"`   // 封面图url。封面会被审核
}

type EpisodicButton

type EpisodicButton struct {
	Text string `json:"text"` // 按钮文字
	Uri  string `json:"uri"`  // 全部播放页url
}

type Error

type Error struct {
	Code    int
	Message string
}

func (Error) Error

func (e Error) Error() string

type Fan

type Fan struct {
	IsFan   int    `json:"is_fan"`   // 是否为粉丝专属装扮。0:否。1:是
	Number  int    `json:"number"`   // 粉丝专属编号
	Color   string `json:"color"`    // 数字颜色。颜色码
	Name    string `json:"name"`     // 装扮名称
	NumDesc string `json:"num_desc"` // 粉丝专属编号。字串格式
}

type FansDetail

type FansDetail struct {
	Uid          int    `json:"uid"`           // 用户 mid
	MedalId      int    `json:"medal_id"`      // 粉丝标签 id
	MedalName    string `json:"medal_name"`    // 粉丝标签名
	Score        int    `json:"score"`         // (?)
	Level        int    `json:"level"`         // 当前标签等级
	Intimacy     int    `json:"intimacy"`      // (?)
	MasterStatus int    `json:"master_status"` // (?)
	IsReceive    int    `json:"is_receive"`    // (?)
}

type FavoritesArticleParam

type FavoritesArticleParam struct {
	Id int `json:"id"` // 文章cvid
}

type FavourFolderInfo

type FavourFolderInfo struct {
	Id         int     `json:"id"`          // 收藏夹mlid(完整id),收藏夹原始id+创建者mid尾号2位
	Fid        int     `json:"fid"`         // 收藏夹原始id
	Mid        int     `json:"mid"`         // 创建者mid
	Attr       int     `json:"attr"`        // 属性位(?)
	Title      string  `json:"title"`       // 收藏夹标题
	Cover      string  `json:"cover"`       // 	收藏夹封面图片url
	Upper      Upper   `json:"upper"`       // 创建者信息
	CoverType  int     `json:"cover_type"`  // 封面图类别(?)
	CntInfo    CntInfo `json:"cnt_info"`    // 收藏夹状态数
	Type       int     `json:"type"`        // 类型(?)
	Intro      string  `json:"intro"`       // 备注
	Ctime      int     `json:"ctime"`       // 创建时间戳
	Mtime      int     `json:"mtime"`       // 收藏时间戳
	State      int     `json:"state"`       // 状态(?)
	FavState   int     `json:"fav_state"`   // 收藏夹收藏状态,已收藏:1,未收藏:0
	LikeState  int     `json:"like_state"`  // 点赞状态,已点赞:1,未点赞:0
	MediaCount int     `json:"media_count"` // 收藏夹内容数量
}

type FavourId

type FavourId struct {
	Id   int    `json:"id"`    // 内容id,视频稿件:视频稿件avid,音频:音频auid,视频合集:视频合集id
	Type int    `json:"type"`  // 内容类型,2:视频稿件,12:音频,21:视频合集
	BvId string `json:"bv_id"` // 视频稿件bvid
	Bvid string `json:"bvid"`  // 视频稿件bvid
}

type FavourInfo

type FavourInfo struct {
	Id       int    `json:"id"`
	Type     int    `json:"type"`
	Title    string `json:"title"`
	Cover    string `json:"cover"`
	Intro    string `json:"intro"`
	Page     int    `json:"page"`
	Duration int    `json:"duration"`
	Upper    struct {
		Mid  int    `json:"mid"`
		Name string `json:"name"`
		Face string `json:"face"`
	} `json:"upper"`
	Attr    int `json:"attr"`
	CntInfo struct {
		Collect int `json:"collect"`
		Play    int `json:"play"`
		Danmaku int `json:"danmaku"`
	} `json:"cnt_info"`
	Link    string `json:"link"`
	Ctime   int    `json:"ctime"`
	Pubtime int    `json:"pubtime"`
	FavTime int    `json:"fav_time"`
	BvId    string `json:"bv_id"`
	Bvid    string `json:"bvid"`
	Season  any    `json:"season"`
}

type FavourList

type FavourList struct {
	Info struct {
		Id    int    `json:"id"`    // 收藏夹mlid(完整id),收藏夹原始id+创建者mid尾号2位
		Fid   int    `json:"fid"`   // 收藏夹原始id
		Mid   int    `json:"mid"`   // 创建者mid
		Attr  int    `json:"attr"`  // 属性,0:正常,1:失效
		Title string `json:"title"` // 收藏夹标题
		Cover string `json:"cover"` // 收藏夹封面图片url
		Upper struct {
			Mid       int    `json:"mid"`        // 创建者mid
			Name      string `json:"name"`       // 创建者昵称
			Face      string `json:"face"`       // 创建者头像url
			Followed  bool   `json:"followed"`   // 是否已关注创建者
			VipType   int    `json:"vip_type"`   // 会员类别,0:无,1:月大会员,2:年度及以上大会员
			VipStatue int    `json:"vip_statue"` // 会员开通状态,0:无,1:有
		} `json:"upper"`
		CoverType int `json:"cover_type"` // 封面图类别(?)
		CntInfo   struct {
			Collect int `json:"collect"`  // 收藏数
			Play    int `json:"play"`     // 播放数
			ThumbUp int `json:"thumb_up"` // 点赞数
			Share   int `json:"share"`    // 分享数
		} `json:"cnt_info"`
		Type       int    `json:"type"`        // 类型(?),一般是11
		Intro      string `json:"intro"`       // 备注
		Ctime      int    `json:"ctime"`       // 创建时间戳
		Mtime      int    `json:"mtime"`       // 收藏时间戳
		State      int    `json:"state"`       // 状态(?),一般为0
		FavState   int    `json:"fav_state"`   // 收藏夹收藏状态,已收藏收藏夹:1,未收藏收藏夹:0
		LikeState  int    `json:"like_state"`  // 点赞状态,已点赞:1,未点赞:0
		MediaCount int    `json:"media_count"` // 收藏夹内容数量
	} `json:"info"`
	Medias []struct {
		Id       int    `json:"id"`       // 内容id,视频稿件:视频稿件avid,音频:音频auid,视频合集:视频合集id
		Type     int    `json:"type"`     // 内容类型,2:视频稿件,12:音频,21:视频合集
		Title    string `json:"title"`    // 标题
		Cover    string `json:"cover"`    // 封面url
		Intro    string `json:"intro"`    // 简介
		Page     int    `json:"page"`     // 视频分P数
		Duration int    `json:"duration"` // 音频/视频时长
		Upper    struct {
			Mid  int    `json:"mid"`  // UP主mid
			Name string `json:"name"` // UP主昵称
			Face string `json:"face"` // UP主头像url
		} `json:"upper"`
		Attr    int `json:"attr"` // 属性位(?)
		CntInfo struct {
			Collect int `json:"collect"` // 收藏数
			Play    int `json:"play"`    // 播放数
			Danmaku int `json:"danmaku"` // 弹幕数
		} `json:"cnt_info"`
		Link    string `json:"link"`     // 跳转uri
		Ctime   int    `json:"ctime"`    // 投稿时间戳
		Pubtime int    `json:"pubtime"`  // 发布时间戳
		FavTime int    `json:"fav_time"` // 收藏时间戳
		BvId    string `json:"bv_id"`    // 视频稿件bvid
		Bvid    string `json:"bvid"`     // 视频稿件bvid
	} `json:"medias"`
	HasMore bool `json:"has_more"`
}

type FavourVideoParam

type FavourVideoParam struct {
	Rid         int   `json:"rid"`                                               // 稿件 avid
	Type        int   `json:"type"`                                              // 必须为2
	AddMediaIds []int `json:"add_media_ids,omitempty" request:"query,omitempty"` // 需要加入的收藏夹 mlid。同时添加多个,用,(%2C)分隔
	DelMediaIds []int `json:"del_media_ids,omitempty" request:"query,omitempty"` // 需要取消的收藏夹 mlid。同时取消多个,用,(%2C)分隔
}

type FavourVideoResult

type FavourVideoResult struct {
	Prompt bool `json:"prompt"` // 是否为未关注用户收藏。false:否。true:是
}

type Folder

type Folder struct {
	HasFolded bool   `json:"has_folded"` // 是否有被折叠的二级评论
	IsFolded  bool   `json:"is_folded"`  // 评论是否被折叠
	Rule      string `json:"rule"`       // 相关规则页面 url
}

type FormatCtrl

type FormatCtrl struct {
	Location int    `json:"location"` // 从全文第几个字开始
	Type     int    `json:"type"`     // 1:At
	Length   int    `json:"length"`   // 长度总共多少个字
	Data     string `json:"data"`     // 当Type为1时,这里填At的人的Uid
}

type Frame

type Frame struct {
	Name       string `json:"name"`         // 名称
	Value      string `json:"value"`        // 值
	Position   int    `json:"position"`     // 位置
	Desc       string `json:"desc"`         // 描述
	Area       int    `json:"area"`         // 分区
	AreaOld    int    `json:"area_old"`     // 旧分区
	BgColor    string `json:"bg_color"`     // 背景色
	BgPic      string `json:"bg_pic"`       // 背景图
	UseOldArea bool   `json:"use_old_area"` // 是否旧分区号
}

type Geetest

type Geetest struct {
	Gt        string `json:"gt"`        // 极验id。一般为固定值
	Challenge string `json:"challenge"` // 极验KEY。由B站后端产生用于人机验证
}

type GetAllFavourFolderInfoParam

type GetAllFavourFolderInfoParam struct {
	UpMid int `json:"up_mid"`                                   // 目标用户mid
	Type  int `json:"type,omitempty" request:"query,omitempty"` // 目标内容属性。默认为全部。0:全部。2:视频稿件
	Rid   int `json:"rid,omitempty" request:"query,omitempty"`  // 目标内容id。视频稿件:视频稿件avid
}

type GetArticleInfoParam

type GetArticleInfoParam struct {
	Id int `json:"id"` // 专栏cvid
}

type GetArticlesInfoParam

type GetArticlesInfoParam struct {
	Id int `json:"id"` // 文集rlid
}

type GetCommentReplyParam

type GetCommentReplyParam struct {
	AccessKey string `json:"access_key,omitempty" request:"query,omitempty"` // APP登录 Token
	Type      int    `json:"type"`                                           // 评论区类型代码,见 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/comment/readme.md
	Oid       int    `json:"oid"`                                            // 目标评论区 id
	Root      int    `json:"root"`                                           // 根回复 rpid
	Ps        int    `json:"ps,omitempty" request:"query,omitempty"`         // 每页项数。默认为20。定义域:1-49 。 但 data_replies 的最大内容数为20,因此设置为49其实也只会有20条回复被返回
	Pn        int    `json:"pn,omitempty" request:"query,omitempty"`         // 页码。默认为1
}

type GetCommentsDetailParam

type GetCommentsDetailParam struct {
	AccessKey string `json:"access_key,omitempty" request:"query,omitempty"` // APP 登录 Token
	Type      int    `json:"type"`                                           // 评论区类型代码,见 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/comment/readme.md
	Oid       int    `json:"oid"`                                            // 目标评论区 id
	Sort      int    `json:"sort,omitempty" request:"query,omitempty"`       // 排序方式。默认为0。0:按时间。1:按点赞数。2:按回复数
	Nohot     int    `json:"nohot,omitempty" request:"query,omitempty"`      // 是否不显示热评。默认为0。1:不显示。0:显示
	Ps        int    `json:"ps,omitempty" request:"query,omitempty"`         // 每页项数。默认为20。定义域:1-20
	Pn        int    `json:"pn,omitempty" request:"query,omitempty"`         // 页码。默认为1
}

type GetCommentsHotReplyParam

type GetCommentsHotReplyParam struct {
	Type int `json:"type"`                                   // 评论区类型代码
	Oid  int `json:"oid"`                                    // 目标评论区 id
	Root int `json:"root"`                                   // 根回复 rpid
	Ps   int `json:"ps,omitempty" request:"query,omitempty"` // 每页项数。默认为20。定义域:1-49
	Pn   int `json:"pn,omitempty" request:"query,omitempty"` // 页码。默认为1
}

type GetCountryCrownResult

type GetCountryCrownResult struct {
	Common []CountryCrown `json:"common"` // 常用国家&地区
	Others []CountryCrown `json:"others"` // 其他国家&地区
}

type GetDynamicDetailParam

type GetDynamicDetailParam struct {
	DynamicId int `json:"dynamic_id"` // 动态id
}

type GetDynamicLikeListParam

type GetDynamicLikeListParam struct {
	DynamicId int64 `json:"dynamic_id"`                             // 动态id
	Pn        int64 `json:"pn,omitempty" request:"query,omitempty"` // 页码
	Ps        int64 `json:"ps,omitempty" request:"query,omitempty"` // 每页数量。该值不得大于20
}

type GetDynamicLiveUserListParam

type GetDynamicLiveUserListParam struct {
	Size int `json:"size,omitempty" request:"query,omitempty"` // 每页显示数。默认为10
}

type GetDynamicRepostDetailParam

type GetDynamicRepostDetailParam struct {
	DynamicId int `json:"dynamic_id"`                                 // 动态id
	Offset    int `json:"offset,omitempty" request:"query,omitempty"` // 偏移量
}

type GetDynamicUpListParam

type GetDynamicUpListParam struct {
	TeenagersMode int `json:"teenagers_mode,omitempty" request:"query,omitempty"` // 是否开启青少年模式。否:0。是:1
}

type GetFavourIdsParam

type GetFavourIdsParam struct {
	MediaId  int    `json:"media_id"`                                     // 目标收藏夹mlid(完整id)
	Platform string `json:"platform,omitempty" request:"query,omitempty"` // 平台标识。可为web(影响内容列表类型)
}

type GetFavourInfoParam

type GetFavourInfoParam struct {
	Resources []string `json:"resources"`                                    // 目标内容id列表。格式:{内容id}:{内容类型}。类型:2:视频稿件。12:音频。21:视频合集。内容id:视频稿件:视频稿件avid。音频:音频auid。视频合集:视频合集id
	Platform  string   `json:"platform,omitempty" request:"query,omitempty"` // 平台标识。可为web(影响内容列表类型)
}

type GetFavourListParam

type GetFavourListParam struct {
	MediaId  int    `json:"media_id"`                                     // 目标收藏夹mlid(完整id)
	Tid      int    `json:"tid,omitempty" request:"query,omitempty"`      // 分区tid。默认为全部分区。0:全部分区
	Keyword  string `json:"keyword,omitempty" request:"query,omitempty"`  // 搜索关键字
	Order    string `json:"order,omitempty" request:"query,omitempty"`    // 排序方式。按收藏时间:mtime。按播放量: view。按投稿时间:pubtime
	Type     int    `json:"type,omitempty" request:"query,omitempty"`     // 查询范围。0:当前收藏夹(对应media_id)。 1:全部收藏夹
	Ps       int    `json:"ps"`                                           // 每页数量。定义域:1-20
	Pn       int    `json:"pn,omitempty" request:"query,omitempty"`       // 页码。默认为1
	Platform string `json:"platform,omitempty" request:"query,omitempty"` // 平台标识。可为web(影响内容列表类型)
}

type GetLiveRoomInfoParam

type GetLiveRoomInfoParam struct {
	RoomId int `json:"room_id"` // 直播间号。可以为短号
}

type GetPrivateMessageListParam

type GetPrivateMessageListParam struct {
	SessionType int    `json:"session_type"`                                 // 1:系统,2:用户,3:应援团
	MobiApp     string `json:"mobi_app,omitempty" request:"query,omitempty"` // 设备
}

type GetPrivateMessageRecordsParam

type GetPrivateMessageRecordsParam struct {
	SenderDeviceId int    `json:"sender_device_id,omitempty" request:"query,omitempty"` // 发送者设备。1
	SessionType    int    `json:"session_type"`                                         // 聊天对象的类型。1为用户,2为粉丝团
	Size           int    `json:"size,omitempty" request:"query,omitempty"`             // 列出消息条数。默认是20,最大为200
	Build          int    `json:"build,omitempty" request:"query,omitempty"`            // 未知。默认是0
	MobiApp        string `json:"mobi_app,omitempty" request:"query,omitempty"`         // 设备。web
	BeginSeqno     int    `json:"begin_seqno,omitempty" request:"query,omitempty"`      // 开始的序列号。默认0为全部
	EndSeqno       int    `json:"end_seqno,omitempty" request:"query,omitempty"`        // 结束的序列号。默认0为全部
}

type GetTopRecommendVideoParam

type GetTopRecommendVideoParam struct {
	FreshType  int `json:"fresh_type,omitempty" request:"query,omitempty"`   // 相关性。默认为3 。 值越大推荐内容越相关
	Version    int `json:"version,omitempty" request:"query,omitempty"`      // web端新旧版本:0为旧版本1为新版本。默认为 0 。1,0分别为新旧web端
	Ps         int `json:"ps,omitempty" request:"query,omitempty"`           // pagesize 单页返回的记录条数默认为10或8。默认为10 。当version为1时默认为8
	FreshIdx   int `json:"fresh_idx,omitempty" request:"query,omitempty"`    // 翻页相关。默认为1 。 与翻页相关
	FreshIdx1H int `json:"fresh_idx_1h,omitempty" request:"query,omitempty"` // 翻页相关。默认为1 。 与翻页相关
}

type GetUserArticleListParam

type GetUserArticleListParam struct {
	Mid  int    `json:"mid"`                                      // 用户uid
	Pn   int    `json:"pn,omitempty" request:"query,omitempty"`   // 默认:1
	Ps   int    `json:"ps,omitempty" request:"query,omitempty"`   // 默认:30。范围:[1,30]
	Sort string `json:"sort,omitempty" request:"query,omitempty"` // publish_time:最新发布。view:最多阅读。fav:最多收藏。默认:publish_time
}

type GetUserArticlesListParam

type GetUserArticlesListParam struct {
	Mid      int    `json:"mid"`                                      // 用户uid
	Sort     int    `json:"sort,omitempty" request:"query,omitempty"` // 排序方式。0:最近更新。1:最多阅读
	Jsonp    string `json:"jsonp,omitempty" request:"query,omitempty"`
	Callback string `json:"callback,omitempty" request:"query,omitempty"`
}

type GetUserCardParam

type GetUserCardParam struct {
	Mid   int  `json:"mid"`                                       // 目标用户mid
	Photo bool `json:"photo,omitempty" request:"query,omitempty"` // 是否请求用户主页头图。true:是。false:否
}

type GetUserSpaceDynamicParam

type GetUserSpaceDynamicParam struct {
	Offset         string `json:"offset"`          // 分页偏移量
	HostMid        string `json:"host_mid"`        // 用户UID
	TimezoneOffset int    `json:"timezone_offset"` // -480
	Features       string `json:"features"`        // itemOpusStyle
}

type GetUserVideosParam

type GetUserVideosParam struct {
	Mid     int    `json:"mid"`                                         // 目标用户mid
	Order   string `json:"order,omitempty" request:"query,omitempty"`   // 排序方式。默认为pubdate。最新发布:pubdate。最多播放:click。最多收藏:stow
	Tid     int    `json:"tid,omitempty" request:"query,omitempty"`     // 筛选目标分区。默认为0。0:不进行分区筛选。分区tid为所筛选的分区
	Keyword string `json:"keyword,omitempty" request:"query,omitempty"` // 关键词筛选。用于使用关键词搜索该UP主视频稿件
	Pn      int    `json:"pn,omitempty" request:"query,omitempty"`      // 页码。默认为 1
	Ps      int    `json:"ps,omitempty" request:"query,omitempty"`      // 每页项数。默认为 30
}

type GetVideoCollectionInfoParam

type GetVideoCollectionInfoParam struct {
	Mid         int  `json:"mid"`                                              // UP 主 ID
	SeasonId    int  `json:"season_id"`                                        // 视频合集 ID
	SortReverse bool `json:"sort_reverse,omitempty" request:"query,omitempty"` // 未知
	PageNum     int  `json:"page_num,omitempty" request:"query,omitempty"`     // 页码索引
	PageSize    int  `json:"page_size,omitempty" request:"query,omitempty"`    // 单页内容数量
}

type GetVideoSeriesInfoParam

type GetVideoSeriesInfoParam struct {
	Mid        int    `json:"mid"`                                             // UP 主 ID
	SeriesId   int    `json:"series_id"`                                       // 视频合集 ID
	Sort       string `json:"sort,omitempty" request:"query,omitempty"`        // 未知
	Pn         int    `json:"pn,omitempty" request:"query,omitempty"`          // 页码索引
	Ps         int    `json:"ps,omitempty" request:"query,omitempty"`          // 单页内容数量
	CurrentMid int    `json:"current_mid,omitempty" request:"query,omitempty"` // 单页内容数量
}

type GetVipCenterInfoParam

type GetVipCenterInfoParam struct {
	AccessKey string `json:"access_key,omitempty" request:"query,omitempty"` // APP登录Token
	Platform  string `json:"platform,omitempty" request:"query,omitempty"`   // 平台表示。web端:web。安卓APP:android
	MobiApp   string `json:"mobi_app,omitempty" request:"query,omitempty"`   // APP 名称。安卓APP:android
	Build     int    `json:"build,omitempty" request:"query,omitempty"`      // 构建 id
}

type Honor

type Honor struct {
	Aid                int    `json:"aid"`  // 当前稿件aid
	Type               int    `json:"type"` // 1:入站必刷收录。2:第?期每周必看。3:全站排行榜最高第?名。4:热门
	Desc               string `json:"desc"` // 描述
	WeeklyRecommendNum int    `json:"weekly_recommend_num"`
}

type HonorReply

type HonorReply struct {
	Honor []Honor `json:"honor"`
}

type Label

type Label struct {
	Path                  string `json:"path"`                      // 空。作用尚不明确
	Text                  string `json:"text"`                      // 会员类型文案。大会员 年度大会员 十年大会员 百年大会员 最强绿鲤鱼
	LabelTheme            string `json:"label_theme"`               // 会员标签。vip:大会员。annual_vip:年度大会员。ten_annual_vip:十 年大会员。hundred_annual_vip:百年大会员。fools_day_hundred_annual_vip:最强绿鲤鱼
	TextColor             string `json:"text_color"`                // 会员标签
	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"` // 大会员牌子图片。简体版
	ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"` // 大会员牌子图片。繁体版
}

type LevelInfo

type LevelInfo struct {
	CurrentLevel int `json:"current_level"` // 用户等级
	CurrentMin   int `json:"current_min"`   // 0
	CurrentExp   int `json:"current_exp"`   // 0
	NextExp      int `json:"next_exp"`      // 0
}

type LikeArticleParam

type LikeArticleParam struct {
	Id   int `json:"id"`   // 文章cvid
	Type int `json:"type"` // 操作方式。1:点赞。2:取消赞
}

type LikeCoinFavourResult

type LikeCoinFavourResult struct {
	Like     bool `json:"like"`     // 是否点赞成功。true:成功。false:失败
	Coin     bool `json:"coin"`     // 是否投币成功。true:成功。false:失败
	Fav      bool `json:"fav"`      // 是否收藏成功。true:成功。false:失败
	Multiply int  `json:"multiply"` // 投币枚数。默认为2
}

type LikeVideoParam

type LikeVideoParam struct {
	Aid  int    `json:"aid,omitempty" request:"query,omitempty"`  // 稿件 avid。avid 与 bvid 任选一个
	Bvid string `json:"bvid,omitempty" request:"query,omitempty"` // 稿件 bvid。avid 与 bvid 任选一个
	Like int    `json:"like"`                                     // 操作方式。1:点赞。2:取消赞
}

type LiveAreaList

type LiveAreaList struct {
	Id   int           `json:"id"`   // 父分区id
	Name string        `json:"name"` // 父分区名
	List []SubLiveArea `json:"list"` // 子分区列表
}

type LoginWithPasswordParam

type LoginWithPasswordParam struct {
	Username  string `json:"username"`                                   // 用户登录账号。手机号或邮箱地址
	Password  string `json:"password"`                                   // 参数传入原密码,下文会自动转为加密后的带盐密码
	Keep      int    `json:"keep"`                                       // 0
	Token     string `json:"token"`                                      // 登录 API token。使用 Captcha() 方法获取
	Challenge string `json:"challenge"`                                  // 极验 challenge。使用 Captcha() 方法获取
	Validate  string `json:"validate"`                                   // 极验 result。极验验证后得到
	Seccode   string `json:"seccode"`                                    // 极验 result +jordan。极验验证后得到
	GoUrl     string `json:"go_url,omitempty" request:"query,omitempty"` // 跳转 url。默认为 https://www.bilibili.com
	Source    string `json:"source,omitempty" request:"query,omitempty"` // 登录来源。main_web:独立登录页。main_mini:小窗登录
}

type LoginWithPasswordResult

type LoginWithPasswordResult struct {
	Message      string `json:"message"`       // 扫码状态信息
	RefreshToken string `json:"refresh_token"` // 刷新refresh_token
	Status       int    `json:"status"`        // 成功为0
	Timestamp    int    `json:"timestamp"`     // 登录时间。未登录为0。时间戳 单位为毫秒
	Url          string `json:"url"`           // 游戏分站跨域登录 url
}

type LoginWithQRCodeParam

type LoginWithQRCodeParam struct {
	QrcodeKey string `json:"qrcode_key"` // 扫码登录秘钥
}

type LoginWithQRCodeResult

type LoginWithQRCodeResult struct {
	Url          string `json:"url"`           // 游戏分站跨域登录 url。未登录为空
	RefreshToken string `json:"refresh_token"` // 刷新refresh_token。未登录为空
	Timestamp    int    `json:"timestamp"`     // 登录时间。未登录为0。时间戳 单位为毫秒
	Code         int    `json:"code"`          // 0:扫码登录成功。86038:二维码已失效。86090:二维码已扫码未确认。86101:未扫码
	Message      string `json:"message"`       // 扫码状态信息
}

type LoginWithSMSParam

type LoginWithSMSParam struct {
	Cid        int    `json:"cid"`                                        // 国际冠字码。可以从 GetCountryCrown() 获取
	Tel        int    `json:"tel"`                                        // 手机号码
	Code       int    `json:"code"`                                       // 短信验证码。timeout 为 5min
	Source     string `json:"source"`                                     // 登录来源。main_web:独立登录页。main_mini:小窗登录
	CaptchaKey string `json:"captcha_key"`                                // 短信登录 token。从 SendSMS() 请求成功后返回
	GoUrl      string `json:"go_url,omitempty" request:"query,omitempty"` // 跳转url。默认为 https://www.bilibili.com
	Keep       bool   `json:"keep,omitempty" request:"query,omitempty"`   // 是否记住登录。true:记住登录。false:不记住登录
}

type LoginWithSMSResult

type LoginWithSMSResult struct {
	IsNew  bool   `json:"is_new"` // 是否为新注册用户。false:非新注册用户。true:新注册用户
	Status int    `json:"status"` // 0。未知,可能0就是成功吧
	Url    string `json:"url"`    // 跳转 url。默认为 https://www.bilibili.com
}

type Media

type 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
}

type MediaIdParam

type MediaIdParam struct {
	MediaId int `json:"media_id"` // 目标收藏夹id
}

type Member

type Member struct {
	Mid            string         `json:"mid"`             // 发送者 mid
	Uname          string         `json:"uname"`           // 发送者昵称
	Sex            string         `json:"sex"`             // 发送者性别。男 女 保密
	Sign           string         `json:"sign"`            // 发送者签名
	Avatar         string         `json:"avatar"`          // 发送者头像 url
	Rank           string         `json:"rank"`            // (?)
	Displayrank    string         `json:"DisplayRank"`     // (?)
	LevelInfo      LevelInfo      `json:"level_info"`      // 发送者等级
	Pendant        Pendant        `json:"pendant"`         // 发送者头像框信息
	Nameplate      Nameplate      `json:"nameplate"`       // 发送者勋章信息
	OfficialVerify OfficialVerify `json:"official_verify"` // 发送者认证信息
	Vip            Vip            `json:"vip"`             // 发送者会员信息
	FansDetail     *FansDetail    `json:"fans_detail"`     // 发送者粉丝标签
	Following      int            `json:"following"`       // 是否关注该用户。需要登录(Cookie或APP) 。否则恒为0。0:未关注。1:已关注
	IsFollowed     int            `json:"is_followed"`     // 是否被该用户关注。需要登录(Cookie或APP) 。否则恒为0。0:未关注。1:已关注
	UserSailing    UserSailing    `json:"user_sailing"`    // 发送者评论条目装扮信息
	IsContractor   bool           `json:"is_contractor"`   // 是否为合作用户?
	ContractDesc   string         `json:"contract_desc"`   // 合作用户说明?
}

type MemoryStorage

type MemoryStorage struct {
	// contains filtered or unexported fields
}

func (*MemoryStorage) Get

func (impl *MemoryStorage) Get(key string) (v interface{}, isSet bool)

func (*MemoryStorage) Set

func (impl *MemoryStorage) Set(key string, value interface{})

type Message

type Message struct {
	SenderUid      int    `json:"sender_uid"`       // 发送者uid。注意名称是sender_uid
	ReceiverType   int    `json:"receiver_type"`    // 与session_type对应。1为用户,2为粉丝团
	ReceiverId     int    `json:"receiver_id"`      // 接收者uid。注意名称是receiver_id
	MsgType        int    `json:"msg_type"`         // 消息类型。1:文字消息。2:图片消息。5:撤回的消息。12、13:通知
	Content        string `json:"content"`          // 消息内容。此处存在设计缺陷
	MsgSeqno       int    `json:"msg_seqno"`        // 消息序列号,保证按照时间顺序从小到大
	Timestamp      int    `json:"timestamp"`        // 消息发送时间戳
	AtUids         []int  `json:"at_uids"`          // 未知
	MsgKey         int    `json:"msg_key"`          // 未知
	MsgStatus      int    `json:"msg_status"`       // 消息状态。0
	NotifyCode     string `json:"notify_code"`      // 未知
	NewFaceVersion int    `json:"new_face_version"` // 表情包版本。0或者没有是旧版,此时b站会自动转换成新版表情包,例如[doge] -> [tv_doge];1是新版
}

type MoveFavourResourcesParam

type MoveFavourResourcesParam struct {
	SrcMediaId int      `json:"src_media_id"`                                 // 源收藏夹id
	TarMediaId int      `json:"tar_media_id"`                                 // 目标收藏夹id
	Mid        int      `json:"mid"`                                          // 当前用户mid
	Resources  []string `json:"resources"`                                    // 目标内容id列表。格式:{内容id}:{内容类型}。类型:2:视频稿件。12:音频。21:视频合集。内容id:。视频稿件:视频稿件avid。音频:音频auid。视频合集:视频合集id
	Platform   string   `json:"platform,omitempty" request:"query,omitempty"` // 平台标识。可为web
}

type Nameplate

type Nameplate struct {
	Nid        int    `json:"nid"`         // 勋章id
	Name       string `json:"name"`        // 勋章名称
	Image      string `json:"image"`       // 勋章图标
	ImageSmall string `json:"image_small"` // 勋章图标(小)
	Level      string `json:"level"`       // 勋章等级
	Condition  string `json:"condition"`   // 获取条件
}

type NewPendants

type NewPendants struct {
	Frame       *Frame `json:"frame"`        // 头像框
	MobileFrame *Frame `json:"mobile_frame"` // 同上。手机版, 结构一致, 可能null
	Badge       *Badge `json:"badge"`        // 大v
	MobileBadge *Badge `json:"mobile_badge"` // 同上。手机版, 结构一致, 可能null
}

type Notice

type Notice struct {
	Type       int    `json:"type"`        // 1。作用尚不明确
	Status     int    `json:"status"`      // 0。作用尚不明确
	Title      string `json:"title"`       // 空。作用尚不明确
	Msg        string `json:"msg"`         // 空。作用尚不明确
	ButtonText string `json:"button_text"` // 空。作用尚不明确
	ButtonUrl  string `json:"button_url"`  // 空。作用尚不明确
}

type Official

type Official struct {
	Role  int    `json:"role"`  // 成员认证级别
	Title string `json:"title"` // 成员认证名。无为空
	Desc  string `json:"desc"`  // 成员认证备注。无为空
	Type  int    `json:"type"`  // 成员认证类型。-1:无。0:有
}

type OfficialVerify

type OfficialVerify struct {
	Type int    `json:"type"` // 是否认证,-1:无。0:个人认证。1:机构认证
	Desc string `json:"desc"` // 认证信息,无为空
}

type Owner

type Owner struct {
	Mid  int    `json:"mid"`  // UP主mid
	Name string `json:"name"` // UP主昵称
	Face string `json:"face"` // UP主头像
}

type Pendant

type Pendant struct {
	Pid               int    `json:"pid"`                 // 挂件id
	Name              string `json:"name"`                // 挂件名称
	Image             string `json:"image"`               // 挂件图片url
	JumpUrl           string `json:"jump_url"`            // 挂件跳转url
	Type              string `json:"type"`                // 装扮类型。suit:一般装扮。vip_suit:vip 装扮
	Expire            int    `json:"expire"`              // 固定值0,作用尚不明确
	ImageEnhance      string `json:"image_enhance"`       // 头像框图片url
	ImageEnhanceFrame string `json:"image_enhance_frame"` // (?)
}

type Picture

type Picture struct {
	ImgSrc    string  `json:"img_src"`    // 图片地址
	ImgWidth  int     `json:"img_width"`  // 图片宽度
	ImgHeight int     `json:"img_height"` // 图片高度
	ImgSize   float64 `json:"img_size"`   // 图片大小。单位KB
}

type PointInfo

type PointInfo struct {
	Point       int `json:"point"`        // 当前拥有大积分数量
	ExpirePoint int `json:"expire_point"` // 失效积分?。目前为0
	ExpireTime  int `json:"expire_time"`  // 失效时间?。目前为0
	ExpireDays  int `json:"expire_days"`  // 失效天数?。目前为0
}

type PrivateMessageList

type PrivateMessageList struct {
	SessionList []struct {
		TalkerId    int64  `json:"talker_id"`
		SessionType int    `json:"session_type"`
		AtSeqno     int    `json:"at_seqno"`
		TopTs       int    `json:"top_ts"`
		GroupName   string `json:"group_name"`
		GroupCover  string `json:"group_cover"`
		IsFollow    int    `json:"is_follow"`
		IsDnd       int    `json:"is_dnd"`
		AckSeqno    int64  `json:"ack_seqno"`
		AckTs       int64  `json:"ack_ts"`
		SessionTs   int64  `json:"session_ts"`
		UnreadCount int    `json:"unread_count"`
		LastMsg     struct {
			SenderUid      int64  `json:"sender_uid"`
			ReceiverType   int    `json:"receiver_type"`
			ReceiverId     int    `json:"receiver_id"`
			MsgType        int    `json:"msg_type"`
			Content        string `json:"content"`
			MsgSeqno       int64  `json:"msg_seqno"`
			Timestamp      int    `json:"timestamp"`
			MsgKey         int64  `json:"msg_key"`
			MsgStatus      int    `json:"msg_status"`
			NotifyCode     string `json:"notify_code"`
			NewFaceVersion int    `json:"new_face_version,omitempty"`
		} `json:"last_msg"`
		GroupType         int   `json:"group_type"`
		CanFold           int   `json:"can_fold"`
		Status            int   `json:"status"`
		MaxSeqno          int64 `json:"max_seqno"`
		NewPushMsg        int   `json:"new_push_msg"`
		Setting           int   `json:"setting"`
		IsGuardian        int   `json:"is_guardian"`
		IsIntercept       int   `json:"is_intercept"`
		IsTrust           int   `json:"is_trust"`
		SystemMsgType     int   `json:"system_msg_type"`
		LiveStatus        int   `json:"live_status"`
		BizMsgUnreadCount int   `json:"biz_msg_unread_count"`
		AccountInfo       struct {
			Name   string `json:"name"`
			PicUrl string `json:"pic_url"`
		} `json:"account_info,omitempty"`
	} `json:"session_list"`
	HasMore             int              `json:"has_more"`
	AntiDisturbCleaning bool             `json:"anti_disturb_cleaning"`
	IsAddressListEmpty  int              `json:"is_address_list_empty"`
	SystemMsg           map[string]int64 `json:"system_msg"`
	ShowLevel           bool             `json:"show_level"`
}

type PrivateMessageRecords

type PrivateMessageRecords struct {
	Messages []Message `json:"messages"`  // 聊天记录列表
	HasMore  int       `json:"has_more"`  // 0
	MinSeqno int       `json:"min_seqno"` // 所有消息最小的序列号(最早)
	MaxSeqno int       `json:"max_seqno"` // 所有消息最大的序列号(最晚)
	EInfos   []EInfo   `json:"e_infos"`   // 聊天表情列表
}

type Privilege

type Privilege struct {
	Id              int              `json:"id"`               // 特权父类 id
	Name            string           `json:"name"`             // 类型名称
	ChildPrivileges []ChildPrivilege `json:"child_privileges"` // 特权子类列表
}

type Protocol

type Protocol struct {
	Protocol string `json:"protocol"` // rtmp。作用尚不明确
	Addr     string `json:"addr"`     // RTMP推流(发送)地址
	Code     string `json:"code"`     // RTMP推流参数(密钥)
	NewLink  string `json:"new_link"` // 获取CDN推流ip地址重定向信息的url
	Provider string `json:"provider"` // txy。作用尚不明确
}

type QRCode

type QRCode struct {
	Url       string `json:"url"`        // 二维码内容 (登录页面 url)
	QrcodeKey string `json:"qrcode_key"` // 扫码登录秘钥。恒为32字符
}

func (*QRCode) Encode

func (result *QRCode) Encode() ([]byte, error)

Encode a QRCode and return a raw PNG image.

func (*QRCode) Print

func (result *QRCode) Print()

Print the QRCode in the console

type ReceiveVipPrivilegeParam

type ReceiveVipPrivilegeParam struct {
	Type int `json:"type"` // 兑换类型。1:B币券。2:会员购优惠券。3:漫画福利券。4:会员购包邮券。5:漫画商城优惠券。6:装扮体验卡。7:课堂优惠券
}

type RecommendCard

type RecommendCard struct {
	Id      int    `json:"id"`       // 个性装扮 id
	Name    string `json:"name"`     // 个性装扮名称
	Image   string `json:"image"`    // 个性装扮图标 url
	JumpUrl string `json:"jump_url"` // 个性装扮页面 url
}

type RecommendCards

type RecommendCards struct {
	JumpUrl string          `json:"jump_url"` // 推荐个性装扮商城页面跳转 url
	List    []RecommendCard `json:"list"`     // 推荐个性装扮列表
}

type RecommendPendant

type RecommendPendant struct {
	Id      int    `json:"id"`       // 头像框 id
	Name    string `json:"name"`     // 头像框名称
	Image   string `json:"image"`    // 头像框图片 url
	JumpUrl string `json:"jump_url"` // 头像框页面 url
}

type RecommendPendants

type RecommendPendants struct {
	JumpUrl string             `json:"jump_url"` // 头像框商城页面跳转 url
	List    []RecommendPendant `json:"list"`     // 推荐头像框列表
}

type RegionDailyCount

type RegionDailyCount struct {
	RegionCount map[int]int `json:"region_count"` // 分区当日投稿稿件数信息
}

type RemoveDynamicParam

type RemoveDynamicParam struct {
	DynamicId int `json:"dynamic_id"` // 动态id
}

type ReplyControl

type ReplyControl struct {
	SubReplyEntryText string `json:"sub_reply_entry_text"` // 回复提示。共 xx 条回复
	SubReplyTitleText string `json:"sub_reply_title_text"` // 回复提示。相关回复共有 xx 条
	TimeDesc          string `json:"time_desc"`            // 时间提示。xx 天/小时 前发布
	Location          string `json:"location"`             // IP属地。IP属地:xx。评论者发送评论时的IP地址属地。仅对2022-07-25 11:00及以后发布的评论有效。需要登录
}

type Resource

type Resource struct {
	Id   int
	Type ResourceType
}

func (Resource) String

func (r Resource) String() string

type ResourceType

type ResourceType int

type RoomInfo

type RoomInfo struct {
	Uid                  int         `json:"uid"`                // 主播mid
	RoomId               int         `json:"room_id"`            // 直播间长号
	ShortId              int         `json:"short_id"`           // 直播间短号。为0是无短号
	Attention            int         `json:"attention"`          // 关注数量
	Online               int         `json:"online"`             // 观看人数
	IsPortrait           bool        `json:"is_portrait"`        // 是否竖屏
	Description          string      `json:"description"`        // 描述
	LiveStatus           int         `json:"live_status"`        // 直播状态。0:未开播。1:直播中。2:轮播中
	AreaId               int         `json:"area_id"`            // 分区id
	ParentAreaId         int         `json:"parent_area_id"`     // 父分区id
	ParentAreaName       string      `json:"parent_area_name"`   // 父分区名称
	OldAreaId            int         `json:"old_area_id"`        // 旧版分区id
	Background           string      `json:"background"`         // 背景图片链接
	Title                string      `json:"title"`              // 标题
	UserCover            string      `json:"user_cover"`         // 封面
	Keyframe             string      `json:"keyframe"`           // 关键帧。用于网页端悬浮展示
	IsStrictRoom         bool        `json:"is_strict_room"`     // 未知。未知
	LiveTime             string      `json:"live_time"`          // 直播开始时间。YYYY-MM-DD HH:mm:ss
	Tags                 string      `json:"tags"`               // 标签。','分隔
	IsAnchor             int         `json:"is_anchor"`          // 未知。未知
	RoomSilentType       string      `json:"room_silent_type"`   // 禁言状态
	RoomSilentLevel      int         `json:"room_silent_level"`  // 禁言等级
	RoomSilentSecond     int         `json:"room_silent_second"` // 禁言时间。单位是秒
	AreaName             string      `json:"area_name"`          // 分区名称
	Pardants             string      `json:"pardants"`           // 未知。未知
	AreaPardants         string      `json:"area_pardants"`      // 未知。未知
	HotWords             []string    `json:"hot_words"`          // 热词
	HotWordsStatus       int         `json:"hot_words_status"`   // 热词状态
	Verify               string      `json:"verify"`             // 未知。未知
	NewPendants          NewPendants `json:"new_pendants"`       // 头像框\大v
	UpSession            string      `json:"up_session"`         // 未知
	PkStatus             int         `json:"pk_status"`          // pk状态
	PkId                 int         `json:"pk_id"`              // pk id
	BattleId             int         `json:"battle_id"`          // 未知
	AllowChangeAreaTime  int         `json:"allow_change_area_time"`
	AllowUploadCoverTime int         `json:"allow_upload_cover_time"`
	StudioInfo           StudioInfo  `json:"studio_info"`
}

type Rtmp

type Rtmp struct {
	Addr     string `json:"addr"`     // RTMP推流(发送)地址。**重要**
	Code     string `json:"code"`     // RTMP推流参数(密钥)。**重要**
	NewLink  string `json:"new_link"` // 获取CDN推流ip地址重定向信息的url。没啥用
	Provider string `json:"provider"` // ???。作用尚不明确
}

type SearchDynamicAtParam

type SearchDynamicAtParam struct {
	Uid     int    `json:"uid"`     // 自己的uid
	Keyword string `json:"keyword"` // 搜索关键字
}

type SearchDynamicAtResult

type SearchDynamicAtResult struct {
	Groups []DynamicGroup `json:"groups"` // 内容分组
	Gt     int            `json:"_gt_"`   // 固定值0
}

type SendPrivateMessageParam

type SendPrivateMessageParam struct {
	SenderUid      int `json:"msg[sender_uid]"`                                           // 发送者mid
	ReceiverId     int `json:"msg[receiver_id]"`                                          // 接收者mid
	ReceiverType   int `json:"msg[receiver_type]"`                                        // 1。固定为1
	MsgType        int `json:"msg[msg_type]"`                                             // 消息类型。1:发送文字。2:发送图片。5:撤回消息
	MsgStatus      int `json:"msg[msg_status],omitempty" request:"query,omitempty"`       // 0
	Timestamp      int `json:"msg[timestamp]"`                                            // 时间戳(秒)
	NewFaceVersion int `json:"msg[new_face_version],omitempty" request:"query,omitempty"` // 表情包版本
	Content        any `json:"msg[content]"`                                              // 消息内容。发送文字时:str<br />撤回消息时:num
}

type SendPrivateMessageResult

type SendPrivateMessageResult struct {
	MsgKey      int    `json:"msg_key"`       // 消息唯一id
	MsgContent  string `json:"msg_content"`   // 发送的消息
	KeyHitInfos any    `json:"key_hit_infos"` // 作用尚不明确
}

type SendSMSParam

type SendSMSParam struct {
	Cid       int    `json:"cid"`       // 国际冠字码。使用 GetCountryCrown() 方法获取
	Tel       int    `json:"tel"`       // 手机号码
	Source    string `json:"source"`    // 登录来源。main_web:独立登录页。main_mini:小窗登录
	Token     string `json:"token"`     // 登录 API token。使用 Captcha() 方法获取
	Challenge string `json:"challenge"` // 极验 challenge。使用 Captcha() 方法获取
	Validate  string `json:"validate"`  // 极验 result。极验验证后得到
	Seccode   string `json:"seccode"`   // 极验 result +jordan。极验验证后得到
}

type SendSMSResult

type SendSMSResult struct {
	CaptchaKey string `json:"captcha_key"` // 短信登录 token。在下方传参时需要,请备用
}

type ShareChannel

type ShareChannel struct {
	Name         string `json:"name"`          // 分享名称
	Picture      string `json:"picture"`       // 分享图片url
	ShareChannel string `json:"share_channel"` // 分享代号
}

type ShowSwitch

type ShowSwitch struct {
	Total bool `json:"total"` // 展示所有终端总计人数
	Count bool `json:"count"` // 展示web端实时在线人数
}

type SignInfo

type SignInfo struct {
	SignRemind   bool `json:"sign_remind"`   // (?)
	Benefit      int  `json:"benefit"`       // 签到收益。单位为积分
	BonusBenefit int  `json:"bonus_benefit"` // (?)
	NormalRemind bool `json:"normal_remind"` // (?)
	MuggleTask   bool `json:"muggle_task"`   // (?)
}

type Size

type Size struct {
	Width  int
	Height int
}

type Sort

type Sort struct {
	Key  string `json:"key"`  // 扩展 row 字段名
	Sort int    `json:"sort"` // 排列顺序
}

type Staff

type Staff struct {
	Mid        int      `json:"mid"`      // 成员mid
	Title      string   `json:"title"`    // 成员名称
	Name       string   `json:"name"`     // 成员昵称
	Face       string   `json:"face"`     // 成员头像url
	Vip        StaffVip `json:"vip"`      // 成员大会员状态
	Official   Official `json:"official"` // 成员认证信息
	Follower   int      `json:"follower"` // 成员粉丝数
	LabelStyle int      `json:"label_style"`
}

type StaffVip

type StaffVip struct {
	Type      int `json:"type"`       // 成员会员类型。0:无。1:月会员。2:年会员
	Status    int `json:"status"`     // 会员状态。0:无。1:有
	ThemeType int `json:"theme_type"` // 0
}

type StartLiveParam

type StartLiveParam struct {
	RoomId   int    `json:"room_id"`  // 直播间id。必须为自己的直播间id
	AreaV2   int    `json:"area_v2"`  // 直播分区id(子分区id)。详见[直播分区](live_area.md)
	Platform string `json:"platform"` // 直播平台。web端:。bililink:android_link
}

type StartLiveResult

type StartLiveResult struct {
	Change    int        `json:"change"`    // 是否改变状态。0:未改变。1:改变
	Status    string     `json:"status"`    // LIVE
	RoomType  int        `json:"room_type"` // 0。作用尚不明确
	Rtmp      Rtmp       `json:"rtmp"`      // RTMP推流地址信息
	Protocols []Protocol `json:"protocols"` // ???。作用尚不明确
	TryTime   string     `json:"try_time"`  // ???。作用尚不明确
	LiveKey   string     `json:"live_key"`  // ???。作用尚不明确
	Notice    Notice     `json:"notice"`    // ???。作用尚不明确
}

type StatusCount

type StatusCount struct {
	View  int `json:"view"`  // 0。作用尚不明确
	Use   int `json:"use"`   // 视频添加TAG数
	Atten int `json:"atten"` // TAG关注
}

type StopLiveParam

type StopLiveParam struct {
	RoomId int `json:"room_id"` // 直播间id。必须为自己的直播间id
}

type StopLiveResult

type StopLiveResult struct {
	Change int    `json:"change"` // 是否改变状态。0:未改变。1:改变
	Status string `json:"status"` // PREPARING
}

type Storage

type Storage interface {
	Set(key string, value interface{})
	Get(key string) (v interface{}, isSet bool)
}

type StudioInfo

type StudioInfo struct {
	Status     int   `json:"status"`
	MasterList []any `json:"master_list"`
}

type SubLiveArea

type SubLiveArea struct {
	Id         string `json:"id"`          // 子分区id
	ParentId   string `json:"parent_id"`   // 父分区id
	OldAreaId  string `json:"old_area_id"` // 旧分区id
	Name       string `json:"name"`        // 子分区名
	ActId      string `json:"act_id"`      // 0。**作用尚不明确**
	PkStatus   string `json:"pk_status"`   // ???。**作用尚不明确**
	HotStatus  int    `json:"hot_status"`  // 是否为热门分区。0:否。1:是
	LockStatus string `json:"lock_status"` // 0。**作用尚不明确**
	Pic        string `json:"pic"`         // 子分区标志图片url
	ParentName string `json:"parent_name"` // 父分区名
	AreaType   int    `json:"area_type"`
}

type UnreadMessage

type UnreadMessage struct {
	At     int `json:"at"`      // 未读at数
	Chat   int `json:"chat"`    // 0。作用尚不明确
	Like   int `json:"like"`    // 未读点赞数
	Reply  int `json:"reply"`   // 未读回复数
	SysMsg int `json:"sys_msg"` // 未读系统通知数
	Up     int `json:"up"`      // UP主助手信息数
}

type UnreadPrivateMessage

type UnreadPrivateMessage struct {
	UnfollowUnread int `json:"unfollow_unread"` // 未关注用户未读私信数
	FollowUnread   int `json:"follow_unread"`   // 已关注用户未读私信数
	Gt             int `json:"_gt_"`            // 0
}

type UpAction

type UpAction struct {
	Like  bool `json:"like"`  // 是否UP主觉得很赞。false:否。true:是
	Reply bool `json:"reply"` // 是否被UP主回复。false:否。true:是
}

type UpdateLiveRoomTitleParam

type UpdateLiveRoomTitleParam struct {
	RoomId int    `json:"room_id"`                                   // 直播间id。必须为自己的直播间id
	Title  string `json:"title,omitempty" request:"query,omitempty"` // 直播间标题。最大20字符
}

type Upper

type Upper struct {
	Mid       int    `json:"mid"`        // UP 主 mid
	Name      string `json:"name"`       // 创建者昵称
	Face      string `json:"face"`       // 创建者头像url
	Followed  bool   `json:"followed"`   // 是否已关注创建者
	VipType   int    `json:"vip_type"`   // 会员类别,0:无,1:月大会员,2:年度及以上大会员
	VipStatue int    `json:"vip_statue"` // 0:无,1:有
}

type UserArticleList

type UserArticleList struct {
	Articles []Article `json:"articles"` // 专栏文章信息列表
	Pn       int       `json:"pn"`       // 本次请求分页页数
	Ps       int       `json:"ps"`       // 本次请求分页大小
	Count    int       `json:"count"`    // 专栏文章总数
}

type UserArticlesList

type UserArticlesList struct {
	Lists []ArticlesInfo `json:"lists"` // 文集信息列表
	Total int            `json:"total"` // 文集总数
}

type UserCard

type UserCard struct {
	Card         UserCardInfo `json:"card"`          // 卡片信息
	Following    bool         `json:"following"`     // 是否关注此用户。true:已关注。false:未关注。需要登录(Cookie)。未登录为false
	ArchiveCount int          `json:"archive_count"` // 用户稿件数
	ArticleCount int          `json:"article_count"` // 0。**作用尚不明确**
	Follower     int          `json:"follower"`      // 粉丝数
	LikeNum      int          `json:"like_num"`      // 点赞数
}

type UserCardInfo

type UserCardInfo struct {
	Mid            string         `json:"mid"`             // 用户mid
	Approve        bool           `json:"approve"`         // false。**作用尚不明确**
	Name           string         `json:"name"`            // 用户昵称
	Sex            string         `json:"sex"`             // 用户性别。男 女 保密
	Face           string         `json:"face"`            // 用户头像链接
	Displayrank    string         `json:"DisplayRank"`     // 0。**作用尚不明确**
	Regtime        int            `json:"regtime"`         // 0。**作用尚不明确**
	Spacesta       int            `json:"spacesta"`        // 用户状态。0:正常。-2:被封禁
	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"`            // 粉丝数
	Friend         int            `json:"friend"`          // 关注数
	Attention      int            `json:"attention"`       // 关注数
	Sign           string         `json:"sign"`            // 签名
	LevelInfo      LevelInfo      `json:"level_info"`      // 等级
	Pendant        Pendant        `json:"pendant"`         // 挂件
	Nameplate      Nameplate      `json:"nameplate"`       // 勋章
	Official       Official       `json:"Official"`        // 认证信息
	OfficialVerify OfficialVerify `json:"official_verify"` // 认证信息2
	Vip            UserCardVip    `json:"vip"`             // 大会员状态
	Space          CardSpace      `json:"space"`           // 主页头图
}

type UserCardVip

type UserCardVip struct {
	Viptype       int    `json:"vipType"`       // 大会员类型。0:无。1:月度大会员。2:年度及以上大会员
	Dueremark     string `json:"dueRemark"`     // 空。**作用尚不明确**
	Accessstatus  int    `json:"accessStatus"`  // 0。**作用尚不明确**
	Vipstatus     int    `json:"vipStatus"`     // 大会员状态。0:无。1:有
	Vipstatuswarn string `json:"vipStatusWarn"` // 空。**作用尚不明确**
	ThemeType     int    `json:"theme_type"`    // 0。**作用尚不明确**
}

type UserGarb

type UserGarb struct {
	UrlImageAniCut string `json:"url_image_ani_cut"` // 某url?
}

type UserSailing

type UserSailing struct {
	Pendant         *Pendant `json:"pendant"`           // 头像框信息
	Cardbg          *Cardbg  `json:"cardbg"`            // 评论卡片装扮
	CardbgWithFocus any      `json:"cardbg_with_focus"` // (?)
}

type UserVideo

type UserVideo struct {
	Aid          int    `json:"aid"` // 稿件avid
	Attribute    int    `json:"attribute"`
	Author       string `json:"author"`      // 视频UP主。不一定为目标用户(合作视频)
	Bvid         string `json:"bvid"`        // 稿件bvid
	Comment      int    `json:"comment"`     // 视频评论数
	Copyright    string `json:"copyright"`   // 视频版权类型
	Created      int    `json:"created"`     // 投稿时间。时间戳
	Description  string `json:"description"` // 视频简介
	EnableVt     int    `json:"enable_vt"`
	HideClick    bool   `json:"hide_click"`     // false。作用尚不明确
	IsPay        int    `json:"is_pay"`         // 0。作用尚不明确
	IsUnionVideo int    `json:"is_union_video"` // 是否为合作视频。0:否。1:是
	Length       string `json:"length"`         // 视频长度。MM:SS
	Mid          int    `json:"mid"`            // 视频UP主mid。不一定为目标用户(合作视频)
	Meta         any    `json:"meta"`           // 无数据时为 null
	Pic          string `json:"pic"`            // 视频封面
	Play         int    `json:"play"`           // 视频播放次数
	Review       int    `json:"review"`         // 0。作用尚不明确
	Subtitle     string `json:"subtitle"`       // 空。作用尚不明确
	Title        string `json:"title"`          // 视频标题
	Typeid       int    `json:"typeid"`         // 视频分区tid
	VideoReview  int    `json:"video_review"`   // 视频弹幕数
}

type UserVideoPage

type UserVideoPage struct {
	Count int `json:"count"` // 总计稿件数
	Pn    int `json:"pn"`    // 当前页码
	Ps    int `json:"ps"`    // 每页项数
}

type UserVideos

type UserVideos struct {
	List           UserVideosList `json:"list"`            // 列表信息
	Page           UserVideoPage  `json:"page"`            // 页面信息
	EpisodicButton EpisodicButton `json:"episodic_button"` // “播放全部“按钮
	IsRisk         bool           `json:"is_risk"`
	GaiaResType    int            `json:"gaia_res_type"`
	GaiaData       any            `json:"gaia_data"`
}

type UserVideosList

type UserVideosList struct {
	Tlist map[int]VideoArea `json:"tlist"` // 投稿视频分区索引
	Vlist []UserVideo       `json:"vlist"` // 投稿视频列表
}

type VideoArea

type VideoArea struct {
	Count int    `json:"count"` // 投稿至该分区的视频数
	Name  string `json:"name"`  // 该分区名称
	Tid   int    `json:"tid"`   // 该分区tid
}

type VideoCard

type VideoCard struct {
	Mid            string         `json:"mid"`              // 用户mid
	Name           string         `json:"name"`             // 用户昵称
	Approve        bool           `json:"approve"`          // false。作用尚不明确
	Sex            string         `json:"sex"`              // 用户性别。男 女 保密
	Rank           string         `json:"rank"`             // 10000。作用尚不明确
	Face           string         `json:"face"`             // 用户头像链接
	FaceNft        int            `json:"face_nft"`         // 是否为 nft 头像。0不是nft头像。1是 nft 头像
	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"`             // 粉丝数
	Friend         int            `json:"friend"`           // 关注数
	Attention      int            `json:"attention"`        // 关注数
	Sign           string         `json:"sign"`             // 签名
	LevelInfo      LevelInfo      `json:"level_info"`       // 等级
	Pendant        Pendant        `json:"pendant"`          // 挂件
	Nameplate      Nameplate      `json:"nameplate"`        // 勋章
	Official       Official       `json:"Official"`         // 认证信息
	OfficialVerify OfficialVerify `json:"official_verify"`  // 认证信息2
	Vip            CardVip        `json:"vip"`              // 大会员状态
	IsSeniorMember int            `json:"is_senior_member"` // 是否为硬核会员。0:否。1:是
}

type VideoCidParam

type VideoCidParam struct {
	Aid  int    `json:"aid,omitempty" request:"query,omitempty"`  // 稿件avid。avid与bvid任选一个
	Bvid string `json:"bvid,omitempty" request:"query,omitempty"` // 稿件bvid。avid与bvid任选一个
	Cid  int    `json:"cid"`                                      // 视频cid。用于选择目标分P
}

type VideoCollectionInfo

type VideoCollectionInfo struct {
	Aids     []int             `json:"aids"`           // 稿件avid。对应下方数组中内容 aid
	Archives []CollectionVideo `json:"archives"`       // 合集中的视频
	Meta     CollectionMeta    `json:"meta,omitempty"` // 合集元数据
	Page     CollectionPage    `json:"page"`           // 分页信息
}

type VideoDetailInfo

type VideoDetailInfo struct {
	View      VideoInfo           `json:"View"`       // 视频基本信息
	Card      VideoDetailInfoCard `json:"Card"`       // 视频UP主信息
	Tags      []VideoTag          `json:"Tags"`       // 视频TAG信息
	Reply     CommentsHotReply    `json:"Reply"`      // 视频热评信息
	Related   []VideoInfo         `json:"Related"`    // 推荐视频信息
	Spec      any                 `json:"Spec"`       // ?。作用尚不明确
	HotShare  any                 `json:"hot_share"`  // ?。作用尚不明确
	Elec      any                 `json:"elec"`       // ?。作用尚不明确
	Recommend any                 `json:"recommend"`  // ?。作用尚不明确
	ViewAddit any                 `json:"view_addit"` // ?。作用尚不明确
}

type VideoDetailInfoCard

type VideoDetailInfoCard struct {
	Card         VideoCard `json:"card"`          // UP主名片信息
	Space        CardSpace `json:"space"`         // 主页头图
	Following    bool      `json:"following"`     // 是否关注此用户。true:已关注。false:未关注。需要登录(Cookie) 。未登录为false
	ArchiveCount int       `json:"archive_count"` // 用户稿件数
	ArticleCount int       `json:"article_count"` // 用户专栏数
	Follower     int       `json:"follower"`      // 粉丝数
	LikeNum      int       `json:"like_num"`      // UP主获赞次数
}

type VideoInfo

type VideoInfo struct {
	Bvid               string        `json:"bvid"`         // 稿件bvid
	Aid                int           `json:"aid"`          // 稿件avid
	Videos             int           `json:"videos"`       // 稿件分P总数。默认为1
	Tid                int           `json:"tid"`          // 分区tid
	Tname              string        `json:"tname"`        // 子分区名称
	Copyright          int           `json:"copyright"`    // 视频类型。1:原创。2:转载
	Pic                string        `json:"pic"`          // 稿件封面图片url
	Title              string        `json:"title"`        // 稿件标题
	Pubdate            int           `json:"pubdate"`      // 稿件发布时间。秒级时间戳
	Ctime              int           `json:"ctime"`        // 用户投稿时间。秒级时间戳
	Desc               string        `json:"desc"`         // 视频简介
	DescV2             []DescV2      `json:"desc_v2"`      // 新版视频简介
	State              int           `json:"state"`        // 视频状态。详情见[属性数据文档](attribute_data.md#state字段值(稿件状态))
	Duration           int           `json:"duration"`     // 稿件总时长(所有分P)。单位为秒
	Forward            int           `json:"forward"`      // 撞车视频跳转avid。仅撞车视频存在此字段
	MissionId          int           `json:"mission_id"`   // 稿件参与的活动id
	RedirectUrl        string        `json:"redirect_url"` // 重定向url。仅番剧或影视视频存在此字段。用于番剧&影视的av/bv->ep
	Rights             VideoRights   `json:"rights"`       // 视频属性标志
	Owner              Owner         `json:"owner"`        // 视频UP主信息
	Stat               VideoStat     `json:"stat"`         // 视频状态数
	Dynamic            string        `json:"dynamic"`      // 视频同步发布的的动态的文字内容
	Cid                int           `json:"cid"`          // 视频1P cid
	Dimension          Dimension     `json:"dimension"`    // 视频1P分辨率
	Premiere           any           `json:"premiere"`     // null
	TeenageMode        int           `json:"teenage_mode"`
	IsChargeableSeason bool          `json:"is_chargeable_season"`
	IsStory            bool          `json:"is_story"`
	NoCache            bool          `json:"no_cache"` // 作用尚不明确
	Pages              []VideoPage   `json:"pages"`    // 视频分P列表
	Subtitle           VideoSubtitle `json:"subtitle"` // 视频CC字幕信息
	Staff              []Staff       `json:"staff"`    // 合作成员列表。非合作视频无此项
	IsSeasonDisplay    bool          `json:"is_season_display"`
	UserGarb           UserGarb      `json:"user_garb"` // 用户装扮信息
	HonorReply         HonorReply    `json:"honor_reply"`
	LikeIcon           string        `json:"like_icon"`
	ArgueInfo          ArgueInfo     `json:"argue_info"` // 争议/警告信息
}

type VideoOnlineInfo

type VideoOnlineInfo struct {
	Total      string     `json:"total"`       // 所有终端总计人数。例如10万+
	Count      string     `json:"count"`       // web端实时在线人数
	ShowSwitch ShowSwitch `json:"show_switch"` // 数据显示控制
}

type VideoPage

type VideoPage struct {
	Cid        int       `json:"cid"`         // 当前分P cid
	Page       int       `json:"page"`        // 当前分P
	From       string    `json:"from"`        // 视频来源。vupload:普通上传(B站)。hunan:芒果TV。qq:腾讯
	Part       string    `json:"part"`        // 当前分P标题
	Duration   int       `json:"duration"`    // 当前分P持续时间。单位为秒
	Vid        string    `json:"vid"`         // 站外视频vid
	Weblink    string    `json:"weblink"`     // 站外视频跳转url
	Dimension  Dimension `json:"dimension"`   // 当前分P分辨率。有部分视频无法获取分辨率
	FirstFrame string    `json:"first_frame"` // 分P封面
}

type VideoParam

type VideoParam struct {
	Aid  int    `json:"aid,omitempty" request:"query,omitempty"`  // 稿件avid。avid与bvid任选一个
	Bvid string `json:"bvid,omitempty" request:"query,omitempty"` // 稿件bvid。avid与bvid任选一个
}

type VideoRights

type VideoRights struct {
	Bp            int `json:"bp"`              // 是否允许承包
	Elec          int `json:"elec"`            // 是否支持充电
	Download      int `json:"download"`        // 是否允许下载
	Movie         int `json:"movie"`           // 是否电影
	Pay           int `json:"pay"`             // 是否PGC付费
	Hd5           int `json:"hd5"`             // 是否有高码率
	NoReprint     int `json:"no_reprint"`      // 是否显示“禁止转载”标志
	Autoplay      int `json:"autoplay"`        // 是否自动播放
	UgcPay        int `json:"ugc_pay"`         // 是否UGC付费
	IsCooperation int `json:"is_cooperation"`  // 是否为联合投稿
	UgcPayPreview int `json:"ugc_pay_preview"` // 0。作用尚不明确
	NoBackground  int `json:"no_background"`   // 0。作用尚不明确
	CleanMode     int `json:"clean_mode"`      // 0。作用尚不明确
	IsSteinGate   int `json:"is_stein_gate"`   // 是否为互动视频
	Is360         int `json:"is_360"`          // 是否为全景视频
	NoShare       int `json:"no_share"`        // 0。作用尚不明确
	ArcPay        int `json:"arc_pay"`         // 0。作用尚不明确
	FreeWatch     int `json:"free_watch"`      // 0。作用尚不明确
}

type VideoStat

type VideoStat struct {
	Aid        int    `json:"aid"`        // 稿件avid
	View       int    `json:"view"`       // 播放数
	Danmaku    int    `json:"danmaku"`    // 弹幕数
	Reply      int    `json:"reply"`      // 评论数
	Favorite   int    `json:"favorite"`   // 收藏数
	Coin       int    `json:"coin"`       // 投币数
	Share      int    `json:"share"`      // 分享数
	NowRank    int    `json:"now_rank"`   // 当前排名
	HisRank    int    `json:"his_rank"`   // 历史最高排行
	Like       int    `json:"like"`       // 获赞数
	Dislike    int    `json:"dislike"`    // 点踩数。恒为0
	Evaluation string `json:"evaluation"` // 视频评分
	Vt         int    `json:"vt"`         // 作用尚不明确。恒为0
}

type VideoStatusNumber

type VideoStatusNumber struct {
	Aid        int    `json:"aid"`        // 稿件avid
	Bvid       string `json:"bvid"`       // 稿件bvid
	View       any    `json:"view"`       // 正常:播放次数(num)。屏蔽:"--"(str)
	Danmaku    int    `json:"danmaku"`    // 弹幕条数
	Reply      int    `json:"reply"`      // 评论条数
	Favorite   int    `json:"favorite"`   // 收藏人数
	Coin       int    `json:"coin"`       // 投币枚数
	Share      int    `json:"share"`      // 分享次数
	NowRank    int    `json:"now_rank"`   // 0。作用尚不明确
	HisRank    int    `json:"his_rank"`   // 历史最高排行
	Like       int    `json:"like"`       // 获赞次数
	Dislike    int    `json:"dislike"`    // 0。作用尚不明确
	NoReprint  int    `json:"no_reprint"` // 禁止转载标志。0:无。1:禁止
	Copyright  int    `json:"copyright"`  // 版权标志。1:自制。2:转载
	ArgueMsg   string `json:"argue_msg"`  // 警告信息。默认为空
	Evaluation string `json:"evaluation"` // 视频评分。默认为空
}

type VideoSubtitle

type VideoSubtitle struct {
	Id          int                 `json:"id"`           // 字幕id
	Lan         string              `json:"lan"`          // 字幕语言
	LanDoc      string              `json:"lan_doc"`      // 字幕语言名称
	IsLock      bool                `json:"is_lock"`      // 是否锁定
	AuthorMid   int                 `json:"author_mid"`   // 字幕上传者mid
	SubtitleUrl string              `json:"subtitle_url"` // json格式字幕文件url
	Author      VideoSubtitleAuthor `json:"author"`       // 字幕上传者信息
}

type VideoSubtitleAuthor

type VideoSubtitleAuthor struct {
	Mid           int    `json:"mid"`             // 字幕上传者mid
	Name          string `json:"name"`            // 字幕上传者昵称
	Sex           string `json:"sex"`             // 字幕上传者性别。男 女 保密
	Face          string `json:"face"`            // 字幕上传者头像url
	Sign          string `json:"sign"`            // 字幕上传者签名
	Rank          int    `json:"rank"`            // 10000。作用尚不明确
	Birthday      int    `json:"birthday"`        // 0。作用尚不明确
	IsFakeAccount int    `json:"is_fake_account"` // 0。作用尚不明确
	IsDeleted     int    `json:"is_deleted"`      // 0。作用尚不明确
}

type VideoSubtitles

type VideoSubtitles struct {
	AllowSubmit bool            `json:"allow_submit"` // 是否允许提交字幕
	List        []VideoSubtitle `json:"list"`         // 字幕列表
}

type VideoTag

type VideoTag struct {
	TagId        int         `json:"tag_id"`        // tag_id
	TagName      string      `json:"tag_name"`      // TAG名称
	Cover        string      `json:"cover"`         // TAG图片url
	HeadCover    string      `json:"head_cover"`    // TAG页面头图url
	Content      string      `json:"content"`       // TAG介绍
	ShortContent string      `json:"short_content"` // TAG简介
	Type         int         `json:"type"`          // ???
	State        int         `json:"state"`         // 0
	Ctime        int         `json:"ctime"`         // 创建时间。时间戳
	Count        StatusCount `json:"count"`         // 状态数
	IsAtten      int         `json:"is_atten"`      // 是否关注。0:未关注。1:已关注。需要登录(Cookie) 。未登录为0
	Likes        int         `json:"likes"`         // 0。作用尚不明确
	Hates        int         `json:"hates"`         // 0。作用尚不明确
	Attribute    int         `json:"attribute"`     // 0。作用尚不明确
	Liked        int         `json:"liked"`         // 是否已经点赞。0:未点赞。1:已点赞。需要登录(Cookie) 。未登录为0
	Hated        int         `json:"hated"`         // 是否已经点踩。0:未点踩。1:已点踩。需要登录(Cookie) 。未登录为0
	ExtraAttr    int         `json:"extra_attr"`    // ? ? ?
}

type VideoTagParam

type VideoTagParam struct {
	Aid   int `json:"aid"`    // 稿件avid
	TagId int `json:"tag_id"` // tag_id
}

type Vip

type Vip struct {
	Viptype            int      `json:"vipType"`              // 大会员类型。0:无。1:月会员。2:年以上会员
	Vipduedate         int      `json:"vipDueDate"`           // 大会员到期时间。毫秒 时间戳
	Dueremark          string   `json:"dueRemark"`            // (?)
	Accessstatus       int      `json:"accessStatus"`         // (?)
	Vipstatus          int      `json:"vipStatus"`            // 大会员状态。0:无。1:有
	Vipstatuswarn      string   `json:"vipStatusWarn"`        // (?)
	ThemeType          int      `json:"theme_type"`           // 会员样式 id
	Label              VipLabel `json:"label"`                // 会员铭牌样式
	AvatarSubscript    int      `json:"avatar_subscript"`     // (?)
	AvatarSubscriptUrl string   `json:"avatar_subscript_url"` // (?)
	NicknameColor      string   `json:"nickname_color"`       // 昵称颜色
}

type VipCenterInfo

type VipCenterInfo struct {
	User              VipUser           `json:"user"`               // 用户信息
	Wallet            VipWallet         `json:"wallet"`             // 钱包信息
	UnionVip          any               `json:"union_vip"`          // 联合会员信息列表,web 端:null。APP 端:array
	OtherOpenInfo     any               `json:"other_open_info"`    // 其他开通方式信息列表,web 端:null。APP 端:array
	Privileges        []Privilege       `json:"privileges"`         // 会员特权信息列表
	Banners           []Banner          `json:"banners"`            // banner 卡片列表。web 端为空
	Welfare           Welfare           `json:"welfare"`            // 福利信息
	RecommendPendants RecommendPendants `json:"recommend_pendants"` // 推荐头像框信息
	RecommendCards    RecommendCards    `json:"recommend_cards"`    // 推荐装扮信息
	Sort              []Sort            `json:"sort"`
	InReview          bool              `json:"in_review"`
	BigPoint          BigPoint          `json:"big_point"` // 大积分信息
	HotList           any               `json:"hot_list"`  // 热门榜单类型信息
}

type VipLabel

type VipLabel struct {
	Path        string `json:"path"`         // (?)
	Text        string `json:"text"`         // 会员类型文案
	LabelTheme  string `json:"label_theme"`  // 会员类型。vip:大会员。annual_vip:年度大会员。ten_annual_vip:十年大会员。hundred_annual_vip:百年大会员
	TextColor   string `json:"text_color"`   // 文字颜色?
	BgStyle     int    `json:"bg_style"`     // (?)
	BgColor     string `json:"bg_color"`     // 背景颜色?
	BorderColor string `json:"border_color"` // 描边颜色?
}

type VipPrivilege

type VipPrivilege struct {
	List           []VipPrivilegeInfo `json:"list"`             // 卡券信息列表
	IsShortVip     bool               `json:"is_short_vip"`     // (?)
	IsFreightOpen  bool               `json:"is_freight_open"`  // (?)
	Level          int                `json:"level"`            // 当前等级
	CurExp         int                `json:"cur_exp"`          // 当前拥有经验值
	NextExp        int                `json:"next_exp"`         // 升级所需经验值。满级时为 -1
	IsVip          bool               `json:"is_vip"`           // 是否为大会员
	IsSeniorMember int                `json:"is_senior_member"` // (?)
	Format060102   int                `json:"format060102"`     // (?)
}

type VipPrivilegeInfo

type VipPrivilegeInfo struct {
	Type            int `json:"type"`              // 卡券类型。详见 list 数组表格中的 type 项
	State           int `json:"state"`             // 兑换状态。0:未兑换。1:已兑换。2:未完成(若需要完成)
	ExpireTime      int `json:"expire_time"`       // 本轮卡券过期时间戳。当月月底/当日24点
	VipType         int `json:"vip_type"`          // 当前用户的大会员状态。2:年度大会员
	NextReceiveDays int `json:"next_receive_days"` // 距下一轮兑换剩余天数。无权限时,每月任务固定为 0,每日固定为 1
	PeriodEndUnix   int `json:"period_end_unix"`   // 下一轮兑换开始时间戳。秒级时间戳
}

type VipUser

type VipUser struct {
	Account              VipUserAccount `json:"account"`                // 账号基本信息
	Vip                  VipUserVip     `json:"vip"`                    // 账号会员信息
	Tv                   VipUserTv      `json:"tv"`                     // 电视会员信息
	BackgroundImageSmall string         `json:"background_image_small"` // 空
	BackgroundImageBig   string         `json:"background_image_big"`   // 空
	PanelTitle           string         `json:"panel_title"`            // 用户昵称
	AvatarPendant        AvatarPendant  `json:"avatar_pendant"`         // 用户头像框信息
	VipOverdueExplain    string         `json:"vip_overdue_explain"`    // 大会员提示文案。有效期 / 到期
	TvOverdueExplain     string         `json:"tv_overdue_explain"`     // 电视大会员提示文案。有效期 / 到期
	AccountExceptionText string         `json:"account_exception_text"` // 空
	IsAutoRenew          bool           `json:"is_auto_renew"`          // 是否自动续费。true:是。false:否
	IsTvAutoRenew        bool           `json:"is_tv_auto_renew"`       // 是否自动续费电视大会员。true:是。false:否
	SurplusSeconds       int            `json:"surplus_seconds"`        // 大会员到期剩余时间。单位为秒
	VipKeepTime          int            `json:"vip_keep_time"`          // 持续开通大会员时间。单位为秒
	Renew                any            `json:"renew"`                  // (?)
	Notice               any            `json:"notice"`                 // (?)
}

type VipUserAccount

type VipUserAccount struct {
	Mid            int    `json:"mid"`              // 用户 mid
	Name           string `json:"name"`             // 昵称
	Sex            string `json:"sex"`              // 性别。男 / 女 / 保密
	Face           string `json:"face"`             // 头像 url
	Sign           string `json:"sign"`             // 签名
	Rank           int    `json:"rank"`             // 等级
	Birthday       int    `json:"birthday"`         // 生日。秒时间戳
	IsFakeAccount  int    `json:"is_fake_account"`  // (?)
	IsDeleted      int    `json:"is_deleted"`       // 是否注销。0:正常。1:注销
	InRegAudit     int    `json:"in_reg_audit"`     // 是否注册审核。0:正常。1:审核
	IsSeniorMember int    `json:"is_senior_member"` // 是否转正。0:未转正。1:正式会员
}

type VipUserTv

type VipUserTv struct {
	Type       int `json:"type"`         // 电视大会员类型。0:无。1:月大会员。2:年度及以上大会员
	VipPayType int `json:"vip_pay_type"` // 电视大支付类型。0:未支付(常见于官方账号)。1:已支付(以正常渠道获取的大会员均为此值)
	Status     int `json:"status"`       // 电视大会员状态。0:无。1:有
	DueDate    int `json:"due_date"`     // 电视大会员过期时间。毫秒时间戳
}

type VipUserVip

type VipUserVip struct {
	Mid             int    `json:"mid"`              // 用户 mid
	VipType         int    `json:"vip_type"`         // 会员类型。0:无。1:月大会员。2:年度及以上大会员
	VipStatus       int    `json:"vip_status"`       // 会员状态。0:无。1:有
	VipDueDate      int    `json:"vip_due_date"`     // 会员过期时间。毫秒时间戳
	VipPayType      int    `json:"vip_pay_type"`     // 支付类型。0:未支付(常见于官方账号)。1:已支付(以正常渠道获取的大会员均为此值)
	ThemeType       int    `json:"theme_type"`       // (?)
	Label           Label  `json:"label"`            // 会员标签
	AvatarSubscript int    `json:"avatar_subscript"` // 是否显示会员图标。0:不显示。1:显示
	NicknameColor   string `json:"nickname_color"`   // 会员昵称颜色。颜色码,一般为#FB7299,曾用于愚人节改变大会员配色
	IsNewUser       bool   `json:"is_new_user"`      // (?)
	TipMaterial     any    `json:"tip_material"`     // (?)
}

type VipWallet

type VipWallet struct {
	Coupon            int  `json:"coupon"`             // 当前 B 币券
	Point             int  `json:"point"`              // (?)
	PrivilegeReceived bool `json:"privilege_received"` // (?)
}

type WBI

type WBI struct {
	// contains filtered or unexported fields
}

WBI 签名实现 如果希望以登录的方式获取则使用 WithCookies or WithRawCookies 设置cookie 如果希望以未登录的方式获取 WithCookies(nil) 设置cookie为 nil 即可, 这是 Default 行为

!!! 使用 WBI 的接口 绝对不可以 set header Referer 会导致失败 !!!
!!! 大部分使用 WBI 的接口都需要 set header Cookie !!!

see https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/misc/sign/wbi.md

func NewDefaultWbi

func NewDefaultWbi() *WBI

func (*WBI) GenerateMixinKey

func (wbi *WBI) GenerateMixinKey(orig string) string

func (*WBI) GetKeys

func (wbi *WBI) GetKeys() (imgKey string, subKey string, err error)

func (*WBI) GetMixinKey

func (wbi *WBI) GetMixinKey() (string, error)

func (*WBI) SetKeys

func (wbi *WBI) SetKeys(imgKey, subKey string)

func (*WBI) SignMap

func (wbi *WBI) SignMap(payload map[string]string, ts time.Time) (newPayload map[string]string, err error)

func (*WBI) SignQuery

func (wbi *WBI) SignQuery(query url.Values, ts time.Time) (newQuery url.Values, err error)

func (*WBI) WithCookies

func (wbi *WBI) WithCookies(cookies []*http.Cookie) *WBI

func (*WBI) WithMixinKeyEncTab

func (wbi *WBI) WithMixinKeyEncTab(mixinKeyEncTab []int) *WBI

func (*WBI) WithRawCookies

func (wbi *WBI) WithRawCookies(rawCookies string) *WBI

func (*WBI) WithStorage

func (wbi *WBI) WithStorage(storage Storage) *WBI

func (*WBI) WithUpdateInterval

func (wbi *WBI) WithUpdateInterval(updateInterval time.Duration) *WBI

type Welfare

type Welfare struct {
	Count int           `json:"count"` // 福利数
	List  []WelfareItem `json:"list"`  // 福利项目列表
}

type WelfareItem

type WelfareItem struct {
	Id          int    `json:"id"`           // 福利 id
	Name        string `json:"name"`         // 福利名称
	HomepageUri string `json:"homepage_uri"` // 福利图片 url
	BackdropUri string `json:"backdrop_uri"` // 福利图片 banner url
	Tid         int    `json:"tid"`          // (?)。目前为0
	Rank        int    `json:"rank"`         // 排列顺序
	ReceiveUri  string `json:"receive_uri"`  // 福利跳转页 url
}

type ZoneInfo

type ZoneInfo struct {
	Name      string //中文名称
	Code      string //代号即英文名
	MasterTid int    //主分区tid
	Tid       int    //子分区tid
	Overview  string //概述,简介
}

ZoneInfo 结构体用来表示CSV文件中的数据, 包含名称、代码、主分区tid、子分区tid,概述和备注等信息

func GetAllZoneInfos

func GetAllZoneInfos() ([]ZoneInfo, error)

GetAllZoneInfos 获取所有ZoneInfo对象

func GetZoneInfoByTid

func GetZoneInfoByTid(tid int) (ZoneInfo, error)

GetZoneInfoByTid 根据名称获取ZoneInfo对象

func (ZoneInfo) GetDescription

func (info ZoneInfo) GetDescription() string

GetDescription 获取ZoneInfo对象的描述信息,描述信息分为四个部分。当前分区,主分区,描述和备注。

type ZoneLocation

type ZoneLocation struct {
	Addr        string `json:"addr"`         // 公网IP地址
	Country     string `json:"country"`      // 国家/地区名
	Province    string `json:"province"`     // 省/州。非必须存在项
	City        string `json:"city"`         // 城市。非必须存在项
	Isp         string `json:"isp"`          // 运营商名
	Latitude    int    `json:"latitude"`     // 纬度
	Longitude   int    `json:"longitude"`    // 经度
	ZoneId      int    `json:"zone_id"`      // ip数据库id
	CountryCode int    `json:"country_code"` // 国家/地区代码
}

Jump to

Keyboard shortcuts

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