biligo

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

README

logo

BiliBili-API-GO

BiliBili API SDK in Golang


简介

BiliBili APIGolang 实现,目前已经实现了 100+ API,还在进一步更新中

特性

  • 良好的设计,支持更换 clientUA
  • 完善的单元测试,易懂的函数命名,极少的第三方库依赖
  • 代码、结构体注释完善,无需文档开箱即用
  • 其他功能性代码,例如 AV/BV互转,GetVideoZone()获取分区信息...

说明

  • 该项目永远不会编写直接涉及滥用的接口
  • 该项目仅供学习,请勿用于商业用途。任何使用该项目造成的后果由开发者自行承担

参考

感谢以下所有项目的贡献者

https://github.com/SocialSisterYi/bilibili-API-collect

https://github.com/MoyuScript/bilibili-api

快速开始

安装

请让 bilibili-api-go 永远保持在最新版本

go get -u github.com/iyear/bilibili-api-go/v1
import "github.com/iyear/bilibili-api-go/v1"

使用

package main

import (
	"fmt"
	bg "github.com/iyear/bilibili-api-go/v1"
	"log"
)

func main() {
	b, err := bg.NewBiliClient(&bg.BiliSetting{
		// 均来自Web登录的Cookie
		Auth: &bg.CookieAuth{
			// DedeUserID
			DedeUserID: "YOUR_DedeUserID",
			// SESSDATA
			SESSDATA: "YOUR_SESSDATA",
			// bili_jct
			BiliJCT: "YOUR_BiliJCT",
			// DedeUserID__ckMd5
			DedeUserIDCkMd5: "YOUR_DedeUserIdCkMd5",
		},
		// DEBUG 模式将输出请求和响应
		DebugMode: true,
		// Client: myClient,
		// UserAgent: "My UA",
	})

	if err != nil {
		log.Fatal("failed to make new bili client; error: ", err)
		return
	}

	fmt.Printf("mid: %d, uname: %s,userID: %s,rank: %s\n", b.Me.MID, b.Me.UName, b.Me.UserID, b.Me.Rank)
	fmt.Printf("birthday: %s,sex: %s\n", b.Me.Birthday, b.Me.Sex)
	fmt.Printf("sign: %s\n", b.Me.Sign)
}

例子

前往 https://github.com/iyear/bilibili-api-go/

说明

共有两种 Client

一种为 BiliClient,必须提供有效的 Auth 信息,公共接口不在此提供

另一种为 CommClient ,只提供公共接口

一些接口同时在两种 Client 中,因为其中某些字段在登录与非登录状态下有所区别

约定

除了维护API列表、 example 目录、测试文件,不会有任何其他的专用文档。请利用好注释和测试。

常规的函数命名方式

由于API众多,函数名显得冗长。只能尽可能简化,但不会失去原有语义,这是无文档的基础

除无对应分类的API外,其余对应分类API均以 分类名+动作+描述 命名

无对应分类的API以 动作+描述 命名 例如: VideoGetTags VideoIsFavoured VideoSetFavour

  • Video - 视频
  • Audio - 音频
  • Fav - 收藏夹
  • Chan - 频道
  • Space - 个人空间
  • Danmaku - 弹幕
  • Emote - 表情
  • Charge - 充电
  • Dyna - 动态
  • Live - 直播

结构体编写规范

所有嵌套都应当分离成单独的结构体

命名无需过于严谨,表达清楚嵌套层级即可

具体看 types.go 即可

只要以下名词出现在该库的任何地方,可能将不做任何解释,请提交PR时尽可能遵守以下约定

  • aid - 稿件av (库中所有参数均使用 aidbvid 请开发者自行使用 BV2AV())
  • cid - 稿件分P的ID (单P视频中aidcid) 或 频道ID
  • mid - B站ID
  • mlid - 收藏夹ID
  • auid - 音频ID
  • dmid - 弹幕ID
  • oid - 根据上下文不同分别指代以上不同的ID,具体看注释
  • ID 而不是 Id
  • URL 而不是 Url

关于大接口

对于评论、搜索这种超大的响应,可能不会做对应的接口,一方面这种接口经常变更,另一方面大多数的响应字段是无用的,所以请开发者自行使用 Raw() or RawParse() + gjson 获取需要的数据

示例:

package main

import (
	"fmt"
	bg "github.com/iyear/bilibili-api-go/v1"
	"github.com/tidwall/gjson"
	"log"
)

func GetComments() {
	resp, err := bg.NewCommClient(&bg.CommSetting{}).RawParse(
		bg.BiliApiURL,
		"x/v2/reply/main",
		"GET",
		map[string]string{
			"next": "0",
			"type": "1",
			"oid":  "591018280",
			"mode": "3",
			"plat": "1",
		},
	)
	if err != nil {
		log.Println(err)
		return
	}
	for i, r := range gjson.Get(string(resp.Data), "replies.#.content.message").Array() {
		fmt.Printf("[%d] %s\n\n", i+1, r.String())
	}
}

维护与贡献

  • 这个库的日常维护基本都是体力活
  • 安全水平有限,部分新接口我无法分析
  • 欢迎 typo 和 完善注释、文档的PR
  • 不接受无脑无贡献的催更
  • 尽量遵守约定提交PR
  • 由于项目特殊性,随时可能删库,随时可能弃坑

已实现API

https://github.com/iyear/bilibili-api-go/blob/v1/API.md

留言

1

这个库是在暑假开始写的,其实写到一半已经不想写了,90%的代码都是在重复着查接口、写响应结构体、测试的过程,只是看到 python 有一套还在更新的 SDK,想着还是为 Golang 也写一套

后来某天突然想把这个项目给弄完 ,所以目前动态与直播的部分基本没写

2

map[string]string 而不是 map[string]interface{} 因为在这个项目里 interface{} 的无约束很容易在一些特定的参数下忘记转换。

LICENSE

GPL

Documentation

Index

Constants

View Source
const (
	BiliApiURL      = "https://api.bilibili.com/"
	BiliMainURL     = "https://www.bilibili.com/"
	BiliPassportURL = "https://passport.bilibili.com/"
	BiliElecURL     = "https://elec.bilibili.com/"
	BiliLiveURL     = "https://api.live.bilibili.com/"
)

Variables

This section is empty.

Functions

func AV2BV

func AV2BV(av int64) string

AV2BV 带BV前缀

func BV2AV

func BV2AV(bv string) int64

BV2AV 带BV前缀

Types

type Account

type Account struct {
	MID      int64  `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 AccountSafetyInfo

type AccountSafetyInfo struct {
	HideTel           string `json:"hide_tel"`           // 绑定的手机号	星号隐藏部分信息
	HideMail          string `json:"hide_mail"`          // 绑定的邮箱 星号隐藏部分信息
	BindTel           bool   `json:"bind_tel"`           // 是否绑定手机号
	BindMail          bool   `json:"bind_mail"`          // 是否绑定邮箱
	TelVerify         bool   `json:"tel_verify"`         // 是否验证手机号
	MailVerify        bool   `json:"mail_verify"`        // 是否验证邮箱
	UnneededCheck     bool   `json:"unneeded_check"`     // 是否未设置密码 注意:true为未设置,false为已设置
	RealnameCertified bool   `json:"realname_certified"` // 是否实名认证 文档中未更新此项
}

type AccountSafetyOther

type AccountSafetyOther struct {
	SkipVerify bool `json:"skipVerify"` // 恒为false 作用尚不明确
}

type AccountSafetySNS

type AccountSafetySNS struct {
	WeiboBind  int `json:"weibo_bind"`  // 是否绑定微博 0:未绑定 1:已绑定
	QQBind     int `json:"qq_bind"`     // 是否绑定qq	0:未绑定 1:已绑定
	WechatBind int `json:"wechat_bind"` // 是否绑定微信	0:未绑定 1:已绑定 文档中未更新此项
}

type AccountSafetySafe

type AccountSafetySafe struct {
	Score    int  `json:"score"`     // 当前密码强度 0-100
	PwdLevel int  `json:"pwd_level"` // 当前密码强度等级 1:弱 2:中 3:强
	Security bool `json:"security"`  // 当前密码是否安全
}

type AccountSafetyStat

type AccountSafetyStat struct {
	AccountInfo  *AccountSafetyInfo  `json:"account_info"` // 账号绑定信息
	AccountSafe  *AccountSafetySafe  `json:"account_safe"` // 密码安全信息
	AccountSNS   *AccountSafetySNS   `json:"account_sns"`  // 互联登录绑定信息
	AccountOther *AccountSafetyOther `json:"account_other"`
}

type AudioFavList

type AudioFavList struct {
	ID        int64             `json:"id"`        // 音频收藏夹mlid,歌单url里显示的是这个
	UID       int64             `json:"uid"`       // 创建用户mid
	Uname     string            `json:"uname"`     // 创建用户昵称
	Title     string            `json:"title"`     // 歌单标题
	Type      int               `json:"type"`      // 收藏夹属性 0:普通收藏夹 1:默认收藏夹
	Published int               `json:"published"` // 是否公开 0:不公开 1:公开
	Cover     string            `json:"cover"`     // 歌单封面图片url
	Ctime     int64             `json:"ctime"`     // 歌单创建时间 时间戳
	Song      int               `json:"song"`      // 歌单中的音乐数量
	Desc      string            `json:"desc"`      // 歌单备注信息
	Sids      []int64           `json:"sids"`      // 歌单中的音乐的auid
	MenuID    int64             `json:"menuId"`    // 音频收藏夹对应的歌单amid
	Statistic *AudioFavListStat `json:"statistic"` // 歌单状态数信息
}

type AudioFavListStat

type AudioFavListStat struct {
	SID     int64 `json:"sid"`     // 音频收藏夹对应的歌单amid
	Play    int64 `json:"play"`    // 播放次数
	Collect int   `json:"collect"` // 收藏数
	Comment int   `json:"comment"` // 评论数
	Share   int   `json:"share"`   // 分享数
}

type AudioInfo

type AudioInfo struct {
	ID         int64          `json:"id"`         // 音频auid
	UID        int64          `json:"uid"`        // UP主mid
	Uname      string         `json:"uname"`      // UP主昵称
	Author     string         `json:"author"`     // 作者名
	Title      string         `json:"title"`      // 歌曲标题
	Cover      string         `json:"cover"`      // 封面图片url
	Intro      string         `json:"intro"`      // 歌曲简介
	Lyric      string         `json:"lyric"`      // lrc歌词url
	CrType     int            `json:"crtype"`     // 1 作用尚不明确
	Duration   int64          `json:"duration"`   // 歌曲时间长度 单位为秒
	PassTime   int64          `json:"passtime"`   // 歌曲发布时间 时间戳
	CurTime    int64          `json:"curtime"`    // 当前请求时间	时间戳
	AID        int64          `json:"aid"`        // 关联稿件avid 无为0
	BVID       string         `json:"bvid"`       // 关联稿件bvid 无为空
	CID        int64          `json:"cid"`        // 关联视频cid 无为0
	MsID       int            `json:"msid"`       // 0 作用尚不明确
	Attr       int            `json:"attr"`       // 0 作用尚不明确
	Limit      int            `json:"limit"`      // 0 作用尚不明确
	ActivityID int            `json:"activityId"` // 0 作用尚不明确
	LimitDesc  string         `json:"limitdesc"`  // 0 作用尚不明确
	Ctime      int64          `json:"ctime"`      // 0 作用尚不明确
	Statistic  *AudioInfoStat `json:"statistic"`  // 状态数
	VipInfo    *AudioInfoVip  `json:"vipInfo"`    // UP主会员状态
	CollectIDs []int64        `json:"collectIds"` // 歌曲所在的收藏夹mlids 需要登录(SESSDATA)
	CoinNum    int            `json:"coin_num"`   // 投币数
}

type AudioInfoStat

type AudioInfoStat struct {
	SID     int64 `json:"sid"`     // 音频auid
	Play    int64 `json:"play"`    // 播放次数
	Collect int   `json:"collect"` // 收藏数
	Comment int   `json:"comment"` // 评论数
	Share   int   `json:"share"`   // 分享数
}

type AudioInfoVip

type AudioInfoVip struct {
	// 会员类型
	//
	// 0:无
	//
	// 1:月会员
	//
	// 2:年会员
	Type       int   `json:"type"`
	Status     int   `json:"status"`       // 会员状态 0:无 1:有
	DueDate    int64 `json:"due_date"`     // 会员到期时间 时间戳 毫秒
	VipPayType int   `json:"vip_pay_type"` // 会员开通状态 0:无 1:有
}

type AudioMember

type AudioMember struct {
	List []*AudioMemberList `json:"list"` // 成员列表
	// 成员类型代码
	//
	// 1:歌手
	//
	// 2:作词
	//
	// 3:作曲
	//
	// 4:编曲
	//
	// 5:后期/混音
	//
	// 7:封面制作
	//
	// 8:音源
	//
	// 9:调音
	//
	// 10:演奏
	//
	// 11:乐器
	//
	// 127:UP主
	Type int `json:"type"`
}

type AudioMemberList

type AudioMemberList struct {
	MID      int64  `json:"mid"`       // 0 作用尚不明确
	Name     string `json:"name"`      // 成员名
	MemberID int64  `json:"member_id"` // 成员id??反正不是mid 作用尚不明确
}

type AudioMyFavLists

type AudioMyFavLists struct {
	CurPage   int             `json:"curPage"`   // 当前页码
	PageCount int             `json:"pageCount"` // 总计页数
	TotalSize int             `json:"totalSize"` // 总计收藏夹数
	PageSize  int             `json:"pageSize"`  // 当前页面项数
	Data      []*AudioFavList `json:"data"`      // 歌单列表
}

type AudioPlayURL

type AudioPlayURL struct {
	SID int64 `json:"sid"` // 音频auid
	// 音质标识
	//
	// -1:试听片段(192K)
	//
	// 0:128K
	//
	// 1:192K
	//
	// 2:320K
	//
	// 3:FLAC
	Type      int               `json:"type"`
	Info      string            `json:"info"`      // 空	作用尚不明确
	Timeout   int64             `json:"timeout"`   // 有效时长 单位为秒 一般为3h
	Size      int64             `json:"size"`      // 文件大小	单位为字节 当type为-1时size为0
	CDNs      []string          `json:"cdns"`      // 音频流url
	Qualities []*AudioPlayURLQn `json:"qualities"` // 音质列表
	Title     string            `json:"title"`     // 音频标题
	Cover     string            `json:"cover"`     // 音频封面url
}

type AudioPlayURLQn

type AudioPlayURLQn struct {
	Type        int    `json:"type"`        // 音质代码
	Desc        string `json:"desc"`        // 音质名称
	Size        int64  `json:"size"`        // 该音质的文件大小 单位为字节
	Bps         string `json:"bps"`         // 比特率标签
	Tag         string `json:"tag"`         // 音质标签
	Require     int    `json:"require"`     // 是否需要会员权限 0:不需要 1:需要
	RequireDesc string `json:"requiredesc"` // 会员权限标签
}

type AudioTag

type AudioTag struct {
	Type    string `json:"type"`    // song 作用尚不明确
	Subtype int    `json:"subtype"` // ??? 作用尚不明确
	Key     int64  `json:"key"`     // TAG id?? 作用尚不明确
	Info    string `json:"info"`    // TAG名
}

type BiliClient

type BiliClient struct {
	Me *Account
	// contains filtered or unexported fields
}

func NewBiliClient

func NewBiliClient(setting *BiliSetting) (*BiliClient, error)

NewBiliClient

带有账户Cookie的Client,用于访问私人操作API

func (*BiliClient) AudioGetInfo

func (b *BiliClient) AudioGetInfo(auid int64) (*AudioInfo, error)

AudioGetInfo

获取音频信息

func (*BiliClient) AudioGetMyFavLists

func (b *BiliClient) AudioGetMyFavLists(pn int, ps int) (*AudioMyFavLists, error)

AudioGetMyFavLists 获取自己创建的歌单

pn 页码

ps 每页项数

func (*BiliClient) AudioGetPlayURL

func (b *BiliClient) AudioGetPlayURL(auid int64, qn int) (*AudioPlayURL, error)

AudioGetPlayURL 获取音频流URL

qn 音质

0 流畅 128K

1 标准 192K

2 高品质 320K

3 无损 FLAC(大会员)

取流:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/audio/musicstream_url.md#%E9%9F%B3%E9%A2%91%E6%B5%81%E7%9A%84%E8%8E%B7%E5%8F%96

func (*BiliClient) AudioIsCoined

func (b *BiliClient) AudioIsCoined(auid int64) (int, error)

AudioIsCoined 获取音频是否被投币

返回投币数

func (*BiliClient) AudioIsFavored

func (b *BiliClient) AudioIsFavored(auid int64) (bool, error)

AudioIsFavored

查询音频是否被收藏

func (*BiliClient) ChanAdd

func (b *BiliClient) ChanAdd(name string, intro string) (int64, error)

ChanAdd

创建频道 创建成功后会返回新建频道的id

name 频道名

intro 频道介绍

func (*BiliClient) ChanAddVideo

func (b *BiliClient) ChanAddVideo(cid int64, aids []int64) ([]int64, error)

ChanAddVideo 频道添加视频,返回添加错误的视频aid

仅能添加自己是UP主的视频

如添加多个视频,仅会添加正确的

func (*BiliClient) ChanDel

func (b *BiliClient) ChanDel(cid int64) error

ChanDel 删除频道

cid 频道id

func (*BiliClient) ChanDelVideo

func (b *BiliClient) ChanDelVideo(cid int64, aid int64) error

ChanDelVideo

删除频道视频

func (*BiliClient) ChanEdit

func (b *BiliClient) ChanEdit(cid int64, name string, intro string) error

ChanEdit 编辑频道

cid 频道id

name 频道名

intro 频道介绍

func (*BiliClient) ChanGetMy

func (b *BiliClient) ChanGetMy() (*ChannelList, error)

ChanGetMy

获取我的频道列表

func (*BiliClient) ChanGetMyVideo

func (b *BiliClient) ChanGetMyVideo(cid int64, pn int, ps int) (*ChanVideo, error)

ChanGetMyVideo

获取我的频道视频

cid 频道ID

pn 页码

ps 每页项数

func (*BiliClient) ChanHasInvalidVideo

func (b *BiliClient) ChanHasInvalidVideo(cid int64) error

ChanHasInvalidVideo

检查频道是否有失效视频,若有以错误形式返回(错误码:53005)

若Err为nil则没有无效视频

func (*BiliClient) ChanSetVideoSort

func (b *BiliClient) ChanSetVideoSort(cid int64, aid int64, to int) error

ChanSetVideoSort 调整频道视频顺序

to 视频排序倒数位置 1为列表底部,视频总数为首端,与显示顺序恰好相反

func (*BiliClient) ChargeSetMessage

func (b *BiliClient) ChargeSetMessage(order string, message string) error

ChargeSetMessage 发送充电留言

order 订单号,从充电成功的响应中获取

func (*BiliClient) ChargeTradeCheckQrCode

func (b *BiliClient) ChargeTradeCheckQrCode(token string) (*ChargeQrCodeStatus, error)

ChargeTradeCheckQrCode 获取第三方充电支付状态

token ChargeTradeCreateQrCode 中返回的token

func (*BiliClient) ChargeTradeCreateBp

func (b *BiliClient) ChargeTradeCreateBp(num int, mid int64, otype string, oid int64) (*ChargeBpResult, error)

ChargeTradeCreateBp 充电

num B币数量 必须在2-9999之间

mid 充电对象用户mid

otype 充电来源 up:空间充电 archive:视频充电

oid 充电来源代码 空间充电:充电对象用户mid 视频充电:稿件aid

func (*BiliClient) ChargeTradeCreateQrCode

func (b *BiliClient) ChargeTradeCreateQrCode(num int, prior bool, mid int64, otype string, oid int64) (*ChargeCreateQrCode, error)

ChargeTradeCreateQrCode 第三方如支付宝、微信充电

num B币数量 必须在2-9999之间,1-19区间视为充值B币(未测试)

prior 是否优先扣除B币余额

mid 充电对象用户mid

otype 充电来源 up:空间充电 archive:视频充电

oid 充电来源代码 空间充电:充电对象用户mid 视频充电:稿件aid

整个支付流程请看:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/electric/WeChat&Alipay.md

func (*BiliClient) DanmakuCommandPost

func (b *BiliClient) DanmakuCommandPost(tp int, aid int64, cid int64, progress int64, platform int, data string, dmid uint64) (*DanmakuCommandPostResult, error)

DanmakuCommandPost 发送互动弹幕,只能在自己的视频发

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E5%8F%91%E9%80%81%E4%BA%92%E5%8A%A8%E5%BC%B9%E5%B9%95

tp 互动弹幕类型 1:UP主头像弹幕 2:关联视频弹幕 5:视频内嵌引导关注按钮

aid 稿件avid

cid 视频cid

progress 弹幕出现在视频内的时间(发送UP主头像弹幕时无用,传入即可)

platform 平台标识 1:web端 2:安卓端 8:视频管理页面

data JSON序列 具体请看 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E5%8F%91%E9%80%81%E4%BA%92%E5%8A%A8%E5%BC%B9%E5%B9%95

dmid 修改互动弹幕的弹幕id 不需要传入0即可 注意:修改弹幕platform必须为8

func (*BiliClient) DanmakuEditPool

func (b *BiliClient) DanmakuEditPool(tp int, cid int64, dmids []uint64, pool int) error

DanmakuEditPool 修改字幕池,只能操作自己的稿件或有骑士权限的稿件

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E4%BF%AE%E6%94%B9%E5%AD%97%E5%B9%95%E6%B1%A0

tp 弹幕类选择 1:视频弹幕

dmids 弹幕dmid数组

pool 操作代码 0:移出字幕池 1:移入字幕池

func (*BiliClient) DanmakuEditState

func (b *BiliClient) DanmakuEditState(tp int, cid int64, dmids []uint64, state int) error

DanmakuEditState 保护&删除弹幕,只能操作自己的稿件或有骑士权限的稿件

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E4%BF%9D%E6%8A%A4%E5%88%A0%E9%99%A4%E5%BC%B9%E5%B9%95

tp 弹幕类选择 1:视频弹幕

dmids 弹幕dmid数组

state 操作代码 1:删除弹幕 2:弹幕保护 3:取消保护

func (*BiliClient) DanmakuGetHistory

func (b *BiliClient) DanmakuGetHistory(cid int64, date string) (*DanmakuResp, error)

DanmakuGetHistory

获取历史弹幕

date 历史日期 YYYY-MM-DD

func (*BiliClient) DanmakuGetHistoryIndex

func (b *BiliClient) DanmakuGetHistoryIndex(cid int64, year int, month int) ([]string, error)

DanmakuGetHistoryIndex

获取历史弹幕日期,返回的日期代表有历史弹幕,用于请求历史弹幕

func (*BiliClient) DanmakuGetLikes

func (b *BiliClient) DanmakuGetLikes(cid int64, dmids []uint64) (map[uint64]*DanmakuGetLikesResult, error)

DanmakuGetLikes 获取弹幕点赞数,一次可以获取多条弹幕

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E6%9F%A5%E8%AF%A2%E5%BC%B9%E5%B9%95%E7%82%B9%E8%B5%9E%E6%95%B0

返回一个map,key为dmid,value为相关信息

func (*BiliClient) DanmakuLike

func (b *BiliClient) DanmakuLike(cid int64, dmid uint64, op int) error

DanmakuLike 点赞弹幕

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E7%82%B9%E8%B5%9E%E5%BC%B9%E5%B9%95

op 1:点赞 2:取消点赞

func (*BiliClient) DanmakuPost

func (b *BiliClient) DanmakuPost(tp int, aid int64, cid int64, msg string, progress int64, color int, fontsize int, pool int, mode int) (*DanmakuPostResult, error)

DanmakuPost 发送普通弹幕

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E5%8F%91%E9%80%81%E8%A7%86%E9%A2%91%E5%BC%B9%E5%B9%95

tp:类型 1:视频弹幕

aid 稿件avid

cid 用于区分分P

msg 弹幕内容 长度小于100字符

progress 弹幕出现在视频内的时间 单位为毫秒

color 弹幕颜色 十进制RGB888值 [默认为16777215(#FFFFFF)白色]

fontsize 弹幕字号 默认为25 极小:12 超小:16 小:18 标准:25 大:36 超大:45 极大:64

pool 弹幕池 0:普通池 1:字幕池 2:特殊池(代码/BAS弹幕) 默认为0

mode 弹幕类型 1:普通弹幕 4:底部弹幕 5:顶部弹幕 7:高级弹幕 9:BAS弹幕(pool必须为2)

func (*BiliClient) DanmakuRecall

func (b *BiliClient) DanmakuRecall(cid int64, dmid uint64) (string, error)

DanmakuRecall 仅能撤回自己两分钟内的弹幕,且每天机会有限额

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E6%92%A4%E5%9B%9E%E5%BC%B9%E5%B9%95

成功后显示剩余次数的文本信息 如 "撤回成功,你还有2次撤回机会"

func (*BiliClient) DanmakuReport

func (b *BiliClient) DanmakuReport(cid int64, dmid uint64, reason int, content string) error

DanmakuReport 举报弹幕

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E4%B8%BE%E6%8A%A5%E5%BC%B9%E5%B9%95

reason 1:违法违禁 2:色情低俗 3:赌博诈骗 4:人身攻击 5:侵犯隐私 6:垃圾广告 7:引战 8:剧透 9:恶意刷屏 10:视频无关 11:其他 12:青少年不良

content 其他举报备注(可空) reason=11时有效

func (*BiliClient) DanmakuSetConfig

func (b *BiliClient) DanmakuSetConfig(conf *DanmakuConfig) error

DanmakuSetConfig

弹幕个人配置修改

func (*BiliClient) EmotePackAdd

func (b *BiliClient) EmotePackAdd(id int64, business string) error

EmotePackAdd 添加表情包

只能添加有会员权限或已购买的表情包

id 表情包id

business 使用场景 reply:评论区 dynamic:动态

func (*BiliClient) EmotePackGetAll

func (b *BiliClient) EmotePackGetAll(business string) ([]*EmotePack, error)

EmotePackGetAll 获取全部表情包

business 使用场景 reply:评论区 dynamic:动态

B站接口导致必须登录才能获取

func (*BiliClient) EmotePackGetMy

func (b *BiliClient) EmotePackGetMy(business string) ([]*EmotePack, error)

EmotePackGetMy 获取我的表情包列表

business 使用场景 reply:评论区 dynamic:动态

func (*BiliClient) EmotePackRemove

func (b *BiliClient) EmotePackRemove(id int64, business string) error

EmotePackRemove 移除表情包

id 表情包id

business 使用场景 reply:评论区 dynamic:动态

func (*BiliClient) FavAdd

func (b *BiliClient) FavAdd(title string, intro string, privacy bool, cover string) (*FavDetail, error)

FavAdd 新建收藏夹

title 收藏夹标题

intro 收藏夹简介

privacy 是否私密 true:私密 false:公开

cover 封面图url,会审核,不需要请留空

func (*BiliClient) FavCleanRes

func (b *BiliClient) FavCleanRes(mlid int64) error

FavCleanRes

清除收藏夹失效内容

func (*BiliClient) FavCopyRes

func (b *BiliClient) FavCopyRes(from int64, to int64, mid int64, resources []string) error

FavCopyRes 收藏夹批量复制内容

例子:[]string{"21822819:2", "21918689:2", "22288065:2"}

from 源收藏夹mlid

to 目标收藏夹mlid

mid 当前用户mid

resources 目标内容id列表

字符串数组成员格式:{内容id}:{内容类型} 例子:

类型: 2:视频稿件 12:音频 21:视频合集

内容id:

视频稿件:视频稿件avid

音频:音频auid

视频合集:视频合集id

func (*BiliClient) FavDel

func (b *BiliClient) FavDel(mlids []int64) error

FavDel

删除收藏夹,传入需要删除的mlid数组

func (*BiliClient) FavDelRes

func (b *BiliClient) FavDelRes(mlid int64, resources []string) error

FavDelRes 收藏夹批量删除内容

resources 同 FavCopyRes

func (*BiliClient) FavEdit

func (b *BiliClient) FavEdit(mlid int64, title string, intro string, privacy bool, cover string) (*FavDetail, error)

FavEdit

编辑收藏夹 参数注释与 FavAdd 相同

func (*BiliClient) FavGetDetail

func (b *BiliClient) FavGetDetail(mlid int64) (*FavDetail, error)

FavGetDetail

获取收藏夹详细信息

func (*BiliClient) FavGetMy

func (b *BiliClient) FavGetMy() (*FavoritesList, error)

FavGetMy

获取我的收藏夹列表

func (*BiliClient) FavGetRes

func (b *BiliClient) FavGetRes(mlid int64) ([]*FavRes, error)

FavGetRes

获取收藏夹全部内容id

func (*BiliClient) FavGetResDetail

func (b *BiliClient) FavGetResDetail(mlid int64, tid int, keyword string, order string, tp int, pn int, ps int) (*FavResDetail, error)

FavGetResDetail 获取收藏夹内容详细内容,带过滤功能

tid 分区id,用于筛选,传入0代表所有分区

keyword 关键词筛选 可留空

order 留空默认按收藏时间

按收藏时间:mtime 按播放量: view 按投稿时间:pubtime

tp 内容类型 不知道作用,传入0即可

pn 页码

ps 每页项数 ps不能太大,会报错

func (*BiliClient) FavMoveRes

func (b *BiliClient) FavMoveRes(from int64, to int64, mid int64, resources []string) error

FavMoveRes 收藏夹批量移动内容

参数说明同 FavCopyRes

func (*BiliClient) GetAccountSafetyStat

func (b *BiliClient) GetAccountSafetyStat() (*AccountSafetyStat, error)

GetAccountSafetyStat

获取账户安全情况

func (*BiliClient) GetCoinLogs

func (b *BiliClient) GetCoinLogs() ([]*CoinLog, error)

GetCoinLogs

获取最近一周的硬币变化情况

func (*BiliClient) GetCookieAuth

func (b *BiliClient) GetCookieAuth() *CookieAuth

GetCookieAuth

获取Cookie信息

func (*BiliClient) GetExpCoinReward

func (b *BiliClient) GetExpCoinReward() (int, error)

GetExpCoinReward

获取每日投币获得经验数,不存在延迟 上限50经验

func (*BiliClient) GetExpRewardStat

func (b *BiliClient) GetExpRewardStat() (*ExpRewardStat, error)

GetExpRewardStat

获取每日经验任务和认证相关任务的完成情况

func (*BiliClient) GetMe

func (b *BiliClient) GetMe() (*Account, error)

GetMe

获取个人基本信息

func (*BiliClient) GetNavInfo

func (b *BiliClient) GetNavInfo() (*NavInfo, error)

GetNavInfo

获取我的导航栏信息(大部分的用户信息都在这里了)

func (*BiliClient) GetNavStat

func (b *BiliClient) GetNavStat() (*NavStat, error)

GetNavStat

获取我的状态数

func (*BiliClient) GetRealNameInfo

func (b *BiliClient) GetRealNameInfo() (*RealNameInfo, error)

GetRealNameInfo

获取账户实名认证详细信息

func (*BiliClient) GetRealNameStat

func (b *BiliClient) GetRealNameStat() (bool, error)

GetRealNameStat

获取账户实名认证状态

func (*BiliClient) GetRelationStat

func (b *BiliClient) GetRelationStat(mid int64) (*RelationStat, error)

GetRelationStat

获取关系状态数

func (*BiliClient) GetUpStat

func (b *BiliClient) GetUpStat(mid int64) (*UpStat, error)

GetUpStat

获取UP主状态数,该接口需要任意用户登录,否则不会返回任何数据

func (*BiliClient) GetVipStat

func (b *BiliClient) GetVipStat() (*VipStat, error)

GetVipStat

获取大会员信息

func (*BiliClient) Raw

func (b *BiliClient) Raw(base, endpoint, method string, payload map[string]string) ([]byte, error)

Raw base末尾带/

func (*BiliClient) RawParse

func (b *BiliClient) RawParse(base, endpoint, method string, payload map[string]string) (*Response, error)

func (*BiliClient) SetClient

func (b *BiliClient) SetClient(client *http.Client)

SetClient

设置Client,可以用来更换代理等操作

func (*BiliClient) SetUA

func (b *BiliClient) SetUA(ua string)

SetUA

设置UA

func (*BiliClient) SignUpdate

func (b *BiliClient) SignUpdate(sign string) error

SignUpdate

更新个性签名

func (*BiliClient) SpaceAddMasterpieces

func (b *BiliClient) SpaceAddMasterpieces(aid int64, reason string) error

SpaceAddMasterpieces 添加代表作 上限为3个稿件

reason 备注 最大40字符

func (*BiliClient) SpaceCancelMasterpiece

func (b *BiliClient) SpaceCancelMasterpiece(aid int64) error

SpaceCancelMasterpiece

取消代表作视频

func (*BiliClient) SpaceCancelTopArchive

func (b *BiliClient) SpaceCancelTopArchive() error

SpaceCancelTopArchive

取消置顶视频

func (*BiliClient) SpaceGetMyLastPlayGame

func (b *BiliClient) SpaceGetMyLastPlayGame() ([]*SpaceGame, error)

SpaceGetMyLastPlayGame

获取我的空间近期玩的游戏

func (*BiliClient) SpaceGetMyLastVideoCoin

func (b *BiliClient) SpaceGetMyLastVideoCoin() ([]*SpaceVideoCoin, error)

SpaceGetMyLastVideoCoin

获取我的最近投币的视频明细

func (*BiliClient) SpaceSetNotice

func (b *BiliClient) SpaceSetNotice(notice string) error

SpaceSetNotice 修改公告内容

删除公告留空即可 少于150字符

func (*BiliClient) SpaceSetTags

func (b *BiliClient) SpaceSetTags(tags []string) error

SpaceSetTags 设置用户个人TAG TAG里不要包含逗号会被当作分隔符

经过测试好像可以建54个TAG 各TAG长度小于10字符

删除TAG留空或省去即可 重复TAG会重复创建

感觉这个功能已经被废弃了

func (*BiliClient) SpaceSetTopArchive

func (b *BiliClient) SpaceSetTopArchive(aid int64, reason string) error

SpaceSetTopArchive 设置置顶视频

reason 备注 最大40字符

func (*BiliClient) VideoAddCoins

func (b *BiliClient) VideoAddCoins(aid int64, num int, like bool) error

VideoAddCoins 视频投币

aid 视频avid

num 投币数量,上限为2

like 是否附加点赞

func (*BiliClient) VideoAddLike

func (b *BiliClient) VideoAddLike(aid int64, like bool) error

VideoAddLike

点赞稿件

func (*BiliClient) VideoGetInfo

func (b *BiliClient) VideoGetInfo(aid int64) (*VideoInfo, error)

VideoGetInfo

返回视频详细信息,数据较多,可以使用单独的接口获取部分数据

func (*BiliClient) VideoGetPlayURL

func (b *BiliClient) VideoGetPlayURL(aid int64, cid int64, qn int, fnval int) (*VideoPlayURLResult, error)

VideoGetPlayURL 获取视频取流地址

所有参数、返回信息和取流方法的说明请直接前往:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/video/videostream_url.md

func (*BiliClient) VideoGetTags

func (b *BiliClient) VideoGetTags(aid int64) ([]*VideoTag, error)

VideoGetTags

获取稿件Tags

func (*BiliClient) VideoHateTag

func (b *BiliClient) VideoHateTag(aid int64, tagID int64) error

VideoHateTag 点踩视频的TAG

重复请求为取消

func (*BiliClient) VideoHeartBeat

func (b *BiliClient) VideoHeartBeat(aid int64, cid int64, playedTime int64) error

VideoHeartBeat 视频心跳包上报

默认间隔15秒一次,不要过慢或过快上报,控制好时间间隔

包含了 VideoReportProgress 的功能(应该)

func (*BiliClient) VideoIsAddedCoins

func (b *BiliClient) VideoIsAddedCoins(aid int64) (int, error)

VideoIsAddedCoins

返回投币数

func (*BiliClient) VideoIsFavoured

func (b *BiliClient) VideoIsFavoured(aid int64) (bool, error)

VideoIsFavoured

返回 是否被收藏

func (*BiliClient) VideoIsLiked

func (b *BiliClient) VideoIsLiked(aid int64) (bool, error)

VideoIsLiked

获取稿件是否被点赞

func (*BiliClient) VideoLikeTag

func (b *BiliClient) VideoLikeTag(aid int64, tagID int64) error

VideoLikeTag 点赞视频的TAG

重复请求为取消

func (*BiliClient) VideoReportProgress

func (b *BiliClient) VideoReportProgress(aid int64, cid int64, progress int64) error

VideoReportProgress 视频观看进度上报

cid用于分P标识,progress为观看进度(单位为秒)

不是心跳包,应该就是个历史记录和下次播放自动跳转的功能,一般是关闭当前视频页时请求

func (*BiliClient) VideoSetFavour

func (b *BiliClient) VideoSetFavour(aid int64, addLists []int64, delLists []int64) (bool, error)

VideoSetFavour 收藏视频,返回 [是否为未关注用户收藏] 的布尔值

addMediaLists 需要加入的收藏夹id 非必须 传入空切片或nil留空

delMediaLists 需要取消的收藏夹id 非必须 传入空切片或nil留空

func (*BiliClient) VideoShare

func (b *BiliClient) VideoShare(aid int64) (int, error)

VideoShare

完成分享并返回该视频当前分享数

func (*BiliClient) VideoTriple

func (b *BiliClient) VideoTriple(aid int64) (like, coin, favour bool, multiply int, e error)

VideoTriple

返回是否点赞成功、投币成功、收藏成功和投币枚数

type BiliSetting

type BiliSetting struct {
	// Cookie
	Auth *CookieAuth
	// 自定义http client
	//
	// 默认为 http.http.DefaultClient
	Client *http.Client
	// Debug模式 true将输出请求信息 false不输出
	//
	// 默认false
	DebugMode bool
	// 自定义UserAgent
	//
	// 默认Chrome随机Agent
	UserAgent string
}

type ChanInfo

type ChanInfo struct {
	CID   int64  `json:"cid"`   // 频道id
	Count int    `json:"count"` // 频道内含视频数
	Cover string `json:"cover"` // 封面图片url
	Intro string `json:"intro"` // 简介 无则为空
	MID   int64  `json:"mid"`   // 创建用户mid
	Mtime int64  `json:"mtime"` // 创建时间	时间戳
	Name  string `json:"name"`  // 标题
}

ChanInfo 原频道仍能使用,视频列表为新版频道,还未实现相关接口

type ChanVideo

type ChanVideo struct {
	List *ChanVideoList `json:"list"` // 频道信息
	Page *ChanVideoPage `json:"page"` // 页面信息
}

type ChanVideoInfo

type ChanVideoInfo struct {
	InterVideo bool `json:"inter_video"` // 是否为合作视频
	// contains filtered or unexported fields
}

type ChanVideoList

type ChanVideoList struct {
	Archives []*ChanVideoInfo `json:"archives"` // 包含的视频列表
	CID      int64            `json:"cid"`      // 频道id
	Count    int              `json:"count"`    // 频道内含视频数
	Cover    string           `json:"cover"`    // 封面图片url
	Intro    string           `json:"intro"`    // 简介 无则为空
	MID      int64            `json:"mid"`      // 创建用户mid
	Mtime    int64            `json:"mtime"`    // 创建时间 时间戳
	Name     string           `json:"name"`     // 标题
}

type ChanVideoPage

type ChanVideoPage struct {
	Count int // 总计视频数
	Num   int // 当前页码(可以用于请求下一页的数据计算)
	Size  int // 每页项数(可以用于请求下一页的数据计算)
}

type ChannelList

type ChannelList struct {
	Count int         `json:"count"` // 总计频道数
	List  []*ChanInfo `json:"list"`  // 频道列表
}

type ChargeBpResult

type ChargeBpResult struct {
	MID     int64  `json:"mid"`      // 本用户mid
	UpMID   int64  `json:"up_mid"`   // 目标用户mid
	OrderNo string `json:"order_no"` // 订单号 用于添加充电留言
	BpNum   string `json:"bp_num"`   // 充电B币数?(不知道按B币算还是换算成贝壳) 不知为何返回类型为string
	Exp     int    `json:"exp"`      // 获得经验数
	// 返回结果
	//
	// 4:成功
	//
	// -2:低于充电下限
	//
	// -4:B币不足
	Status int    `json:"status"`
	Msg    string `json:"msg"` // 错误信息 默认为空
}

type ChargeCreateQrCode

type ChargeCreateQrCode struct {
	QrCodeURL string `json:"qr_code_url"` // 支付二维码生成内容 存在转义
	QrToken   string `json:"qr_token"`    // 扫码秘钥
	Exp       int    `json:"exp"`         // 获得经验数
}

type ChargeItem

type ChargeItem struct {
	MID        int64          `json:"mid"`         // 充电对象mid
	PayMID     int64          `json:"pay_mid"`     // 充电用户mid
	Rank       int            `json:"rank"`        // 充电用户排名 取决于充电的多少
	Uname      string         `json:"uname"`       // 充电用户昵称
	Avatar     string         `json:"avatar"`      // 充电用户头像url
	Message    string         `json:"message"`     // 充电留言 无为空
	MsgDeleted int            `json:"msg_deleted"` // 0 作用尚不明确
	VipInfo    *ChargeItemVip `json:"vip_info"`    // 充电用户会员信息
	TrendType  int            `json:"trend_type"`  // 0 作用尚不明确
}

type ChargeItemVip

type ChargeItemVip struct {
	// 大会员类型
	//
	// 0:无
	//
	// 1:月会员
	//
	// 2:年会员
	VipType    int `json:"vipType"`
	VipDueMsec int `json:"vipDueMsec"` // 0 作用尚不明确
	VipStatus  int `json:"vipStatus"`  // 大会员状态 0:无 1:有
}

type ChargeQrCodeStatus

type ChargeQrCodeStatus struct {
	QrToken string `json:"qr_token"` // 扫码秘钥
	OrderNo string `json:"order_no"` // 留言token 未成功则无此项 用于添加充电留言
	MID     int64  `json:"mid"`      // 当前用户mid
	// 状态值 若秘钥错误则无此项
	//
	// 1:已支付
	//
	// 2:未扫描
	//
	// 3:未确认
	Status int `json:"status"`
}

type ChargeSpaceList

type ChargeSpaceList struct {
	DisplayNum int           `json:"display_num"` // 0 作用尚不明确
	Count      int           `json:"count"`       // 本月充电人数
	TotalCount int           `json:"total_count"` // 总计充电人数
	List       []*ChargeItem `json:"list"`        // 本月充电用户列表
}

type ChargeVideoList

type ChargeVideoList struct {
	ShowInfo   *ChargeVideoShow `json:"show_info"`   // 展示选项
	AvCount    int              `json:"av_count"`    // 目标视频充电人数
	Count      int              `json:"count"`       // 本月充电人数
	TotalCount int              `json:"total_count"` // 总计充电人数
	SpecialDay int              `json:"special_day"` // 0 作用尚不明确
	DisplayNum int              `json:"display_num"` // 0 作用尚不明确
	List       []*ChargeItem    `json:"list"`        // 本月充电用户列表
}

type ChargeVideoShow

type ChargeVideoShow struct {
	Show  bool `json:"show"`  // 是否展示视频充电鸣谢名单 false:不展示 true:展示
	State int  `json:"state"` // 0
}

type CoinLog

type CoinLog struct {
	Time   string  `json:"time"`   // 变化时间 YYYY-MM-DD HH:MM:SS
	Delta  float64 `json:"delta"`  // 变化量 正值为收入,负值为支出
	Reason string  `json:"reason"` // 变化说明
}

type CommClient

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

func NewCommClient

func NewCommClient(setting *CommSetting) *CommClient

NewCommClient

Setting的Auth属性可以随意填写或传入nil,Auth不起到作用,用于访问公共API

func (*CommClient) AudioGetInfo

func (c *CommClient) AudioGetInfo(auid int64) (*AudioInfo, error)

AudioGetInfo

获取音频信息 部分属性需要登录,请使用 BiliClient 请求

func (*CommClient) AudioGetLyric

func (c *CommClient) AudioGetLyric(auid int64) (string, error)

AudioGetLyric 获取音频歌词

同 AudioGetInfo 中的lrc歌词

func (*CommClient) AudioGetMembers

func (c *CommClient) AudioGetMembers(auid int64) ([]*AudioMember, error)

AudioGetMembers

获取音频创作者信息

func (*CommClient) AudioGetPlayURL

func (c *CommClient) AudioGetPlayURL(auid int64, qn int) (*AudioPlayURL, error)

AudioGetPlayURL 获取音频流URL

最多获取到

qn 音质

0 流畅 128K

1 标准 192K

2 高品质 320K

3 无损 FLAC(大会员)

最高获取到 320K 音质,更高音质请使用 BiliClient 请求

取流:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/audio/musicstream_url.md#%E9%9F%B3%E9%A2%91%E6%B5%81%E7%9A%84%E8%8E%B7%E5%8F%96

func (*CommClient) AudioGetStat

func (c *CommClient) AudioGetStat(auid int64) (*AudioInfoStat, error)

AudioGetStat 获取歌曲状态数

没有投币数 获取投币数请使用 AudioGetInfo

func (*CommClient) AudioGetTags

func (c *CommClient) AudioGetTags(auid int64) ([]*AudioTag, error)

AudioGetTags 获取音频TAGs

根据页面显示观察,应该是歌曲分类

func (*CommClient) ChanGet

func (c *CommClient) ChanGet(mid int64) (*ChannelList, error)

ChanGet

获取用户频道列表

func (*CommClient) ChanGetVideo

func (c *CommClient) ChanGetVideo(mid int64, cid int64, pn int, ps int) (*ChanVideo, error)

ChanGetVideo

获取用户频道视频

cid 频道ID

pn 页码

ps 每页项数

func (*CommClient) ChargeSpaceGetList

func (c *CommClient) ChargeSpaceGetList(mid int64) (*ChargeSpaceList, error)

ChargeSpaceGetList

获取用户空间充电名单

func (*CommClient) ChargeVideoGetList

func (c *CommClient) ChargeVideoGetList(mid int64, aid int64) (*ChargeVideoList, error)

ChargeVideoGetList

获取用户视频充电名单

func (*CommClient) DanmakuGetByPb

func (c *CommClient) DanmakuGetByPb(tp int, cid int64, seg int) (*DanmakuResp, error)

DanmakuGetByPb

获取实时弹幕(protobuf接口)

func (*CommClient) DanmakuGetLikes

func (c *CommClient) DanmakuGetLikes(cid int64, dmids []uint64) (map[uint64]*DanmakuGetLikesResult, error)

DanmakuGetLikes 获取弹幕点赞数,一次可以获取多条弹幕

Link:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E6%9F%A5%E8%AF%A2%E5%BC%B9%E5%B9%95%E7%82%B9%E8%B5%9E%E6%95%B0

返回一个map,key为dmid,value为相关信息 未登录时UserLike属性恒为0

func (*CommClient) DanmakuGetShot

func (c *CommClient) DanmakuGetShot(aid int64) ([]string, error)

DanmakuGetShot

获取弹幕快照(最新的几条弹幕)

func (*CommClient) EmoteGetFreePack

func (c *CommClient) EmoteGetFreePack(business string) ([]*EmotePack, error)

EmoteGetFreePack 获取免费表情包列表

business 使用场景 reply:评论区 dynamic:动态

全为免费表情包,如需获取个人专属表情包请使用 BiliClient 请求

func (*CommClient) EmoteGetPackDetail

func (c *CommClient) EmoteGetPackDetail(business string, ids []int64) ([]*EmotePack, error)

EmoteGetPackDetail 获取指定表情包明细

business 使用场景 reply:评论区 dynamic:动态

ids 多个表情包id的数组

func (*CommClient) FavGet

func (c *CommClient) FavGet(mid int64) (*FavoritesList, error)

FavGet

获取用户的公开收藏夹列表

func (*CommClient) FavGetDetail

func (c *CommClient) FavGetDetail(mlid int64) (*FavDetail, error)

FavGetDetail

获取收藏夹详细信息,部分信息需要登录,请使用 BiliClient 请求

func (*CommClient) FavGetRes

func (c *CommClient) FavGetRes(mlid int64) ([]*FavRes, error)

FavGetRes

获取收藏夹全部内容id 查询权限收藏夹时请使用 BiliClient 请求

func (*CommClient) FavGetResDetail

func (c *CommClient) FavGetResDetail(mlid int64, tid int, keyword string, order string, tp int, pn int, ps int) (*FavResDetail, error)

FavGetResDetail 获取收藏夹内容详细内容,带过滤功能

查询权限收藏夹时请使用 BiliClient 请求

tid 分区id,用于筛选,传入0代表所有分区

keyword 关键词筛选 可留空

order 留空默认按收藏时间

按收藏时间:mtime 按播放量: view 按投稿时间:pubtime

tp 内容类型 不知道作用,传入0即可

pn 页码

ps 每页项数 ps不能太大,会报错

func (*CommClient) GetDailyNum

func (c *CommClient) GetDailyNum() (map[int]int, error)

GetDailyNum

获取每日分区投稿数

func (*CommClient) GetGeoInfo

func (c *CommClient) GetGeoInfo() (*GeoInfo, error)

GetGeoInfo 调用哔哩哔哩API获取地理位置等信息

会受到自定义 http.Client 代理的影响

func (*CommClient) GetRelationStat

func (c *CommClient) GetRelationStat(mid int64) (*RelationStat, error)

GetRelationStat

获取关系状态数,Whisper和Black恒为0

func (*CommClient) GetUnixNow

func (c *CommClient) GetUnixNow() (int64, error)

GetUnixNow

获取服务器的Unix时间戳

func (*CommClient) LiveGetRoomInfo

func (c *CommClient) LiveGetRoomInfo(mid int64) (*LiveRoomInfo, error)

LiveGetRoomInfo

获取直播间信息

func (*CommClient) Raw

func (c *CommClient) Raw(base, endpoint, method string, payload map[string]string) ([]byte, error)

func (*CommClient) RawParse

func (c *CommClient) RawParse(base, endpoint, method string, payload map[string]string) (*Response, error)

func (*CommClient) SetClient

func (c *CommClient) SetClient(client *http.Client)

SetClient

设置Client,可以用来更换代理等操作

func (*CommClient) SetUA

func (c *CommClient) SetUA(ua string)

SetUA

设置UA

func (*CommClient) SpaceGetLastPlayGame

func (c *CommClient) SpaceGetLastPlayGame(mid int64) ([]*SpaceGame, error)

SpaceGetLastPlayGame

获取用户空间近期玩的游戏

func (*CommClient) SpaceGetLastVideoCoin

func (c *CommClient) SpaceGetLastVideoCoin(mid int64) ([]*SpaceVideoCoin, error)

SpaceGetLastVideoCoin

获取用户最近投币的视频明细 如设置隐私查看自己的使用 BiliClient 访问

func (*CommClient) SpaceGetMasterpieces

func (c *CommClient) SpaceGetMasterpieces(mid int64) ([]*SpaceVideo, error)

SpaceGetMasterpieces

获取UP代表作

func (*CommClient) SpaceGetNotice

func (c *CommClient) SpaceGetNotice(mid int64) (string, error)

SpaceGetNotice

获取空间公告内容

func (*CommClient) SpaceGetTags

func (c *CommClient) SpaceGetTags(mid int64) ([]string, error)

SpaceGetTags

获取空间用户个人TAG 上限5条,且内容由用户自定义 带有转义

func (*CommClient) SpaceGetTopArchive

func (c *CommClient) SpaceGetTopArchive(mid int64) (*SpaceVideo, error)

SpaceGetTopArchive

获取空间置顶稿件

func (*CommClient) SpaceSearchVideo

func (c *CommClient) SpaceSearchVideo(mid int64, order string, tid int, keyword string, pn int, ps int) (*SpaceVideoSearchResult, error)

SpaceSearchVideo

获取用户投稿视频明细

order 排序方式 默认为pubdate 可留空

最新发布:pubdate 最多播放:click 最多收藏:stow

tid 筛选分区 0:不进行分区筛选

keyword 关键词 可留空

pn 页码

ps 每页项数

func (*CommClient) VideoGetDescription

func (c *CommClient) VideoGetDescription(aid int64) (string, error)

VideoGetDescription

获取稿件简介

func (*CommClient) VideoGetInfo

func (c *CommClient) VideoGetInfo(aid int64) (*VideoInfo, error)

VideoGetInfo 返回视频详细信息,数据较多,可以使用单独的接口获取部分数据

限制游客访问的视频会返回错误,请使用 BiliClient 发起请求

func (*CommClient) VideoGetOnlineNum

func (c *CommClient) VideoGetOnlineNum(aid int64, cid int64) (total string, web string, e error)

VideoGetOnlineNum

返回所有终端总计在线观看人数和WEB端在线观看人数 (用类似10万+的文字表示) cid用于分P标识

func (*CommClient) VideoGetPageList

func (c *CommClient) VideoGetPageList(aid int64) ([]*VideoPage, error)

VideoGetPageList

获取分P列表

func (*CommClient) VideoGetPlayURL

func (c *CommClient) VideoGetPlayURL(aid int64, cid int64, qn int, fnval int) (*VideoPlayURLResult, error)

VideoGetPlayURL 获取视频取流地址

所有参数、返回信息和取流方法的说明请直接前往:https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/video/videostream_url.md

func (*CommClient) VideoGetRecommend

func (c *CommClient) VideoGetRecommend(aid int64) ([]*VideoRecommendInfo, error)

VideoGetRecommend 获取视频的相关视频推荐

最多获取40条推荐视频

func (*CommClient) VideoGetStat

func (c *CommClient) VideoGetStat(aid int64) (*VideoSingleStat, error)

VideoGetStat

获取稿件状态数

func (*CommClient) VideoShot

func (c *CommClient) VideoShot(aid int64, cid int64, index bool) (*VideoShot, error)

VideoShot 获取视频快照

cid属性非必须 传入0表示1P

index为JSON数组截取时间表 true:需要 false:不需要 传入false则Index属性为空

func (*CommClient) VideoTags

func (c *CommClient) VideoTags(aid int64) ([]*VideoTag, error)

VideoTags

未登录无法获取 IsAtten,Liked,Hated 字段

type CommSetting

type CommSetting struct {

	// 自定义http client
	//
	// 默认为 http.http.DefaultClient
	Client *http.Client

	// Debug模式 true将输出请求信息 false不输出
	//
	// 默认false
	DebugMode bool

	// 自定义UserAgent
	//
	// 默认Chrome随机Agent
	UserAgent string
}

type CookieAuth

type CookieAuth struct {
	DedeUserID      string // DedeUserID
	DedeUserIDCkMd5 string // DedeUserID__ckMd5
	SESSDATA        string // SESSDATA
	BiliJCT         string // bili_jct
}

type Danmaku

type Danmaku struct {
	ID       uint64 `json:"id"`       // 弹幕dmid
	Progress int64  `json:"progress"` // 弹幕出现位置(单位ms)
	// 弹幕类型
	//
	// 1 2 3:普通弹幕
	//
	// 4:底部弹幕
	//
	// 5:顶部弹幕
	//
	// 6:逆向弹幕
	//
	// 7:高级弹幕
	//
	// 8:代码弹幕
	//
	// 9:BAS弹幕(仅限于特殊弹幕专包)
	Mode     int    `json:"mode"`
	FontSize int    `json:"font_size"` // 弹幕字号 18:小 25:标准 36:大
	Color    int    `json:"color"`     // 弹幕颜色 十进制RGB888值
	MidHash  string `json:"mid_hash"`  // 发送着mid hash 用于屏蔽用户和查看用户发送的所有弹幕 也可反查用户id
	Content  string `json:"content"`   // 弹幕正文 utf-8编码
	Ctime    int64  `json:"ctime"`     // 发送时间 时间戳
	Weight   int    `json:"weight"`    // 权重 区间:[1,10] 用于智能屏蔽,根据弹幕语义及长度通过AI识别得出 值越大权重越高
	Action   string `json:"action"`    // 动作 作用尚不明确
	Pool     int    `json:"pool"`      // 弹幕池 0:普通池 1:字幕池 2:特殊池(代码/BAS弹幕)
	IDStr    string `json:"id_str"`    // 弹幕dmid的字符串形式
	Attr     int    `json:"attr"`      // 弹幕属性位(bin求AND) bit0:保护 bit1:直播 bit2:高赞
}

type DanmakuCommandPostResult

type DanmakuCommandPostResult struct {
	// 指令
	//
	// UP主头像弹幕:#UP#
	//
	// 关联视频弹幕:#LINK#
	//
	// 视频内嵌引导关注按钮:#ATTENTION#
	Command  string          `json:"command"`
	Content  string          `json:"content"`  // 弹幕内容
	Extra    json.RawMessage `json:"extra"`    // JSON序列,具体请参考 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/danmaku/action.md#%E5%8F%91%E9%80%81%E4%BA%92%E5%8A%A8%E5%BC%B9%E5%B9%95
	ID       uint64          `json:"id"`       // 弹幕dmid
	IDStr    string          `json:"idStr"`    // 弹幕dmid的字符串形式
	MID      int64           `json:"mid"`      // 用户mid
	OID      int64           `json:"oid"`      // 视频cid
	Progress int64           `json:"progress"` // 弹幕出现在视频内的时间
	// 互动弹幕类型
	//
	// 1:UP主头像弹幕
	//
	// 2:关联视频弹幕
	//
	// 5:视频内嵌引导关注按钮
	Type int `json:"type"`
}

type DanmakuConfig

type DanmakuConfig struct {
	DmSwitch     bool    `json:"dm_switch"`    // 弹幕开关
	BlockScroll  bool    `json:"blockscroll"`  // 屏蔽类型-滚动
	BlockTop     bool    `json:"blocktop"`     // 屏蔽类型-顶部
	BlockBottom  bool    `json:"blockbottom"`  // 屏蔽类型-底部
	BlockColor   bool    `json:"blockcolor"`   // 屏蔽类型-彩色
	BlockSpecial bool    `json:"blockspecial"` // 屏蔽类型-特殊
	AISwitch     bool    `json:"ai_switch"`    // 是否打开智能云屏蔽
	AILevel      int     `json:"ai_level"`     // 智能云屏蔽等级
	PreventShade bool    `json:"preventshade"` // 防挡弹幕(底部15%)
	DmMask       bool    `json:"dmask"`        // 智能防挡弹幕(人像蒙版)
	Opacity      float64 `json:"opacity"`      // 弹幕不透明度 区间:[0-1]
	// 弹幕显示区域
	//
	// 100:不重叠
	//
	// 75:3/4屏
	//
	// 50:半瓶
	//
	// 25:1/4屏
	//
	// 0:不限
	DmArea     int     `json:"dmarea"`
	SpeedPlus  float64 `json:"speedplus"`  // 弹幕速度 区间:[0.4-1.6]
	FontSize   float64 `json:"fontsize"`   // 字体大小 区间:[0.4-1.6]
	ScreenSync bool    `json:"screensync"` // 跟随屏幕缩放比例
	SpeedSync  bool    `json:"speedsync"`  // 根据播放倍速调整速度
	FontFamily string  `json:"fontfamily"` // 字体类型 未启用
	Bold       bool    `json:"bold"`       // 粗体 未启用
	FontBorder int     `json:"fontborder"` // 描边类型 0:重墨 1:描边 2:45°投影
	DrawType   string  `json:"drawType"`   // 渲染类型 未启用
}

DanmakuConfig 未启用的就传入空

type DanmakuGetLikesResult

type DanmakuGetLikesResult struct {
	Likes int `json:"likes"` // 点赞数
	// 当前账户是否点赞
	//
	// 0:未点赞
	// 1:已点赞
	//
	// 需要登录(Cookie或APP)
	// 未登录恒为0
	UserLike int    `json:"user_like"`
	IDStr    string `json:"id_str"` // 弹幕dmid的字符串形式
}

type DanmakuPostResult

type DanmakuPostResult struct {
	Action  string `json:"action"`   // 空 作用尚不明确
	Dmid    uint64 `json:"dmid"`     // 弹幕dmid
	DmidStr string `json:"dmid_str"` // 弹幕dmid的字符串形式
	Visible bool   `json:"visible"`  // 作用尚不明确
}

type DanmakuResp

type DanmakuResp struct {
	Danmaku []*Danmaku `json:"danmaku"`
}

type Emote

type Emote struct {
	ID        int64  `json:"id"`         // 表情id
	PackageID int64  `json:"package_id"` // 表情包id
	Text      string `json:"text"`       // 表情转义符	颜文字时为该字串
	URL       string `json:"url"`        // 表情图片url	颜文字时为该字串
	Mtime     int64  `json:"mtime"`      // 创建时间	时间戳
	// 表情类型
	//
	// 1:普通
	//
	// 2:会员专属
	//
	// 3:购买所得
	//
	// 4:颜文字
	Type  int        `json:"type"`
	Attr  int        `json:"attr"`  // 作用尚不明确
	Meta  *EmoteMeta `json:"meta"`  // 属性信息
	Flags *EmoteFlag `json:"flags"` // 禁用标志
}

type EmoteFlag

type EmoteFlag struct {
	Unlocked bool `json:"unlocked"` // true:启用 需要登录 否则恒为false
}

type EmoteMeta

type EmoteMeta struct {
	Size    int      `json:"size"`    // 表情尺寸信息 1:小 2:大
	Alias   string   `json:"alias"`   // 简写名 无则无此项
	Suggest []string `json:"suggest"` // 文字对应的表情推荐
}

type EmotePack

type EmotePack struct {
	ID    int64  `json:"id"`    // 表情包id
	Text  string `json:"text"`  // 表情包名称
	URL   string `json:"url"`   // 表情包标志图片url
	Mtime int64  `json:"mtime"` // 创建时间 时间戳
	// 表情包类型
	//
	// 1:普通
	//
	// 2:会员专属
	//
	// 3:购买所得
	//
	// 4:颜文字
	Type  int            `json:"type"`
	Attr  int            `json:"attr"`  // 作用尚不明确
	Meta  *EmotePackMeta `json:"meta"`  // 属性信息
	Emote []*Emote       `json:"emote"` // 表情列表
	Flags *EmotePackFlag `json:"flags"` // 是否添加标志
}

type EmotePackFlag

type EmotePackFlag struct {
	// 是否已添加
	//
	// true:已添加
	//
	// false:未添加
	//
	// 需要登录(SESSDATA)
	// 否则恒为false
	Added bool `json:"added"`
}

type EmotePackMeta

type EmotePackMeta struct {
	Size    int    `json:"size"`     // 表情尺寸信息	1:小 2:大
	ItemID  int64  `json:"item_id"`  // 购买物品id
	ItemURL string `json:"item_url"` // 购买物品页面url 无则无此项
}

type ExpRewardStat

type ExpRewardStat struct {
	Login        bool `json:"login"`         // 每日登录 5经验
	Watch        bool `json:"watch"`         // 每日观看 5经验
	Coins        int  `json:"coins"`         // 每日投币所奖励的经验 上限50经验 该值更新存在延迟 想要无延迟请使用 GetExpCoinRewardStat
	Share        bool `json:"share"`         // 每日分享 5经验
	Email        bool `json:"email"`         // 绑定邮箱
	Tel          bool `json:"tel"`           // 绑定手机号 首次完成100经验
	SafeQuestion bool `json:"safe_question"` // 设置密保问题
	IdentifyCard bool `json:"identify_card"` // 实名认证 50经验
}

ExpRewardStat 完成为true 未完成为false

type FavDetail

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

type FavDetailCnt

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

type FavDetailUpper

type FavDetailUpper struct {
	MID      int64  `json:"mid"`      // 创建者mid
	Name     string `json:"name"`     // 创建者昵称
	Face     string `json:"face"`     // 创建者头像url
	Followed bool   `json:"followed"` // 是否已关注创建者 需登录
	// 会员类别
	//
	// 0:无
	//
	// 1:月大会员
	//
	// 2:年度及以上大会员
	VipType int `json:"vip_type"`
	// 会员开通状态(B站程序员有点粗心,打成statue了)
	//
	// 0:无
	//
	// 1:有
	VipStatue int `json:"vip_statue"`
}

type FavInfo

type FavInfo struct {
	ID         int64  `json:"id"`          // 收藏夹mlid
	FID        int64  `json:"fid"`         // 原始收藏夹mlid 去除lmid最后两位
	MID        int64  `json:"mid"`         // 创建用户mid
	Attr       int    `json:"attr"`        // 收藏夹属性位配置
	Title      string `json:"title"`       // 收藏夹标题
	FavState   int    `json:"fav_state"`   // 0 作用尚不明确
	MediaCount int    `json:"media_count"` // 收藏夹总计视频数
}

type FavRes

type FavRes struct {
	// 内容id
	//
	// 视频稿件:视频稿件avid
	//
	// 音频:音频auid
	//
	// 视频合集:视频合集id
	ID int64 `json:"id"`
	// 内容类型
	// 2:视频稿件
	//
	// 12:音频
	//
	// 21:视频合集
	Type int `json:"type"`
}

FavRes 收藏夹内容id

type FavResDetail

type FavResDetail struct {
	Info   *FavDetail           `json:"info"`   // 收藏夹元数据
	Medias []*FavResDetailMedia `json:"medias"` // 收藏夹内容
}

type FavResDetailMedia

type FavResDetailMedia struct {
	// 内容id
	//
	// 视频稿件:视频稿件avid
	//
	// 音频:音频auid
	//
	// 视频合集:视频合集id
	ID int64 `json:"id"`
	// 内容类型
	//
	// 2:视频稿件
	//
	// 12:音频
	//
	// 21:视频合集
	Type     int                   `json:"type"`
	Title    string                `json:"title"`    // 标题
	Cover    string                `json:"cover"`    // 封面url
	Intro    string                `json:"intro"`    // 简介
	Page     int                   `json:"page"`     // 视频分P数
	Duration int64                 `json:"duration"` // 音频/视频时长
	Upper    *VideoOwner           `json:"upper"`    // UP主信息
	Attr     int                   `json:"attr"`     // 属性位
	CntInfo  *FavResDetailMediaCnt `json:"cnt_info"` // 状态数
	Link     string                `json:"link"`     // 跳转uri
	Ctime    int64                 `json:"ctime"`    // 投稿时间 时间戳
	Pubtime  int64                 `json:"pubtime"`  // 发布时间	时间戳
	FavTime  int64                 `json:"fav_time"` // 收藏时间 时间戳
	BVID     string                `json:"bvid"`     // 视频稿件bvid
}

type FavResDetailMediaCnt

type FavResDetailMediaCnt struct {
	Collect int   `json:"collect"` // 收藏数
	Play    int64 `json:"play"`    // 播放数
	Danmaku int   `json:"danmaku"` // 弹幕数
}

type FavoritesList

type FavoritesList struct {
	Count int        `json:"count"` // 创建的收藏夹数
	List  []*FavInfo `json:"list"`  // 收藏夹列表
}

type GeoInfo

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

type LiveRoomInfo

type LiveRoomInfo struct {
	RoomStatus    int    `json:"roomStatus"`     // 直播间状态 0:无房间 1:有房间
	RoundStatus   int    `json:"roundStatus"`    // 轮播状态 0:未轮播 1:轮播
	LiveStatus    int    `json:"liveStatus"`     // 直播状态 0:未开播 1:直播中
	URL           string `json:"url"`            // 直播间网页url
	Title         string `json:"title"`          // 直播间标题
	Cover         string `json:"cover"`          // 直播间封面url
	Online        int    `json:"online"`         // 直播间人气 值为上次直播时刷新
	RoomID        int    `json:"roomid"`         // 直播间id(短号)
	BroadcastType int    `json:"broadcast_type"` // 0
	OnlineHidden  int    `json:"online_hidden"`  // 0
}

type MsgUnRead

type MsgUnRead 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 NavInfo struct {
	EmailVerified      int                    `json:"email_verified"`       // 是否验证邮箱地址 0:未验证 1:已验证
	Face               string                 `json:"face"`                 // 用户头像url
	LevelInfo          *NavInfoLevel          `json:"level_info"`           // 等级信息
	MID                int64                  `json:"mid"`                  // 用户mid
	MobileVerified     int                    `json:"mobile_verified"`      // 是否验证手机号 0:未验证 1:已验证
	Money              float64                `json:"money"`                // 拥有硬币数
	Moral              int                    `json:"moral"`                // 当前节操值 上限为70
	Official           *NavInfoOfficial       `json:"official"`             // 认证信息
	OfficialVerify     *NavInfoOfficialVerify `json:"officialVerify"`       // 认证信息2
	Pendant            *NavInfoPendant        `json:"pendant"`              // 头像框信息
	Scores             int                    `json:"scores"`               // 0 作用尚不明确
	Uname              string                 `json:"uname"`                // 用户昵称
	VipDueDate         int64                  `json:"vipDueDate"`           // 会员到期时间 毫秒 时间戳(东八区)
	VipStatus          int                    `json:"vipStatus"`            // 会员开通状态 0:无 1:有
	VipType            int                    `json:"vipType"`              // 会员类型 0:无 1:月度大会员 2:年度及以上大会员
	VipPayType         int                    `json:"vip_pay_type"`         // 会员开通状态	0:无 1:有
	VipThemeType       int                    `json:"vip_theme_type"`       // 0 作用尚不明确
	VipLabel           *NavInfoVipLabel       `json:"vip_label"`            // 会员标签
	VipAvatarSubscript int                    `json:"vip_avatar_subscript"` // 是否显示会员图标 0:不显示 1:显示
	VipNicknameColor   string                 `json:"vip_nickname_color"`   // 会员昵称颜色	颜色码 如#FFFFFF
	Wallet             *NavInfoWallet         `json:"wallet"`               // B币钱包信息
	HasShop            bool                   `json:"has_shop"`             // 是否拥有推广商品 false:无 true:有
	ShopURL            string                 `json:"shop_url"`             // 商品推广页面url
	AllowanceCount     int                    `json:"allowance_count"`      // 0 作用尚不明确
	AnswerStatus       int                    `json:"answer_status"`        // 0 作用尚不明确
}
type NavInfoLevel struct {
	CurrentLevel int `json:"current_level"` // 当前等级
	CurrentMin   int `json:"current_min"`   // 当前等级经验最低值
	CurrentExp   int `json:"current_exp"`   // 当前经验
	NextExp      int `json:"next_exp"`      // 升级下一等级需达到的经验
}
type NavInfoOfficial struct {
	// 认证类型
	//
	// 0:无
	//
	// 1 2 7:个人认证
	//
	// 3 4 5 6:机构认证
	Role  int    `json:"role"`
	Title string `json:"title"` // 认证信息 无为空
	Desc  string `json:"desc"`  // 认证备注 无为空
	Type  int    `json:"type"`  // 是否认证 -1:无 0:认证
}
type NavInfoOfficialVerify struct {
	Type int    `json:"type"` // 是否认证 -1:无 0:认证
	Desc string `json:"desc"` // 认证信息 无为空
}
type NavInfoPendant struct {
	PID    int64  // 挂件id
	Name   string // 挂件名称
	Image  string // 挂件图片url
	Expire int    // 0 作用尚不明确
}
type NavInfoVipLabel struct {
	Path string `json:"path"` // 空 作用尚不明确
	Text string `json:"text"` // 会员名称
	// 会员标签
	//
	// vip:大会员
	//
	// annual_vip:年度大会员
	//
	// ten_annual_vip:十年大会员
	//
	// hundred_annual_vip:百年大会员
	LabelTheme string `json:"label_theme"`
}
type NavInfoWallet struct {
	MID           int64   `json:"mid"`             // 登录用户mid
	BcoinBalance  float64 `json:"bcoin_balance"`   // 拥有B币数
	CouponBalance float64 `json:"coupon_balance"`  // 每月奖励B币数
	CouponDueTime int     `json:"coupon_due_time"` // 0 作用尚不明确
}
type NavStat struct {
	Following    int `json:"following"`     // 关注数
	Follower     int `json:"follower"`      // 粉丝数
	DynamicCount int `json:"dynamic_count"` // 发布动态数
}

type RealNameInfo

type RealNameInfo struct {
	Status   int    `json:"status"`   // 认证状态 1:已认证 3:未认证
	Remark   string `json:"remark"`   // 驳回信息 默认为空
	Realname string `json:"realname"` // 实名姓名 星号隐藏完全信息
	Card     string `json:"card"`     // 证件号码 星号隐藏部分信息
	// 证件类型代码
	//
	// 0:身份证
	//
	// 2:港澳居民来往内地通行证
	//
	// 3:台湾居民来往大陆通行证
	//
	// 4:护照(中国签发)
	//
	// 5:外国人永久居留证
	//
	// 6:其他国家或地区身份证明
	CardType int `json:"card_type"`
}

type RelationStat

type RelationStat struct {
	MID       int64 `json:"mid"`       // 目标用户mid
	Following int   `json:"following"` // 关注数
	Whisper   int   `json:"whisper"`   // 悄悄关注数 需要登录(Cookie或APP) 未登录或非自己恒为0
	Black     int   `json:"black"`     // 黑名单数 需要登录(Cookie或APP) 未登录或非自己恒为0
	Follower  int   `json:"follower"`  // 粉丝数
}

type Response

type Response struct {
	Code    int             `json:"code,omitempty"`
	Message string          `json:"message,omitempty"`
	TTL     int             `json:"ttl,omitempty"`
	Data    json.RawMessage `json:"data,omitempty"`
}

type SearchAll

type SearchAll struct {
	SEID           string
	Page           int
	PageSize       int
	NumResults     int
	NumPages       int
	SuggestKeyword string
	RqtType        string
	CostTime       *SearchCostTime
	// ExpList 作用尚不明确
	EggHit         int
	PageInfo       *SearchPage
	TopTlist       *SearchTopTlist
	ShowColumn     int
	ShowModuleList []string
	Result         *SearchResult
}

type SearchCostTime

type SearchCostTime struct {
	ParamsCheck         string `json:"params_check"`
	IllegalHandler      string `json:"illegal_handler"`
	AsResponseFormat    string `json:"as_response_format"`
	AsRequest           string `json:"as_request"`
	SaveCache           string `json:"save_cache"`
	DeserializeResponse string `json:"deserialize_response"`
	AsRequestFormat     string `json:"as_request_format"`
	Total               string `json:"total"`
	MainHandler         string `json:"main_handler"`
}

type SearchPage

type SearchPage struct {
	PGC           *SearchPageInfo `json:"pgc"`            //
	LiveRoom      *SearchPageInfo `json:"live_room"`      // 直播数
	Photo         *SearchPageInfo `json:"photo"`          // 相簿数
	Topic         *SearchPageInfo `json:"topic"`          // 话题数
	Video         *SearchPageInfo `json:"video"`          // 视频数
	User          *SearchPageInfo `json:"user"`           //
	BiliUser      *SearchPageInfo `json:"bili_user"`      // 用户数
	MediaFT       *SearchPageInfo `json:"media_ft"`       // 电影数
	Article       *SearchPageInfo `json:"article"`        // 专栏数
	MediaBangumi  *SearchPageInfo `json:"media_bangumi"`  // 番剧数
	Special       *SearchPageInfo `json:"special"`        //
	OperationCard *SearchPageInfo `json:"operation_card"` //
	UpUser        *SearchPageInfo `json:"upuser"`         //
	Movie         *SearchPageInfo `json:"movie"`          //
	LiveAll       *SearchPageInfo `json:"live_all"`       //
	TV            *SearchPageInfo `json:"tv"`             //
	Live          *SearchPageInfo `json:"live"`           // 直播间数
	Bangumi       *SearchPageInfo `json:"bangumi"`        //
	Activity      *SearchPageInfo `json:"activity"`       // 活动数
	LiveMaster    *SearchPageInfo `json:"live_master"`    //
	LiveUser      *SearchPageInfo `json:"live_user"`      // 主播数
}

type SearchPageInfo

type SearchPageInfo struct {
	NumResults int `json:"numResults"` // 总计数量
	Total      int `json:"total"`      // 总计数量
	Pages      int `json:"pages"`      // 分页数量
}

type SearchResult

type SearchResult struct {
	ResultType string
	Video      []*SearchResultVideo
	Media      []*SearchResultMedia
}

SearchResult 在原搜索接口进行魔改,方便使用

type SearchResultEp

type SearchResultEp struct {
	ID          int64                `json:"id"`           // 分集epid
	Cover       string               `json:"cover"`        // 分集封面url
	Title       string               `json:"title"`        // 完整标题
	URL         string               `json:"url"`          // 分集重定向url
	ReleaseDate string               `json:"release_date"` // 空
	Badges      *SearchResultEpBadge `json:"badges"`       // 分集标志
	IndexTitle  string               `json:"index_title"`  // 短标题
	LongTitle   string               `json:"long_title"`   // 单集标题
}

type SearchResultEpBadge

type SearchResultEpBadge struct {
	Text             string `json:"text"`               // 剧集标志	颜色码 例如:#BB5B76
	TextColor        string `json:"text_color"`         // 文字颜色	颜色码 例如:#BB5B76
	TextColorNight   string `json:"text_color_night"`   // 夜间文字颜色	颜色码 例如:#BB5B76
	BgColor          string `json:"bg_color"`           // 背景颜色	颜色码 例如:#BB5B76
	BgColorNight     string `json:"bg_color_night"`     // 夜间背景颜色	颜色码 例如:#BB5B76
	BorderColor      string `json:"border_color"`       // 空
	BorderColorNight string `json:"border_color_night"` // 空
	BgStyle          int    `json:"bg_style"`           // 恒为1
}

type SearchResultMedia

type SearchResultMedia struct {
	Type           string                          `json:"type"`             // 结果类型 (media_bangumi:番剧 media_ft:影视)
	MediaID        int64                           `json:"media_id"`         // 剧集mdid
	SeasonID       int64                           `json:"season_id"`        // 剧集ssid
	Title          string                          `json:"title"`            // 剧集标题 关键字用xml标签<em class="keyword">标注
	OrgTitle       string                          `json:"org_title"`        // 剧集原名 关键字用xml标签<em class="keyword">标注 可为空
	Cover          string                          `json:"cover"`            // 剧集封面url
	MediaType      int                             `json:"media_type"`       // 剧集类型 (1:番剧 2:电影 3:纪录片 4:国创 5:电视剧 7:综艺)
	Areas          string                          `json:"areas"`            // 地区
	Styles         string                          `json:"styles"`           // 风格
	CV             string                          `json:"cv"`               // 声优
	Staff          string                          `json:"staff"`            // 制作组
	PlayState      int                             `json:"play_state"`       // 恒为0 作用尚不明确
	GotoURL        string                          `json:"goto_url"`         // 剧集重定向url
	Desc           string                          `json:"desc"`             // 简介
	Corner         int                             `json:"corner"`           // 角标有无 2:无 13:有
	PubTime        int64                           `json:"pub_time"`         // 开播时间 时间戳(东八区)
	MediaMode      int                             `json:"media_mode"`       // 恒为2 作用尚不明确
	IsAvid         bool                            `json:"is_avid"`          // 恒为false 作用尚不明确
	FixPubTimeStr  string                          `json:"fix_pub_time_str"` // 开播时间重写信息 优先级高于pubtime 可为空
	MediaScore     *SearchResultMediaScore         `json:"media_score"`      // 评分信息	有效时:obj 无效时:null
	HitColumns     []string                        `json:"hit_columns"`      // 关键字匹配类型 有效时:array 无效时:null
	AllNetName     string                          `json:"all_net_name"`     // 空 作用尚不明确
	AllNetIcon     string                          `json:"all_net_icon"`     // 空 作用尚不明确
	AllNetURL      string                          `json:"all_net_url"`      // 空 作用尚不明确
	AngleTitle     string                          `json:"angle_title"`      // 角标内容
	AngleColor     int                             `json:"angle_color"`      // 角标颜色 (0:红色 2:橙色)
	DisplayInfo    []*SearchResultMediaDisplayInfo `json:"display_info"`     // 剧集标志信息
	HitEpids       string                          `json:"hit_epids"`        // 关键字匹配分集标题的分集epid 多个用,分隔
	PgcSeasonID    int64                           `json:"pgc_season_id"`    // 剧集ssid
	SeasonType     int                             `json:"season_type"`      // 剧集类型 (1:番剧 2:电影 3:纪录片 4:国创 5:电视剧 7:综艺)
	SeasonTypeName string                          `json:"season_type_name"` // 剧集类型文字
	SelectionStyle string                          `json:"selection_style"`  // 分集选择按钮风格 horizontal:横排式 grid:按钮式
	EpSize         int                             `json:"ep_size"`          // 结果匹配的分集数
	URL            string                          `json:"url"`              // 剧集重定向url
	ButtonText     string                          `json:"button_text"`      // 观看按钮文字
	IsFollow       int                             `json:"is_follow"`        // 是否追番 需要登录(SESSDATA) 未登录则恒为0 (0:否 1:是)
	IsSelection    int                             `json:"is_selection"`     // 恒为1 作用尚不明确
	Eps            []*SearchResultEp               `json:"eps"`              // 结果匹配的分集信息
	Badges         []*SearchResultEpBadge          `json:"badges"`           // 剧集标志信息
}

type SearchResultMediaDisplayInfo

type SearchResultMediaDisplayInfo struct {
	BgColorNight     string `json:"bg_color_night"`     // 夜间背景颜色 颜色码 例如:#BB5B76
	Text             string `json:"text"`               // 剧集标志 颜色码 例如:#BB5B76
	BorderColor      string `json:"border_color"`       // 背景颜色 颜色码 例如:#BB5B76
	BgStyle          int    `json:"bg_style"`           // 恒为1
	TextColor        string `json:"text_color"`         // 文字颜色 颜色码 例如:#BB5B76
	BgColor          string `json:"bg_color"`           // 背景颜色 颜色码 例如:#BB5B76
	TextColorNight   string `json:"text_color_night"`   // 夜间文字颜色 颜色码 例如:#BB5B76
	BorderColorNight string `json:"border_color_night"` // 夜间背景颜色 颜色码 例如:#BB5B76
}

type SearchResultMediaScore

type SearchResultMediaScore struct {
	UserCount int     `json:"user_count"` // 总计评分人数
	Score     float64 `json:"score"`      // 评分
}

type SearchResultVideo

type SearchResultVideo struct {
	Type         string   `json:"type"`           // 结果类型 固定为video
	ID           int64    `json:"id"`             // 稿件avid
	Author       string   `json:"author"`         // UP主昵称
	MID          int64    `json:"mid"`            // UP主mid
	TypeID       string   `json:"typeid"`         // 视频分区tid
	TypeName     string   `json:"typename"`       // 视频子分区名
	ArcURL       string   `json:"arcurl"`         // 视频重定向URL
	AID          int64    `json:"aid"`            // 稿件avid
	BVID         string   `json:"bvid"`           // 稿件bvid
	Title        string   `json:"title"`          // 视频标题 关键字用xml标签<em class="keyword">标注
	Description  string   `json:"description"`    // 视频简介
	ArcRank      string   `json:"arcrank"`        // 恒为0 作用尚不明确
	Pic          string   `json:"pic"`            // 视频封面url
	Play         int64    `json:"play"`           // 视频播放量
	VideoReview  int      `json:"video_review"`   // 视频弹幕量
	Favorites    int      `json:"favorites"`      // 视频收藏数
	Tag          string   `json:"tag"`            // 视频TAG 每项TAG用,分隔
	Review       int      `json:"review"`         // 视频评论数
	PubDate      int64    `json:"pubdate"`        // 视频投稿时间 时间戳(东八区)
	SendDate     int64    `json:"senddate"`       // 视频发布时间 时间戳(东八区)
	Duration     string   `json:"duration"`       // 视频时长 格式: HH:MM
	BadgePay     bool     `json:"badgepay"`       // 恒为false 作用尚不明确
	HitColumns   []string `json:"hit_columns"`    // 关键字匹配类型
	ViewType     string   `json:"view_type"`      // 空 作用尚不明确
	IsPay        int      `json:"is_pay"`         // 空 作用尚不明确
	IsUnionVideo int      `json:"is_union_video"` // 是否为合作视频 0:否 1:是
	RankScore    int64    `json:"rank_score"`     // 结果排序量化值

}

type SearchTopTlist

type SearchTopTlist struct {
	PGC           int `json:"pgc"`            //
	LiveRoom      int `json:"live_room"`      // 直播数
	Photo         int `json:"photo"`          // 相簿数
	Topic         int `json:"topic"`          // 话题数
	Video         int `json:"video"`          // 视频数
	User          int `json:"user"`           //
	BiliUser      int `json:"bili_user"`      // 用户数
	MediaFT       int `json:"media_ft"`       // 电影数
	Article       int `json:"article"`        // 专栏数
	MediaBangumi  int `json:"media_bangumi"`  // 番剧数
	Special       int `json:"special"`        //
	Card          int `json:"card"`           //
	OperationCard int `json:"operation_card"` //
	UpUser        int `json:"upuser"`         //
	Movie         int `json:"movie"`          //
	LiveAll       int `json:"live_all"`       //
	TV            int `json:"tv"`             //
	Live          int `json:"live"`           // 直播间数 	//
	Bangumi       int `json:"bangumi"`        //
	Activity      int `json:"activity"`       // 活动数
	LiveMaster    int `json:"live_master"`    //
	LiveUser      int `json:"live_user"`      // 主播数
}

type SpaceGame

type SpaceGame struct {
	Website string `json:"website"` // 游戏主页链接ur
	Image   string `json:"image"`   // 游戏图片url
	Name    string `json:"name"`    // 游戏名
}

type SpaceVideo

type SpaceVideo struct {
	Reason     string `json:"reason"`      // 置顶视频备注
	InterVideo bool   `json:"inter_video"` // 是否为合作视频
	// contains filtered or unexported fields
}

type SpaceVideoCoin

type SpaceVideoCoin struct {
	Coins      int    `json:"coins"`       // 投币数量
	Time       int64  `json:"time"`        // 投币时间 时间戳
	IP         string `json:"ip"`          // 空
	InterVideo bool   `json:"inter_video"` // 是否为合作视频
	// contains filtered or unexported fields
}

type SpaceVideoSearchEpisodicButton

type SpaceVideoSearchEpisodicButton struct {
	Text string `json:"text"` // 按钮文字
	Uri  string `json:"uri"`  // 全部播放页url(经测试页面空白...)
}

type SpaceVideoSearchList

type SpaceVideoSearchList struct {
	Tlist map[string]*SpaceVideoSearchTList `json:"tlist"` // 投稿视频分区索引 key为tid字符串形式,value为详细信息
	Vlist []*SpaceVideoSearchVList          `json:"vlist"` // 投稿视频列表
}

type SpaceVideoSearchPage

type SpaceVideoSearchPage struct {
	Count int `json:"count"` // 总计稿件数
	PN    int `json:"pn"`    // 当前页码(可以用于请求下一页的数据计算)
	PS    int `json:"ps"`    // 当前每页项数(可以用于请求下一页的数据计算)
}

type SpaceVideoSearchResult

type SpaceVideoSearchResult struct {
	List           *SpaceVideoSearchList           `json:"list"`            // 列表信息
	Page           *SpaceVideoSearchPage           `json:"page"`            // 页面信息
	EpisodicButton *SpaceVideoSearchEpisodicButton `json:"episodic_button"` // “播放全部“按钮
}

type SpaceVideoSearchTList

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

type SpaceVideoSearchVList

type SpaceVideoSearchVList struct {
	AID          int64  `json:"aid"`            // 稿件avid
	Author       string `json:"author"`         // 视频UP主 不一定为目标用户(合作视频)
	BVID         string `json:"bvid"`           // 稿件bvid
	Comment      int    `json:"comment"`        // 视频评论数
	Copyright    string `json:"copyright"`      // 空 作用尚不明确
	Created      int64  `json:"created"`        // 投稿时间 时间戳
	Description  string `json:"description"`    // 视频简介
	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          int64  `json:"mid"`            // 视频UP主mid 不一定为目标用户(合作视频)
	Pic          string `json:"pic"`            // 视频封面
	Play         int64  `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 UpStat

type UpStat struct {
	Archive *UpStatArchive `json:"archive"` // 视频播放量
	Article *UpStatArticle `json:"article"` // 专栏阅读量
	Likes   int64          `json:"likes"`   // 获赞次数
}

type UpStatArchive

type UpStatArchive struct {
	View int64 `json:"view"` // 视频播放量
}

type UpStatArticle

type UpStatArticle struct {
	View int64 `json:"view"` // 专栏阅读量
}

type VideoDesc

type VideoDesc struct {
	RawText string `json:"raw_text"` // 简介内容
	Type    int    `json:"type"`     // 未知
	BizID   int64  `json:"biz_id"`   // 未知
}

type VideoDimension

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

type VideoInfo

type VideoInfo struct {
	NoCache     bool           `json:"no_cache"`     // 恒为true 作用尚不明确
	Pages       []*VideoPage   `json:"pages"`        // 视频分P列表
	Subtitle    *VideoSubtitle `json:"subtitle"`     // 视频CC字幕信息
	Staff       []*VideoStaff  `json:"staff"`        // 合作成员列表 (非合作视频无此项)
	UserGarb    *VideoUserGarb `json:"user_garb"`    // 用户装扮信息
	DescV2      []*VideoDesc   `json:"desc_v2"`      // 新版视频简介
	Forward     int64          `json:"forward"`      // 撞车视频跳转avid (仅撞车视频存在此字段)
	MissionID   int64          `json:"mission_id"`   // 稿件参与的活动ID
	RedirectURL string         `json:"redirect_url"` // 重定向URL  仅番剧或影视视频存在此字段,用于番剧&影视的av/bv->ep
	// contains filtered or unexported fields
}

type VideoOwner

type VideoOwner struct {
	MID  int64  `json:"mid"`  // UP主mid
	Name string `json:"name"` // UP主昵称
	Face string `json:"face"` // UP主头像URL直链
}

type VideoPage

type VideoPage struct {
	CID       int64           `json:"cid"`       // 当前分P的CID
	Page      int             `json:"page"`      // 当前分P 在Pages中的id
	From      string          `json:"from"`      // 视频来源 vupload:普通上传(B站) hunan:芒果TV qq:腾讯
	Part      string          `json:"part"`      // 当前分P标题
	Duration  int64           `json:"duration"`  // 当前分P持续时间 单位为秒
	VID       string          `json:"vid"`       // 站外视频VID 仅站外视频有效
	Weblink   string          `json:"weblink"`   // 站外视频跳转URL 仅站外视频有效
	Dimension *VideoDimension `json:"dimension"` // 当前分P分辨率
}

type VideoPlayDURL

type VideoPlayDURL struct {
	Order     int      `json:"order"`      // 视频分段序号 某些视频会分为多个片段(从1顺序增长)
	Length    int64    `json:"length"`     // 视频长度 单位为毫秒
	Size      int64    `json:"size"`       // 视频大小 单位为Byte
	Ahead     string   `json:"ahead"`      // 空 作用尚不明确
	Vhead     string   `json:"vhead"`      // 空 作用尚不明确
	URL       string   `json:"url"`        // 视频流url 注:url内容存在转义符 有效时间为120min
	BackupURL []string `json:"backup_url"` // 备用视频流
}

type VideoPlayURLDash

type VideoPlayURLDash struct {
	Duration      int64                    `json:"duration"`        // 作用尚不明确
	MinBufferTime float64                  `json:"min_buffer_time"` // 1.5 作用尚不明确
	Video         []*VideoPlayURLDashMedia `json:"video"`           // 视频流信息
	Audio         []*VideoPlayURLDashMedia `json:"audio"`           // 音频流信息
}

type VideoPlayURLDashMedia

type VideoPlayURLDashMedia struct {
	ID           int                       `json:"id"`             // 音视频清晰度代码
	BaseURL      string                    `json:"base_url"`       // 默认视频/音频流url 有效时间为120min
	BackupURL    []string                  `json:"backup_url"`     // 备用视频/音频流url
	Bandwidth    int64                     `json:"bandwidth"`      // 视频/音频所需最低带宽
	MimeType     string                    `json:"mime_type"`      // 视频/音频格式类型
	Codecs       string                    `json:"codecs"`         // 编码/音频类型
	Width        int                       `json:"width"`          // 视频宽度	单位为像素 仅视频有效
	Height       int                       `json:"height"`         // 视频高度 单位为像素 仅视频有效
	FrameRate    string                    `json:"frame_rate"`     // 视频帧率 仅视频有效
	Sar          string                    `json:"sar"`            //1:1	作用尚不明确
	StartWithSap int                       `json:"start_with_sap"` // 1	作用尚不明确
	SegmentBase  *VideoPlayURLDashMediaSeg `json:"segment_base"`   // ??? 作用尚不明确
	Codecid      int                       `json:"codecid"`        // 7 作用尚不明确
}

type VideoPlayURLDashMediaSeg

type VideoPlayURLDashMediaSeg struct {
	Initialization string `json:"initialization"` // ??? 作用尚不明确
	IndexRange     string `json:"index_range"`    // ??? 作用尚不明确
}

type VideoPlayURLFormat

type VideoPlayURLFormat struct {
	Quality        int    `json:"quality"`         // 清晰度标识
	Format         string `json:"format"`          // 视频格式
	NewDescription string `json:"new_description"` // 新版清晰度描述
	DisplayDesc    string `json:"display_desc"`    // 显示名称
	Superscript    string `json:"superscript"`     // 角标?
}

type VideoPlayURLResult

type VideoPlayURLResult struct {
	From              string                `json:"from"`               // local 作用尚不明确
	Result            string                `json:"result"`             // suee 作用尚不明确
	Message           string                `json:"message"`            // 空 作用尚不明确
	Quality           int                   `json:"quality"`            // 当前的视频分辨率代码
	Format            string                `json:"format"`             // 当前请求的视频格式
	TimeLength        int64                 `json:"timelength"`         // 视频长度 单位为毫秒 不同分辨率/格式可能有略微差异
	AcceptFormat      string                `json:"accept_format"`      // 视频支持的全部格式 每项用,分隔
	AcceptDescription []string              `json:"accept_description"` // 视频支持的分辨率列表
	AcceptQuality     []int                 `json:"accept_quality"`     // 视频支持的分辨率代码列表
	VideoCodecid      int                   `json:"video_codecid"`      // 7 作用尚不明确
	SeekParam         string                `json:"seek_param"`         // start 作用尚不明确
	SeekType          string                `json:"seek_type"`          // ??? 作用尚不明确
	DURL              []*VideoPlayDURL      `json:"durl"`               // 视频分段	注:仅flv/mp4存在此项
	Dash              *VideoPlayURLDash     `json:"dash"`               // dash音视频流信息	注:仅dash存在此项
	SupportFormats    []*VideoPlayURLFormat `json:"support_formats"`    // 支持的分辨率的详细信息
}

type VideoRecommendInfo

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

type VideoRights

type VideoRights struct {
	BP            int `json:"bp"`              // 恒为0
	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付费
	IsSteinGate   int `json:"is_stein_gate"`   // 是否为互动视频
	IsCooperation int `json:"is_cooperation"`  // 是否为联合投稿
	UGCPayPreview int `json:"ugc_pay_preview"` // 恒为0
	NoBackground  int `json:"no_background"`   // 恒为0
}

type VideoShot

type VideoShot struct {
	// bin格式截取时间表URL
	//
	// bin数据格式: https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/video/snapshot.md#bin%E6%A0%BC%E5%BC%8F%E6%88%AA%E5%8F%96%E6%97%B6%E9%97%B4%E8%A1%A8
	Pvdata   string   `json:"pvdata"`
	ImgXLen  int      `json:"img_x_len"`  // 每行图片数 一般为10
	ImgYLen  int      `json:"img_y_len"`  // 每列图片数 一般为10
	ImgXSize int      `json:"img_x_size"` // 每张图片长 一般为160
	ImgYSize int      `json:"img_y_size"` // 每张图片宽 一般为90
	Image    []string `json:"image"`      // 图片拼版URL 第一张拼版占满时延续第二张
	Index    []int    `json:"index"`      // json数组格式截取时间表 单位为秒
}

VideoShot

快照的截取时间根据视频画面变化程度决定,各视频不相同

截取时间表的时间根据视频画面变化程度决定,各每个视频不相同

截取时间表的时间和快照一一对应,并按照从左到右 从上到下的顺序排布

type VideoSingleStat

type VideoSingleStat struct {
	AID        int64  `json:"aid"`        // 稿件avid
	BVID       string `json:"bvid"`       // 稿件bvid
	View       int64  `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
	NoReprint  int    `json:"no_reprint"` // 禁止转载标志 0:无 1:禁止
	Copyright  int    `json:"copyright"`  // 版权标志 1:自制 2:转载
	ArgueMsg   string `json:"argue_msg"`  // 警告信息,默认为空
	Evaluation string `json:"evaluation"` // 视频评分,默认为空
}

type VideoStaff

type VideoStaff struct {
	MID      int64               `json:"mid"`      // 成员MID
	Title    string              `json:"title"`    // 成员名称
	Name     string              `json:"name"`     // 成员昵称
	Face     string              `json:"face"`     // 成员头像URL
	VIP      *VideoStaffVIP      `json:"vip"`      // 成员大会员状态
	Official *VideoStaffOfficial `json:"official"` //	成员认证信息
	Follower int                 `json:"follower"` // 成员粉丝数
}

type VideoStaffOfficial

type VideoStaffOfficial struct {
	// 成员认证级别
	//
	// 0为无
	//
	// 1 2 7为个人认证
	//
	// 3 4 5 6为机构认证
	Role  int    `json:"role"`
	Title string `json:"title"` // 成员认证名,Role无时该值为空
	Desc  string `json:"desc"`  // 成员认证备注,Role无时该值为空
	Type  int    `json:"type"`  // 成员认证类型 (-1:无 0:有)
}

type VideoStaffVIP

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

type VideoStat

type VideoStat struct {
	AID        int64  `json:"aid"`        // 稿件avid
	View       int64  `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
	ArgueMsg   string `json:"argue_msg"`  // 警告信息,默认为空
	Evaluation string `json:"evaluation"` // 视频评分,默认为空
}

type VideoSubtitle

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

type VideoSubtitleAuthor

type VideoSubtitleAuthor struct {
	MID           int64  `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 VideoSubtitleList

type VideoSubtitleList struct {
	ID          int64                `json:"id"`           // 字幕ID
	Lan         string               `json:"lan"`          // 字幕语言
	LanDoc      string               `json:"lan_doc"`      // 字幕语言名称
	IsLock      bool                 `json:"is_lock"`      // 是否锁定
	AuthorMID   int64                `json:"author_mid"`   // 字幕上传者MID
	SubtitleURL string               `json:"subtitle_url"` // JSON格式字幕文件URL
	Author      *VideoSubtitleAuthor `json:"author"`       // 字幕上传者信息
}

type VideoTag

type VideoTag struct {
	TagID        int64          `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        int64          `json:"ctime"`         // 创建时间 时间戳(已经为东八区)
	Count        *VideoTagCount `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
}

type VideoTagCount

type VideoTagCount struct {
	View  int `json:"view"`  // 恒为0 作用尚不明确
	Use   int `json:"use"`   // 被使用次数
	Atten int `json:"atten"` // TAG关注数
}

type VideoUserGarb

type VideoUserGarb struct {
	URLImageAniCut string // 一串URL,未知
}

type VideoZone

type VideoZone struct {
	Name string `json:"name"`
	Code string `json:"code"`
	Desc string `json:"desc"`
}

func GetVideoZone

func GetVideoZone(tid int) VideoZone

type VipStat

type VipStat struct {
	MID     int `json:"mid"`      // 用户MID
	VipType int `json:"vip_type"` // 大会员类型	0:无 1:月度 2:年度
	// 大会员状态
	//
	// 1:正常
	//
	// 2:由于IP地址更换过于频繁,服务被冻结
	//
	// 3:你的大会员账号风险过高,大会员功能已被锁定
	VipStatus  int   `json:"vip_status"`
	VipDueDate int64 `json:"vip_due_date"` // 大会员到期时间 时间戳(东八区) 毫秒
	VipPayType int   `json:"vip_pay_type"` // 是否已购买大会员 0:未购买 1:已购买
	ThemeType  int   `json:"theme_type"`   // 0 作用尚不明确
}

Directories

Path Synopsis
internal
proto
dm

Jump to

Keyboard shortcuts

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