Documentation
¶
Index ¶
- Constants
- func AV2BV(av int64) string
- func BV2AV(bv string) int64
- type Account
- type AccountSafetyInfo
- type AccountSafetyOther
- type AccountSafetySNS
- type AccountSafetySafe
- type AccountSafetyStat
- type AudioFavList
- type AudioFavListStat
- type AudioInfo
- type AudioInfoStat
- type AudioInfoVip
- type AudioMember
- type AudioMemberList
- type AudioMyFavLists
- type AudioPlayURL
- type AudioPlayURLQn
- type AudioTag
- type BiliClient
- func (b *BiliClient) AudioGetInfo(auid int64) (*AudioInfo, error)
- func (b *BiliClient) AudioGetMyFavLists(pn int, ps int) (*AudioMyFavLists, error)
- func (b *BiliClient) AudioGetPlayURL(auid int64, qn int) (*AudioPlayURL, error)
- func (b *BiliClient) AudioIsCoined(auid int64) (int, error)
- func (b *BiliClient) AudioIsFavored(auid int64) (bool, error)
- func (b *BiliClient) ChanAdd(name string, intro string) (int64, error)
- func (b *BiliClient) ChanAddVideo(cid int64, aids []int64) ([]int64, error)
- func (b *BiliClient) ChanDel(cid int64) error
- func (b *BiliClient) ChanDelVideo(cid int64, aid int64) error
- func (b *BiliClient) ChanEdit(cid int64, name string, intro string) error
- func (b *BiliClient) ChanGetMy() (*ChannelList, error)
- func (b *BiliClient) ChanGetMyVideo(cid int64, pn int, ps int) (*ChanVideo, error)
- func (b *BiliClient) ChanHasInvalidVideo(cid int64) error
- func (b *BiliClient) ChanSetVideoSort(cid int64, aid int64, to int) error
- func (b *BiliClient) ChargeSetMessage(order string, message string) error
- func (b *BiliClient) ChargeTradeCheckQrCode(token string) (*ChargeQrCodeStatus, error)
- func (b *BiliClient) ChargeTradeCreateBp(num int, mid int64, otype string, oid int64) (*ChargeBpResult, error)
- func (b *BiliClient) ChargeTradeCreateQrCode(num int, prior bool, mid int64, otype string, oid int64) (*ChargeCreateQrCode, error)
- func (b *BiliClient) CommentDel(oid int64, tp int, rpid int64) error
- func (b *BiliClient) CommentHate(oid int64, tp int, rpid int64, hate bool) error
- func (b *BiliClient) CommentLike(oid int64, tp int, rpid int64, like bool) error
- func (b *BiliClient) CommentReport(oid int64, tp int, rpid int64, reason int, content string) error
- func (b *BiliClient) CommentSend(oid int64, tp int, content string, platform int, root int64, parent int64) (*CommentSend, error)
- func (b *BiliClient) CommentSetTop(oid int64, tp int, rpid int64, top bool) error
- func (b *BiliClient) DanmakuCommandPost(tp int, aid int64, cid int64, progress int64, platform int, data string, ...) (*DanmakuCommandPostResult, error)
- func (b *BiliClient) DanmakuEditPool(tp int, cid int64, dmids []uint64, pool int) error
- func (b *BiliClient) DanmakuEditState(tp int, cid int64, dmids []uint64, state int) error
- func (b *BiliClient) DanmakuGetHistory(cid int64, date string) (*DanmakuResp, error)
- func (b *BiliClient) DanmakuGetHistoryIndex(cid int64, year int, month int) ([]string, error)
- func (b *BiliClient) DanmakuGetLikes(cid int64, dmids []uint64) (map[uint64]*DanmakuGetLikesResult, error)
- func (b *BiliClient) DanmakuLike(cid int64, dmid uint64, op int) error
- func (b *BiliClient) DanmakuPost(tp int, aid int64, cid int64, msg string, progress int64, color int, ...) (*DanmakuPostResult, error)
- func (b *BiliClient) DanmakuRecall(cid int64, dmid uint64) (string, error)
- func (b *BiliClient) DanmakuReport(cid int64, dmid uint64, reason int, content string) error
- func (b *BiliClient) DanmakuSetConfig(conf *DanmakuConfig) error
- func (b *BiliClient) DynaCreateDraft(content string, at map[string]int64, pic []*DynaUploadPic, publish int64) (int64, error)
- func (b *BiliClient) DynaCreateDraw(content string, at map[string]int64, pic []*DynaUploadPic) (int64, error)
- func (b *BiliClient) DynaCreatePlain(content string, at map[string]int64) (int64, error)
- func (b *BiliClient) DynaDel(dyid int64) error
- func (b *BiliClient) DynaDelDraft(dfid int64) error
- func (b *BiliClient) DynaGetDrafts() (*DynaGetDraft, error)
- func (b *BiliClient) DynaLike(dyid int64, like bool) error
- func (b *BiliClient) DynaModifyDraft(dfid int64, content string, at map[string]int64, pic []*DynaUploadPic, ...) error
- func (b *BiliClient) DynaPublishDraft(dfid int64) (int64, error)
- func (b *BiliClient) DynaRepost(dyid int64, content string, at map[string]int64) error
- func (b *BiliClient) DynaUploadPics(pics []io.Reader) ([]*DynaUploadPic, error)
- func (b *BiliClient) EmotePackAdd(id int64, business string) error
- func (b *BiliClient) EmotePackGetAll(business string) ([]*EmotePack, error)
- func (b *BiliClient) EmotePackGetMy(business string) ([]*EmotePack, error)
- func (b *BiliClient) EmotePackRemove(id int64, business string) error
- func (b *BiliClient) FavAdd(title string, intro string, privacy bool, cover string) (*FavDetail, error)
- func (b *BiliClient) FavCleanRes(mlid int64) error
- func (b *BiliClient) FavCopyRes(from int64, to int64, mid int64, resources []string) error
- func (b *BiliClient) FavDel(mlids []int64) error
- func (b *BiliClient) FavDelRes(mlid int64, resources []string) error
- func (b *BiliClient) FavEdit(mlid int64, title string, intro string, privacy bool, cover string) (*FavDetail, error)
- func (b *BiliClient) FavGetDetail(mlid int64) (*FavDetail, error)
- func (b *BiliClient) FavGetMy() (*FavoritesList, error)
- func (b *BiliClient) FavGetRes(mlid int64) ([]*FavRes, error)
- func (b *BiliClient) FavGetResDetail(mlid int64, tid int, keyword string, order string, tp int, pn int, ps int) (*FavResDetail, error)
- func (b *BiliClient) FavMoveRes(from int64, to int64, mid int64, resources []string) error
- func (b *BiliClient) FollowUser(mid int64, follow bool) error
- func (b *BiliClient) FollowingsGetMy() ([]int64, error)
- func (b *BiliClient) FollowingsGetMyDetail(pn int, ps int, order int) (*FollowingsDetail, error)
- func (b *BiliClient) GetAccountSafetyStat() (*AccountSafetyStat, error)
- func (b *BiliClient) GetCoinLogs() ([]*CoinLog, error)
- func (b *BiliClient) GetCookieAuth() *CookieAuth
- func (b *BiliClient) GetExpCoinReward() (int, error)
- func (b *BiliClient) GetExpRewardStat() (*ExpRewardStat, error)
- func (b *BiliClient) GetMe() (*Account, error)
- func (b *BiliClient) GetMsgUnread() (*MsgUnRead, error)
- func (b *BiliClient) GetNavInfo() (*NavInfo, error)
- func (b *BiliClient) GetNavStat() (*NavStat, error)
- func (b *BiliClient) GetRealNameInfo() (*RealNameInfo, error)
- func (b *BiliClient) GetRealNameStat() (bool, error)
- func (b *BiliClient) GetRelationStat(mid int64) (*RelationStat, error)
- func (b *BiliClient) GetUpStat(mid int64) (*UpStat, error)
- func (b *BiliClient) GetVipStat() (*VipStat, error)
- func (b *BiliClient) LiveSendDanmaku(roomID int64, color int64, fontsize int, mode int, msg string, bubble int) error
- func (b *BiliClient) Raw(base, endpoint, method string, payload map[string]string) ([]byte, error)
- func (b *BiliClient) RawParse(base, endpoint, method string, payload map[string]string) (*Response, error)
- func (b *BiliClient) SetClient(client *http.Client)
- func (b *BiliClient) SetUA(ua string)
- func (b *BiliClient) SignUpdate(sign string) error
- func (b *BiliClient) SpaceAddMasterpieces(aid int64, reason string) error
- func (b *BiliClient) SpaceCancelMasterpiece(aid int64) error
- func (b *BiliClient) SpaceCancelTopArchive() error
- func (b *BiliClient) SpaceGetMyLastPlayGame() ([]*SpaceGame, error)
- func (b *BiliClient) SpaceGetMyLastVideoCoin() ([]*SpaceVideoCoin, error)
- func (b *BiliClient) SpaceSetNotice(notice string) error
- func (b *BiliClient) SpaceSetTags(tags []string) error
- func (b *BiliClient) SpaceSetTopArchive(aid int64, reason string) error
- func (b *BiliClient) Upload(base, endpoint string, payload map[string]string, files []*FileUpload) ([]byte, error)
- func (b *BiliClient) UploadParse(base, endpoint string, payload map[string]string, files []*FileUpload) (*Response, error)
- func (b *BiliClient) UserGetInfo(mid int64) (*UserInfo, error)
- func (b *BiliClient) VideoAddCoins(aid int64, num int, like bool) error
- func (b *BiliClient) VideoAddLike(aid int64, like bool) error
- func (b *BiliClient) VideoGetInfo(aid int64) (*VideoInfo, error)
- func (b *BiliClient) VideoGetPlayURL(aid int64, cid int64, qn int, fnval int) (*VideoPlayURLResult, error)
- func (b *BiliClient) VideoGetPopular(pn, ps int) (*PopularVideoLists, error)
- func (b *BiliClient) VideoGetTags(aid int64) ([]*VideoTag, error)
- func (b *BiliClient) VideoHateTag(aid int64, tagID int64) error
- func (b *BiliClient) VideoHeartBeat(aid int64, cid int64, playedTime int64) error
- func (b *BiliClient) VideoIsAddedCoins(aid int64) (int, error)
- func (b *BiliClient) VideoIsFavoured(aid int64) (bool, error)
- func (b *BiliClient) VideoIsLiked(aid int64) (bool, error)
- func (b *BiliClient) VideoLikeTag(aid int64, tagID int64) error
- func (b *BiliClient) VideoReportProgress(aid int64, cid int64, progress int64) error
- func (b *BiliClient) VideoSetFavour(aid int64, addLists []int64, delLists []int64) (bool, error)
- func (b *BiliClient) VideoShare(aid int64) (int, error)
- func (b *BiliClient) VideoTriple(aid int64) (like, coin, favour bool, multiply int, e error)
- type BiliSetting
- type ChanInfo
- type ChanVideo
- type ChanVideoInfo
- type ChanVideoList
- type ChanVideoPage
- type ChannelList
- type ChargeBpResult
- type ChargeCreateQrCode
- type ChargeItem
- type ChargeItemVip
- type ChargeQrCodeStatus
- type ChargeSpaceList
- type ChargeVideoList
- type ChargeVideoShow
- type CoinLog
- type CommClient
- func (c *CommClient) AudioGetInfo(auid int64) (*AudioInfo, error)
- func (c *CommClient) AudioGetLyric(auid int64) (string, error)
- func (c *CommClient) AudioGetMembers(auid int64) ([]*AudioMember, error)
- func (c *CommClient) AudioGetPlayURL(auid int64, qn int) (*AudioPlayURL, error)
- func (c *CommClient) AudioGetStat(auid int64) (*AudioInfoStat, error)
- func (c *CommClient) AudioGetTags(auid int64) ([]*AudioTag, error)
- func (c *CommClient) ChanGet(mid int64) (*ChannelList, error)
- func (c *CommClient) ChanGetVideo(mid int64, cid int64, pn int, ps int) (*ChanVideo, error)
- func (c *CommClient) ChargeSpaceGetList(mid int64) (*ChargeSpaceList, error)
- func (c *CommClient) ChargeVideoGetList(mid int64, aid int64) (*ChargeVideoList, error)
- func (c *CommClient) CommentGetCount(oid int64, tp int) (int, error)
- func (c *CommClient) CommentGetMain(oid int64, tp int, mode int, next int, ps int) (*CommentMain, error)
- func (c *CommClient) CommentGetReply(oid int64, tp int, root int64, pn int, ps int) (*CommentReply, error)
- func (c *CommClient) DanmakuGetByPb(tp int, cid int64, seg int) (*DanmakuResp, error)
- func (c *CommClient) DanmakuGetLikes(cid int64, dmids []uint64) (map[uint64]*DanmakuGetLikesResult, error)
- func (c *CommClient) DanmakuGetShot(aid int64) ([]string, error)
- func (c *CommClient) EmoteGetFreePack(business string) ([]*EmotePack, error)
- func (c *CommClient) EmoteGetPackDetail(business string, ids []int64) ([]*EmotePack, error)
- func (c *CommClient) FavGet(mid int64) (*FavoritesList, error)
- func (c *CommClient) FavGetDetail(mlid int64) (*FavDetail, error)
- func (c *CommClient) FavGetRes(mlid int64) ([]*FavRes, error)
- func (c *CommClient) FavGetResDetail(mlid int64, tid int, keyword string, order string, tp int, pn int, ps int) (*FavResDetail, error)
- func (c *CommClient) FollowingsGetDetail(mid int64, pn int, ps int) (*FollowingsDetail, error)
- func (c *CommClient) GenerateQrcode() (*GenerateQrcodeInfo, error)
- func (c *CommClient) GetDailyNum() (map[int]int, error)
- func (c *CommClient) GetGeoInfo() (*GeoInfo, error)
- func (c *CommClient) GetRelationStat(mid int64) (*RelationStat, error)
- func (c *CommClient) GetUnixNow() (int64, error)
- func (c *CommClient) LiveGetAllGiftInfo(roomID int64, areaID int, areaParentID int) (*LiveAllGiftInfo, error)
- func (c *CommClient) LiveGetAreaInfo() ([]*LiveAreaInfo, error)
- func (c *CommClient) LiveGetGuardList(roomID int64, mid int64, pn int, ps int) (*LiveGuardList, error)
- func (c *CommClient) LiveGetMedalRank(roomID int64, mid int64) (*LiveMedalRank, error)
- func (c *CommClient) LiveGetPlayURL(roomID int64, qn int) (*LivePlayURL, error)
- func (c *CommClient) LiveGetRoomInfoByID(roomID int64) (*LiveRoomInfoByID, error)
- func (c *CommClient) LiveGetRoomInfoByMID(mid int64) (*LiveRoomInfoByMID, error)
- func (c *CommClient) LiveGetWsConf(roomID int64) (*LiveWsConf, error)
- func (c *CommClient) Raw(base, endpoint, method string, payload map[string]string) ([]byte, error)
- func (c *CommClient) RawParse(base, endpoint, method string, payload map[string]string) (*Response, error)
- func (c *CommClient) RawParseAndReturnHeaders(base, endpoint, method string, payload map[string]string) (*Response, map[string]interface{}, error)
- func (c *CommClient) ScanQrcode(qrcodeKey string) (*ScanQrcode, *CookieAuth, error)
- func (c *CommClient) SetClient(client *http.Client)
- func (c *CommClient) SetUA(ua string)
- func (c *CommClient) SpaceGetLastPlayGame(mid int64) ([]*SpaceGame, error)
- func (c *CommClient) SpaceGetLastVideoCoin(mid int64) ([]*SpaceVideoCoin, error)
- func (c *CommClient) SpaceGetMasterpieces(mid int64) ([]*SpaceVideo, error)
- func (c *CommClient) SpaceGetNotice(mid int64) (string, error)
- func (c *CommClient) SpaceGetTags(mid int64) ([]string, error)
- func (c *CommClient) SpaceGetTopArchive(mid int64) (*SpaceVideo, error)
- func (c *CommClient) SpaceSearchVideo(mid int64, order string, tid int, keyword string, pn int, ps int) (*SpaceVideoSearchResult, error)
- func (c *CommClient) UserGetInfo(mid int64) (*UserInfo, error)
- func (c *CommClient) VideoGetDescription(aid int64) (string, error)
- func (c *CommClient) VideoGetInfo(aid int64) (*VideoInfo, error)
- func (c *CommClient) VideoGetOnlineNum(aid int64, cid int64) (total string, web string, e error)
- func (c *CommClient) VideoGetPageList(aid int64) ([]*VideoPage, error)
- func (c *CommClient) VideoGetPlayURL(aid int64, cid int64, qn int, fnval int) (*VideoPlayURLResult, error)
- func (c *CommClient) VideoGetPopular(pn, ps int) (*PopularVideoLists, error)
- func (c *CommClient) VideoGetRecommend(aid int64) ([]*VideoRecommendInfo, error)
- func (c *CommClient) VideoGetStat(aid int64) (*VideoSingleStat, error)
- func (c *CommClient) VideoShot(aid int64, cid int64, index bool) (*VideoShot, error)
- func (c *CommClient) VideoTags(aid int64) ([]*VideoTag, error)
- type CommSetting
- type Comment
- type CommentMain
- type CommentMember
- type CommentReply
- type CommentSend
- type CookieAuth
- type Danmaku
- type DanmakuCommandPostResult
- type DanmakuConfig
- type DanmakuGetLikesResult
- type DanmakuPostResult
- type DanmakuResp
- type DynaDraft
- type DynaGetDraft
- type DynaUploadPic
- type Emote
- type EmoteFlag
- type EmoteMeta
- type EmotePack
- type EmotePackFlag
- type EmotePackMeta
- type ExpRewardStat
- type FavDetail
- type FavDetailCnt
- type FavDetailUpper
- type FavInfo
- type FavRes
- type FavResDetail
- type FavResDetailMedia
- type FavResDetailMediaCnt
- type FavoritesList
- type FileUpload
- type FollowingsDetail
- type FollowingsItem
- type GenerateQrcodeInfo
- type GeoInfo
- type LiveAllGiftInfo
- type LiveAreaInfo
- type LiveGuardList
- type LiveMedalRank
- type LivePlayURL
- type LiveRoomInfoByID
- type LiveRoomInfoByMID
- type LiveWsConf
- type MsgUnRead
- type NavInfo
- type NavInfoLevel
- type NavInfoOfficial
- type NavInfoOfficialVerify
- type NavInfoPendant
- type NavInfoVipLabel
- type NavInfoWallet
- type NavStat
- type PopularVideoList
- type PopularVideoLists
- type RealNameInfo
- type RelationStat
- type Response
- type ScanQrcode
- type SearchAll
- type SearchCostTime
- type SearchPage
- type SearchPageInfo
- type SearchResult
- type SearchResultEp
- type SearchResultEpBadge
- type SearchResultMedia
- type SearchResultMediaDisplayInfo
- type SearchResultMediaScore
- type SearchResultVideo
- type SearchTopTlist
- type SpaceGame
- type SpaceVideo
- type SpaceVideoCoin
- type SpaceVideoSearchEpisodicButton
- type SpaceVideoSearchList
- type SpaceVideoSearchPage
- type SpaceVideoSearchResult
- type SpaceVideoSearchTList
- type SpaceVideoSearchVList
- type UpStat
- type UpStatArchive
- type UpStatArticle
- type UserInfo
- type VideoDesc
- type VideoDimension
- type VideoInfo
- type VideoOwner
- type VideoPage
- type VideoPlayDURL
- type VideoPlayURLDash
- type VideoPlayURLDashMedia
- type VideoPlayURLDashMediaSeg
- type VideoPlayURLFormat
- type VideoPlayURLResult
- type VideoRecommendInfo
- type VideoRights
- type VideoShot
- type VideoSingleStat
- type VideoStaff
- type VideoStaffOfficial
- type VideoStaffVIP
- type VideoStat
- type VideoSubtitle
- type VideoSubtitleAuthor
- type VideoSubtitleList
- type VideoTag
- type VideoTagCount
- type VideoUserGarb
- type VideoZone
- type VipStat
Constants ¶
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/" BiliVcURL = "https://api.vc.bilibili.com/" )
Variables ¶
This section is empty.
Functions ¶
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 AccountSafetySafe ¶
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 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 AudioInfoVip ¶
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 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 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(大会员)
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) 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) 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) CommentDel ¶
func (b *BiliClient) CommentDel(oid int64, tp int, rpid int64) error
CommentDel 删除评论 只能删除自己的评论,或自己管理的评论区下的评论
oid,tp: 同 BiliClient.CommentSend
rpid: 评论ID
func (*BiliClient) CommentHate ¶
CommentHate 点踩评论,点踩成功后会同时消去该评论的点赞
oid,tp: 同 BiliClient.CommentSend
rpid: 评论ID
like: true为点踩,false为取消点踩
func (*BiliClient) CommentLike ¶
CommentLike 点赞评论,点赞成功后会同时消去该评论的点踩
oid,tp: 同 BiliClient.CommentSend
rpid: 评论ID
like: true为点赞,false为取消点赞
func (*BiliClient) CommentReport ¶
CommentReport 举报评论
oid,tp: 同 BiliClient.CommentSend
rpid: 评论ID
content: 其他举报备注 reason=0时有效 不需要时留空
func (*BiliClient) CommentSend ¶
func (b *BiliClient) CommentSend(oid int64, tp int, content string, platform int, root int64, parent int64) (*CommentSend, error)
CommentSend 发送评论
oid: 对应类型的ID
content: 评论内容,最大1000字符 表情使用表情转义符
platform: 平台标识 1:web端 2:安卓客户端 3:ios客户端 4:wp客户端
root: 二级评论以上使用 没有填0
parent: 二级评论同根评论id 大于二级评论为要回复的评论id
func (*BiliClient) CommentSetTop ¶
CommentSetTop 置顶评论 只能置顶自己管理的评论区中的一级评论
oid,tp: 同 BiliClient.CommentSend
rpid: 评论ID
top: true为置顶,false为取消置顶
func (*BiliClient) DanmakuCommandPost ¶
func (b *BiliClient) DanmakuCommandPost(tp int, aid int64, cid int64, progress int64, platform int, data string, dmid uint64) (*DanmakuCommandPostResult, error)
DanmakuCommandPost 发送互动弹幕,只能在自己的视频发
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 ¶
DanmakuEditPool 修改字幕池,只能操作自己的稿件或有骑士权限的稿件
tp 弹幕类选择 1:视频弹幕
dmids 弹幕dmid数组
pool 操作代码 0:移出字幕池 1:移入字幕池
func (*BiliClient) DanmakuEditState ¶
DanmakuEditState 保护&删除弹幕,只能操作自己的稿件或有骑士权限的稿件
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) DanmakuGetLikes ¶
func (b *BiliClient) DanmakuGetLikes(cid int64, dmids []uint64) (map[uint64]*DanmakuGetLikesResult, error)
DanmakuGetLikes 获取弹幕点赞数,一次可以获取多条弹幕
返回一个map,key为dmid,value为相关信息
func (*BiliClient) DanmakuLike ¶
func (b *BiliClient) DanmakuLike(cid int64, dmid uint64, op int) error
DanmakuLike 点赞弹幕
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 发送普通弹幕
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 仅能撤回自己两分钟内的弹幕,且每天机会有限额
成功后显示剩余次数的文本信息 如 "撤回成功,你还有2次撤回机会"
func (*BiliClient) DanmakuReport ¶
DanmakuReport 举报弹幕
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) DynaCreateDraft ¶
func (b *BiliClient) DynaCreateDraft(content string, at map[string]int64, pic []*DynaUploadPic, publish int64) (int64, error)
DynaCreateDraft 创建定时发布动态
返回draft id
content,at 同 DynaCreatePlain
pics 从 DynaUploadPics 获取
publish 为指定发布的时间戳,换算后为东八区
func (*BiliClient) DynaCreateDraw ¶
func (b *BiliClient) DynaCreateDraw(content string, at map[string]int64, pic []*DynaUploadPic) (int64, error)
DynaCreateDraw 创建图片动态
content,at 同 DynaCreatePlain
pics 从 DynaUploadPics 获取
func (*BiliClient) DynaCreatePlain ¶
DynaCreatePlain 创建普通动态,返回创建的动态ID
具体请看测试样例
支持表情、at、话题
表情请使用 EmotePackGetMy 获取
at请使用 [@刘庸干净又卫生 ] 注意末尾空格
at map 里提供本次动态at的用户名与mid的映射
话题直接用 #xxx# 包裹即可
func (*BiliClient) DynaDelDraft ¶
func (b *BiliClient) DynaDelDraft(dfid int64) error
DynaDelDraft 删除定时发布动态
dfid 定时发布ID
func (*BiliClient) DynaGetDrafts ¶
func (b *BiliClient) DynaGetDrafts() (*DynaGetDraft, error)
DynaGetDrafts
获取所有定时发布动态
func (*BiliClient) DynaLike ¶
func (b *BiliClient) DynaLike(dyid int64, like bool) error
DynaLike 点赞动态
like true:点赞 false: 不点赞
func (*BiliClient) DynaModifyDraft ¶
func (b *BiliClient) DynaModifyDraft(dfid int64, content string, at map[string]int64, pic []*DynaUploadPic, publish int64) error
DynaModifyDraft 修改定时发布动态
dfid 定时发布ID
其他参数同 DynaCreateDraft
func (*BiliClient) DynaPublishDraft ¶
func (b *BiliClient) DynaPublishDraft(dfid int64) (int64, error)
DynaPublishDraft 立即发布定时动态
返回发布的动态ID
dfid 定时发布ID
func (*BiliClient) DynaUploadPics ¶
func (b *BiliClient) DynaUploadPics(pics []io.Reader) ([]*DynaUploadPic, error)
DynaUploadPics 上传动态图片
接口一次只能传一张,该函数为循环上传,如有速度需求请使用并发实现
返回的结构体用于创建
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 ¶
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) FollowUser ¶
func (b *BiliClient) FollowUser(mid int64, follow bool) error
FollowUser
关注用户或取消关注
follow true:关注 false:取消关注
func (*BiliClient) FollowingsGetMy ¶
func (b *BiliClient) FollowingsGetMy() ([]int64, error)
FollowingsGetMy 获取我的关注列表
mid数组
func (*BiliClient) FollowingsGetMyDetail ¶
func (b *BiliClient) FollowingsGetMyDetail(pn int, ps int, order int) (*FollowingsDetail, error)
FollowingsGetMyDetail 获取我的详细的关注列表,获取他人的请使用 CommClient
pn 页码
ps 每页项数,最大50
order 1:最常访问 2:最近关注
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) GetMsgUnread ¶
func (b *BiliClient) GetMsgUnread() (*MsgUnRead, error)
GetMsgUnread 获取未读消息数
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) LiveSendDanmaku ¶
func (b *BiliClient) LiveSendDanmaku(roomID int64, color int64, fontsize int, mode int, msg string, bubble int) error
LiveSendDanmaku 发送弹幕
roomID: 真实直播间ID
color: 颜色十进制,有权限控制.默认白色:16777215
fontsize: 默认25
mode: 1:飞行 5:顶部 4:底部
msg: 弹幕内容
bubble: 气泡弹幕?默认0
func (*BiliClient) RawParse ¶
func (b *BiliClient) RawParse(base, endpoint, method string, payload map[string]string) (*Response, error)
RawParse
base末尾带/
func (*BiliClient) SetClient ¶
func (b *BiliClient) SetClient(client *http.Client)
SetClient
设置Client,可以用来更换代理等操作
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) Upload ¶
func (b *BiliClient) Upload(base, endpoint string, payload map[string]string, files []*FileUpload) ([]byte, error)
Upload 上传文件
base末尾带/
func (*BiliClient) UploadParse ¶
func (b *BiliClient) UploadParse(base, endpoint string, payload map[string]string, files []*FileUpload) (*Response, error)
UploadParse 上传文件
base末尾带/
func (*BiliClient) UserGetInfo ¶
func (b *BiliClient) UserGetInfo(mid int64) (*UserInfo, error)
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) VideoGetPopular ¶
func (b *BiliClient) VideoGetPopular(pn, ps int) (*PopularVideoLists, error)
VideoGetPopular
获取当前热门视频列表
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秒一次,不要过慢或过快上报,控制好时间间隔
playedTime 已播放时间 单位为秒 默认为0
包含了 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 ¶
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 ChannelList ¶
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 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 ChargeQrCodeStatus ¶
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 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 请求
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) 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) CommentGetCount ¶
func (c *CommClient) CommentGetCount(oid int64, tp int) (int, error)
CommentGetCount 获取评论总数
oid: 对应类型的ID
func (*CommClient) CommentGetMain ¶
func (c *CommClient) CommentGetMain(oid int64, tp int, mode int, next int, ps int) (*CommentMain, error)
CommentGetMain 获取评论区内容
oid: 对应类型的ID
mode: 排序方式
0 3:仅按热度
1:按热度+按时间
2:仅按时间
next: 评论页选择 按热度时:热度顺序页码(0为第一页) 按时间时:时间倒序楼层号
ps: 每页项数
具体用法请看测试样例
func (*CommClient) CommentGetReply ¶
func (c *CommClient) CommentGetReply(oid int64, tp int, root int64, pn int, ps int) (*CommentReply, error)
CommentGetReply 获取指定评论和二级回复
oid: 对应类型的ID
root: 目标一级评论rpid
pn: 二级评论页码 从1开始
ps: 二级评论每页项数 定义域:1-49
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 获取弹幕点赞数,一次可以获取多条弹幕
返回一个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) FollowingsGetDetail ¶
func (c *CommClient) FollowingsGetDetail(mid int64, pn int, ps int) (*FollowingsDetail, error)
FollowingsGetDetail 获取个人详细的关注列表
pn 页码
ps 每页项数,最大50
func (*CommClient) GenerateQrcode ¶
func (c *CommClient) GenerateQrcode() (*GenerateQrcodeInfo, error)
GenerateQrcode
申请二维码(web端)
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) LiveGetAllGiftInfo ¶
func (c *CommClient) LiveGetAllGiftInfo(roomID int64, areaID int, areaParentID int) (*LiveAllGiftInfo, error)
LiveGetAllGiftInfo 获取所有礼物信息
areaID: 子分区ID 从 LiveGetAreaInfo 获取
areaParentID: 父分区ID 从 LiveGetAreaInfo 获取
三个字段可以不用填,但填了有助于减小返回内容的大小,置空(传入0)返回约 2.7w 行,填了三个对应值返回约 1.4w 行
func (*CommClient) LiveGetAreaInfo ¶
func (c *CommClient) LiveGetAreaInfo() ([]*LiveAreaInfo, error)
LiveGetAreaInfo
获取直播分区信息
func (*CommClient) LiveGetGuardList ¶
func (c *CommClient) LiveGetGuardList(roomID int64, mid int64, pn int, ps int) (*LiveGuardList, error)
LiveGetGuardList 获取直播间大航海列表
roomID: 真实直播间ID
mid: 主播mid
pn: 页码
ps: 每页项数
func (*CommClient) LiveGetMedalRank ¶
func (c *CommClient) LiveGetMedalRank(roomID int64, mid int64) (*LiveMedalRank, error)
LiveGetMedalRank 获取直播间粉丝勋章榜
roomID: 真实直播间ID
mid: 主播mid
func (*CommClient) LiveGetPlayURL ¶
func (c *CommClient) LiveGetPlayURL(roomID int64, qn int) (*LivePlayURL, error)
LiveGetPlayURL 获取直播流信息
qn: 原画:10000 蓝光:400 超清:250 高清:150 流畅:80
func (*CommClient) LiveGetRoomInfoByID ¶
func (c *CommClient) LiveGetRoomInfoByID(roomID int64) (*LiveRoomInfoByID, error)
LiveGetRoomInfoByID 从roomID获取直播间信息
roomID 可为短号也可以是真实房号
func (*CommClient) LiveGetRoomInfoByMID ¶
func (c *CommClient) LiveGetRoomInfoByMID(mid int64) (*LiveRoomInfoByMID, error)
LiveGetRoomInfoByMID
从mid获取直播间信息
func (*CommClient) LiveGetWsConf ¶
func (c *CommClient) LiveGetWsConf(roomID int64) (*LiveWsConf, error)
LiveGetWsConf 获取直播websocket服务器信息
roomID: 真实直播间ID
func (*CommClient) RawParse ¶
func (c *CommClient) RawParse(base, endpoint, method string, payload map[string]string) (*Response, error)
RawParse
base末尾带/
func (*CommClient) RawParseAndReturnHeaders ¶
func (c *CommClient) RawParseAndReturnHeaders(base, endpoint, method string, payload map[string]string) (*Response, map[string]interface{}, error)
RawParseAndReturnHeaders
base末尾带/ 并返回resp头信息
func (*CommClient) ScanQrcode ¶
func (c *CommClient) ScanQrcode(qrcodeKey string) (*ScanQrcode, *CookieAuth, error)
ScanQrcode
扫码登录(web端)
func (*CommClient) SetClient ¶
func (c *CommClient) SetClient(client *http.Client)
SetClient
设置Client,可以用来更换代理等操作
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) UserGetInfo ¶
func (c *CommClient) UserGetInfo(mid int64) (*UserInfo, error)
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 ¶
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) VideoGetPopular ¶
func (c *CommClient) VideoGetPopular(pn, ps int) (*PopularVideoLists, error)
VideoGetPopular
获取当前热门视频列表
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
获取稿件状态数
type CommSetting ¶
type Comment ¶
type Comment struct {
RPID int64 `json:"rpid"` // 评论rpid
OID int64 `json:"oid"` // 评论区对象id
// 评论区类型代码
//
// https://github.com/SocialSisterYi/bilibili-API-collect/tree/master/comment#%E8%AF%84%E8%AE%BA%E5%8C%BA%E7%B1%BB%E5%9E%8B%E4%BB%A3%E7%A0%81
Type int `json:"type"`
MID int64 `json:"mid"` // 发送者mid
// 根评论rpid
//
// 若为一级评论则为0
//
// 大于一级评论则为根评论id
Root int64 `json:"root"`
// 回复父评论rpid
//
// 若为一级评论则为0
//
// 若为二级评论则为根评论id
//
// 大于二级评论为上一级评论id
Parent int64 `json:"parent"`
// 回复对方rpid
//
// 若为一级评论则为0
//
// 若为二级评论则为该评论id
//
// 大于二级评论为上一级评论id
Dialog int64 `json:"dialog"`
Count int `json:"count"` // 二级评论条数
Rcount int `json:"rcount"` // 回复评论条数
Floor int `json:"floor,omitempty"` // 评论楼层号 若不支持楼层则无此项
State int `json:"state"` // 0 作用尚不明确
FansGrade int `json:"fansgrade"` // 是否具有粉丝标签 0:无 1:有
Attr int `json:"attr"` // 属性位
Ctime int64 `json:"ctime"` // 评论发送时间 时间戳
RpidStr string `json:"rpid_str"` // 评论rpid 字串格式
RootStr string `json:"root_str"` // 根评论rpid 字串格式
ParentStr string `json:"parent_str"` // 回复父评论rpid 字串格式
Like int `json:"like"` // 评论获赞数
// 当前用户操作状态 需要登录(Cookie或APP)
//
// 否则恒为0
//
// 0:无
//
// 1:已点赞
//
// 2:已点踩
Action int `json:"action"`
Member CommentMember `json:"member"` // 评论发送者信息
Content struct {
Message string `json:"message"` // 评论内容
// 评论发送端
//
// 1:web端
//
// 2:安卓客户端
//
// 3:ios客户端
//
// 4:wp客户端
Plat int `json:"plat"`
Device string `json:"device"` // 评论发送平台设备
Members []*CommentMember `json:"members"` // at到的用户信息
Emote map[string]struct {
ID int64 `json:"id"`
PackageID int64 `json:"package_id"`
Status int `json:"status"`
Type int `json:"type"`
Attr int `json:"attr"`
Text string `json:"text"`
URL string `json:"url"`
Meta struct {
Size int `json:"size"`
Alias string `json:"alias"`
} `json:"meta"`
Mtime int64 `json:"mtime"`
} `json:"emote"` // 需要渲染的表情转义 评论内容无表情则无此项
JumpURL map[string]struct {
Title string `json:"title"` // 标题
State int `json:"state"`
PrefixIcon string `json:"prefixIcon"` // 图标url
AppURLSchema string `json:"appUrlSchema"`
AppName string `json:"appName"`
AppPackageName string `json:"appPackageName"`
ClickReport string `json:"clickReport"`
} `json:"jump_url"` // 需要高亮的超链转义
MaxLine int `json:"max_line"` // 6 收起最大行数
} `json:"content"` // 评论信息
Replies []*Comment `json:"replies"` // 评论回复条目预览 仅嵌套一层 否则为null
Assist int `json:"assist"`
Folder struct {
HasFolded bool `json:"has_folded"` // 是否有被折叠的二级评论
IsFolded bool `json:"is_folded"` // 评论是否被折叠
Rule string `json:"rule"` // 相关规则页面url
} `json:"folder"` // 折叠信息
UpAction struct {
Like bool `json:"like"` // 是否UP主觉得很赞
Reply bool `json:"reply"` // 是否被UP主回复
} `json:"up_action"` // 评论UP主操作信息
ShowFollow bool `json:"show_follow"`
Invisible bool `json:"invisible"`
ReplyControl struct {
} `json:"reply_control"` // 未知
}
type CommentMain ¶
type CommentMain struct {
Cursor struct {
AllCount int `json:"all_count"` // 全部评论条数
IsBegin bool `json:"is_begin"` // 是否为第一页
Prev int `json:"prev"` // 上页页码
Next int `json:"next"` // 下页页码
IsEnd bool `json:"is_end"` // 是否为最后页
Mode int `json:"mode"` // 排序方式
ShowType int `json:"show_type"` // 1
SupportMode []int `json:"support_mode"` // 支持的排序方式
Name string `json:"name"` // 评论区类型名
} `json:"cursor"` // 游标信息
Hots []*Comment // 热评列表
Notice struct {
Content string `json:"content"` // 公告正文
ID int64 `json:"id"` // 公告id
Link string `json:"link"` // 公告页面链接url
Title string `json:"title"` // 公告标题
} `json:"notice"` // 评论区公告信息
Replies []*Comment // 评论列表
Top struct {
Admin *Comment `json:"admin"`
Upper *Comment `json:"upper"`
Vote *Comment `json:"vote"`
} `json:"top"` // 置顶评论
Folder struct {
HasFolded bool `json:"has_folded"`
IsFolded bool `json:"is_folded"`
Rule string `json:"rule"`
} `json:"folder"` // 评论折叠信息
Assist int `json:"assist"` // 0
Blacklist int `json:"blacklist"` // 0
Vote int `json:"vote"` // 0
Lottery int `json:"lottery"` // 0
Config struct {
ShowAdmin int `json:"showadmin"`
ShowEntry int `json:"showentry"`
ShowFloor int `json:"showfloor"`
ShowTopic int `json:"showtopic"`
ShowUpFlag bool `json:"show_up_flag"`
ReadOnly bool `json:"read_only"`
ShowDelLog bool `json:"show_del_log"`
} `json:"config"` // 评论区显示控制
Upper struct {
MID int64 `json:"mid"`
} `json:"upper"` // UP主信息
ShowBvid bool `json:"show_bvid"`
Control struct {
InputDisable bool `json:"input_disable"` // 禁止评论?
RootInputText string `json:"root_input_text"` // 评论框文字
ChildInputText string `json:"child_input_text"` // 评论框文字
GiveUpInputText string `json:"giveup_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
ShowType int `json:"show_type"`
ShowText string `json:"show_text"`
} `json:"control"`
}
type CommentMember ¶
type CommentMember struct {
MID string `json:"mid"` // 发送者mid
Uname string `json:"uname"` // 发送者昵称
Sex string `json:"sex"` // 发送者性别 男 女 保密
Sign string `json:"sign"` // 发送者签名
Avatar string `json:"avatar"` // 发送者头像
Rank string `json:"rank"` // 10000
DisplayRank string `json:"DisplayRank"`
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
} `json:"level_info"` // 发送者等级
Pendant struct {
PID int64 `json:"pid"` // 头像框id
Name string `json:"name"` // 头像框名称
Image string `json:"image"` // 头像框图片url
Expire int `json:"expire"` // 0
ImageEnhance string `json:"image_enhance"` // 头像框图片url
ImageEnhanceFrame string `json:"image_enhance_frame"`
} `json:"pendant"` // 发送者头像框信息
Nameplate struct {
NID int `json:"nid"` // 勋章id
Name string `json:"name"` // 勋章名称
Image string `json:"image"` // 挂件图片url
ImageSmall string `json:"image_small"` // 勋章图片url 小
Level string `json:"level"` // 勋章等级
Condition string `json:"condition"` // 勋章条件
} `json:"nameplate"` // 发送者勋章信息
OfficialVerify struct {
// 是否认证
//
// -1:无
//
// 0:个人认证
//
// 1:机构认证
Type int `json:"type"`
Desc string `json:"desc"` // 认证信息
} `json:"official_verify"` // 发送者认证信息
Vip struct {
// 大会员类型
//
// 0:无
//
// 1:月会员
//
// 2:年以上会员
VipType int `json:"vipType"`
VipDueDate int64 `json:"vipDueDate"` // 大会员到期时间 毫秒 时间戳
DueRemark string `json:"dueRemark"`
AccessStatus int `json:"accessStatus"`
VipStatus int `json:"vipStatus"` // 大会员状态 0:无 1:有
VipStatusWarn string `json:"vipStatusWarn"`
ThemeType int `json:"themeType"` // 会员样式id
Label struct {
Path string `json:"path"`
Text string `json:"text"` // 会员类型文案
// 会员类型
//
// vip:大会员
//
// annual_vip:年度大会员
//
// ten_annual_vip:十年大会员
//
// hundred_annual_vip:百年大会员
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"`
} `json:"vip"` // 发送者会员信息
FansDetail struct {
UID int64 `json:"uid"` // 用户mid
MedalID int64 `json:"medal_id"` // 粉丝标签id
MedalName string `json:"medal_name"` // 粉丝标签名
Score int `json:"score"` // 0
Level int `json:"level"` // 当前标签等级
Intimacy int `json:"intimacy"` // 0
MasterStatus int `json:"master_status"` // 1
IsReceive int `json:"is_receive"` // 1
} `json:"fans_detail"` // 发送者粉丝标签
// 是否关注该用户 需要登录(Cookie或APP) 否则恒为0
//
// 0:未关注
//
// 1:已关注
Following int `json:"following"`
// 是否被该用户关注 需要登录(Cookie或APP) 否则恒为0
//
// 0:未关注
//
// 1:已关注
IsFollowed int `json:"is_followed"`
UserSailing struct {
Pendant struct {
ID int64 `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
JumpURL string `json:"jump_url"`
Type string `json:"type"`
} `json:"pendant"` // 头像框信息
Cardbg struct {
ID int64 `json:"id"` // 评论条目装扮id
Name string `json:"name"` // 评论条目装扮名称
Image string `json:"image"` // 评论条目装扮图片url
JumpURL string `json:"jump_url"` // 评论条目装扮商城页面url
Fan struct {
IsFan int `json:"is_fan"` // 是否为粉丝专属装扮 0:否 1:是
Number int64 `json:"number"` // 粉丝专属编号
Color string `json:"color"` // 数字颜色 颜色码
Name string `json:"name"` // 装扮名称
NumDesc string `json:"num_desc"` // 粉丝专属编号 字串格式
} `json:"fan"` // 粉丝专属信息
// 装扮类型
//
// suit:一般装扮
//
// vip_suit:vip装扮
Type string `json:"type"`
} `json:"cardbg"` // 评论卡片装扮
CardbgWithFocus interface{} `json:"cardbg_with_focus"` // 作用尚不明确
} `json:"user_sailing"` // 发送者评论条目装扮信息
IsContractor bool `json:"is_contractor"` // 是否为合作用户?
ContractDesc string `json:"contract_desc"` // 合作者信息
}
type CommentReply ¶
type CommentReply struct {
Config struct {
ShowAdmin int `json:"showadmin"`
ShowEntry int `json:"showentry"`
ShowFloor int `json:"showfloor"`
Showtopic int `json:"showtopic"`
ShowUpFlag bool `json:"show_up_flag"`
ReadOnly bool `json:"read_only"`
ShowDelLog bool `json:"show_del_log"`
} `json:"config"`
Control struct {
InputDisable bool `json:"input_disable"`
RootInputText string `json:"root_input_text"`
ChildInputText string `json:"child_input_text"`
GiveUpInputText string `json:"giveup_input_text"`
BgText string `json:"bg_text"`
WebSelection bool `json:"web_selection"`
AnswerGuideText string `json:"answer_guide_text"`
AnswerGuideIconURL string `json:"answer_guide_icon_url"`
AnswerGuideIosURL string `json:"answer_guide_ios_url"`
AnswerGuideAndroidURL string `json:"answer_guide_android_url"`
ShowType int `json:"show_type"`
ShowText string `json:"show_text"`
} `json:"control"`
Page struct {
Count int `json:"count"`
Num int `json:"num"`
Size int `json:"size"`
} `json:"page"`
Root Comment `json:"root"`
Replies []*Comment `json:"replies"`
ShowBvid bool `json:"show_bvid"`
ShowText string `json:"show_text"`
ShowType int `json:"show_type"`
Upper struct {
MID int64 `json:"mid"`
} `json:"upper"`
}
type CommentSend ¶
type CommentSend struct {
SuccessAction int `json:"success_action"` // 0
SuccessToast string `json:"success_toast"` // 状态文字
NeedCaptcha bool `json:"need_captcha"` // 评论需要验证码
NeedCaptchaV2 bool `json:"need_captcha_v2"` // 评论需要验证码v2
URL string `json:"url"`
URLV2 string `json:"url_v2"`
RPID int64 `json:"rpid"` // 评论rpid
RpidStr string `json:"rpid_str"` // 评论rpid4
// 回复对方rpid
//
// 若为一级评论则为0
//
// 若为二级评论则为该评论id
//
// 大于二级评论为上一级评论id
Dialog int64 `json:"dialog"`
DialogStr string `json:"dialog_str"`
// 根评论rpid
//
// 若为一级评论则为0
//
// 大于一级评论则为根评论id
Root int64 `json:"root"`
RootStr string `json:"root_str"`
// 回复父评论rpid
//
// 若为一级评论则为0
//
// 若为二级评论则为根评论id
//
// 大于二级评论为上一级评论id
Parent int64 `json:"parent"`
ParentStr string `json:"parent_str"`
Reply *Comment `json:"reply"`
}
type CookieAuth ¶
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 DanmakuPostResult ¶
type DanmakuResp ¶
type DanmakuResp struct {
Danmaku []*Danmaku `json:"danmaku"`
}
type DynaDraft ¶
type DynaDraft struct {
DraftID int64 `json:"draft_id"` // 定时发布ID
UID int64 `json:"uid"` // mid
Type int `json:"type"` // 未知
PublishTime int64 `json:"publish_time"` // 指定发布时间
Request json.RawMessage `json:"request"` // 动态信息,不同动态类型内容不同,请根据需要自行提取
UpdateTime int64 `json:"update_time"` // 动态更新时间
PublishStatus int `json:"publish_status"` // 发布状态 0:未发布 3:错误?
ErrorCode int `json:"error_code"` // 动态错误码 0:无错误 500003:系统错误
ErrorMsg string `json:"error_msg"` // 动态错误描述
UserProfile *struct {
Info *struct {
UID int64 `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 int `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"`
} `json:"label"`
AvatarSubscript int `json:"avatar_subscript"`
NicknameColor string `json:"nickname_color"`
} `json:"vip"`
Pendant *struct {
PID int64 `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"` // 动态作者各种信息
}
type DynaGetDraft ¶
type DynaGetDraft struct {
Drafts []*DynaDraft `json:"drafts"`
}
type DynaUploadPic ¶
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 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 ExpRewardStat ¶
type ExpRewardStat struct {
Login bool `json:"login"` // 每日登录 5经验
Watch bool `json:"watch"` // 每日观看 5经验
Coins int `json:"coins"` // 每日投币所奖励的经验 上限50经验 该值更新存在延迟 想要无延迟请使用 GetExpCoinRewardStat
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 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 FavoritesList ¶
type FollowingsDetail ¶
type FollowingsDetail struct {
ReVersion int `json:"re_version"` // 0
Total int `json:"total"` // 关注总数
List []*FollowingsItem `json:"list"` // 关注详细信息
}
type FollowingsItem ¶
type FollowingsItem struct {
MID int64 `json:"mid"` // mid
Attribute int `json:"attribute"` // 属性值
Mtime int64 `json:"mtime"` // 关注时间
Tag []string `json:"tag,omitempty"`
Special int `json:"special"`
ContractInfo *struct {
IsContractor bool `json:"is_contractor"`
TS int `json:"ts"`
IsContract bool `json:"is_contract"`
UserAttr int `json:"user_attr"`
} `json:"contract_info"`
Uname string `json:"uname"` // 昵称
Face string `json:"face"` // 头像
Sign string `json:"sign"` // 个人签名
OfficialVerify *struct {
Type int `json:"type"`
Desc string `json:"desc"`
} `json:"official_verify"` // 认证信息
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"`
Text string `json:"text"`
LabelTheme string `json:"label_theme"`
TextColor string `json:"text_color"`
BgStyle int `json:"bg_style"`
BgColor string `json:"bg_color"`
BorderColor string `json:"border_color"`
} `json:"label"`
AvatarSubscript int `json:"avatar_subscript"`
NicknameColor string `json:"nickname_color"`
AvatarSubscriptURL string `json:"avatar_subscript_url"`
} `json:"vip"` // VIP信息
}
type GenerateQrcodeInfo ¶
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 LiveAllGiftInfo ¶
type LiveAllGiftInfo struct {
List []*struct {
ID int `json:"id"`
Name string `json:"name"`
Price int `json:"price"`
Type int `json:"type"`
CoinType string `json:"coin_type"`
BagGift int `json:"bag_gift"`
Effect int `json:"effect"`
CornerMark string `json:"corner_mark"`
CornerBackground string `json:"corner_background"`
Broadcast int `json:"broadcast"`
Draw int `json:"draw"`
StayTime int `json:"stay_time"`
AnimationFrameNum int `json:"animation_frame_num"`
Desc string `json:"desc"`
Rule string `json:"rule"`
Rights string `json:"rights"`
PrivilegeRequired int `json:"privilege_required"`
CountMap []*struct {
Num int `json:"num"`
Text string `json:"text"`
WebSvga string `json:"web_svga"`
VerticalSvga string `json:"vertical_svga"`
HorizontalSvga string `json:"horizontal_svga"`
SpecialColor string `json:"special_color"`
EffectID int `json:"effect_id"`
} `json:"count_map"`
ImgBasic string `json:"img_basic"`
ImgDynamic string `json:"img_dynamic"`
FrameAnimation string `json:"frame_animation"`
GIF string `json:"gif"`
Webp string `json:"webp"`
FullScWeb string `json:"full_sc_web"`
FullScHorizontal string `json:"full_sc_horizontal"`
FullScVertical string `json:"full_sc_vertical"`
FullScHorizontalSvga string `json:"full_sc_horizontal_svga"`
FullScVerticalSvga string `json:"full_sc_vertical_svga"`
BulletHead string `json:"bullet_head"`
BulletTail string `json:"bullet_tail"`
LimitInterval int `json:"limit_interval"`
BindRUID int `json:"bind_ruid"`
BindRoomID int `json:"bind_roomid"`
GiftType int `json:"gift_type"`
ComboResourcesID int `json:"combo_resources_id"`
MaxSendLimit int `json:"max_send_limit"`
Weight int `json:"weight"`
GoodsID int `json:"goods_id"`
HasImagedGift int `json:"has_imaged_gift"`
LeftCornerText string `json:"left_corner_text"`
LeftCornerBackground string `json:"left_corner_background"`
GiftBanner struct {
AppPic string `json:"app_pic"`
WebPic string `json:"web_pic"`
LeftText string `json:"left_text"`
LeftColor string `json:"left_color"`
ButtonText string `json:"button_text"`
ButtonColor string `json:"button_color"`
ButtonPicColor string `json:"button_pic_color"`
JumpURL string `json:"jump_url"`
JumpTo int `json:"jump_to"`
WebPicURL string `json:"web_pic_url"`
WebJumpURL string `json:"web_jump_url"`
} `json:"gift_banner"`
DiyCountMap int `json:"diy_count_map"`
EffectID int `json:"effect_id"`
} `json:"list"`
ComboResources []*struct {
ComboResourcesId int `json:"combo_resources_id"`
ImgOne string `json:"img_one"`
ImgTwo string `json:"img_two"`
ImgThree string `json:"img_three"`
ImgFour string `json:"img_four"`
ColorOne string `json:"color_one"`
ColorTwo string `json:"color_two"`
} `json:"combo_resources"`
GuardResources []*struct {
Level int `json:"level"`
Img string `json:"img"`
Name string `json:"name"`
} `json:"guard_resources"`
}
type LiveAreaInfo ¶
type LiveAreaInfo struct {
ID int `json:"id"`
Name string `json:"name"`
List []*struct {
ID string `json:"id"`
ParentID string `json:"parent_id"`
OldAreaID string `json:"old_area_id"`
Name string `json:"name"`
ActID string `json:"act_id"`
PkStatus string `json:"pk_status"`
HotStatus int `json:"hot_status"`
LockStatus string `json:"lock_status"`
Pic string `json:"pic"`
ComplexAreaName string `json:"complex_area_name"`
ParentName string `json:"parent_name"`
AreaType int `json:"area_type"`
CateID string `json:"cate_id,omitempty"`
} `json:"list"`
}
type LiveGuardList ¶
type LiveGuardList struct {
Info *struct {
Num int `json:"num"` // 大航海总数
Page int `json:"page"` // 总页数
Now int `json:"now"` // 该次请求的页数
AchievementLevel int `json:"achievement_level"`
} `json:"info"`
List []*struct {
UID int64 `json:"uid"`
RUID int64 `json:"ruid"` // 主播mid
Rank int `json:"rank"` // 在该数组中的排名
Username string `json:"username"`
Face string `json:"face"`
IsAlive int `json:"is_alive"`
GuardLevel int `json:"guard_level"` // 1:总督 2:提督 3:舰长
GuardSubLevel int `json:"guard_sub_level"`
} `json:"list"`
Top3 []*struct {
UID int `json:"uid"`
RUID int `json:"ruid"` // 主播mid
Rank int `json:"rank"` // 在该数组中的排名
Username string `json:"username"`
Face string `json:"face"`
IsAlive int `json:"is_alive"`
GuardLevel int `json:"guard_level"` // 1:总督 2:提督 3:舰长
GuardSubLevel int `json:"guard_sub_level"`
} `json:"top3"`
}
type LiveMedalRank ¶
type LiveMedalRank struct {
Medal struct {
Status int `json:"status"`
} `json:"medal"`
List []*struct {
UID int64 `json:"uid"` // mid
Uname string `json:"uname"` // 昵称
Face string `json:"face"` // 头像url
Rank int `json:"rank"` // 排名
MedalName string `json:"medal_name"` // 勋章名字
Level int `json:"level"` // 勋章等级
Color int64 `json:"color"` // 勋章颜色
TargetID int64 `json:"target_id"` // 主播mid
Special string `json:"special"`
IsSelf int `json:"isSelf"`
GuardLevel int `json:"guard_level"` // 1:总督 2:提督 3:舰长
MedalColorStart int64 `json:"medal_color_start"`
MedalColorEnd int64 `json:"medal_color_end"`
MedalColorBorder int64 `json:"medal_color_border"`
IsLighted int `json:"is_lighted"`
} `json:"list"`
}
type LivePlayURL ¶
type LivePlayURL struct {
CurrentQn int `json:"current_qn"`
QualityDescription []*struct {
Qn int `json:"qn"`
Desc string `json:"desc"`
} `json:"quality_description"` // 清晰度列表
DURL []*struct {
URL string `json:"url"`
Length int `json:"length"`
Order int `json:"order"`
StreamType int `json:"stream_type"`
PTag int `json:"ptag"`
P2PType int `json:"p2p_type"`
} `json:"durl"`
IsDashAuto bool `json:"is_dash_auto"`
}
type LiveRoomInfoByID ¶
type LiveRoomInfoByID struct {
RoomID int64 `json:"room_id"` // 真实直播间ID
ShortID int `json:"short_id"` // 短号
UID int64 `json:"uid"` // 主播mid
NeedP2P int `json:"need_p2p"` // 需要P2P
IsHidden bool `json:"is_hidden"` // 直播间是否隐藏
IsLocked bool `json:"is_locked"` // 直播间是否被封锁
IsPortrait bool `json:"is_portrait"` // 是否为竖屏直播间
LiveStatus int `json:"live_status"` // 0:未开播 1:开播
HiddenTill int64 `json:"hidden_till"` // 隐藏截止时间戳?
LockTill int64 `json:"lock_till"` // 封锁截止时间戳?
Encrypted bool `json:"encrypted"` // 直播间是否加密
PwdVerified bool `json:"pwd_verified"` // 直播间是否需要密码验证
LiveTime int64 `json:"live_time"` // 开播时间,-1为未开播
RoomShield int `json:"room_shield"`
IsSp int `json:"is_sp"`
SpecialType int `json:"special_type"`
AllSpecialTypes []int `json:"all_special_types"`
}
type LiveRoomInfoByMID ¶
type LiveRoomInfoByMID 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(真实ID)
BroadcastType int `json:"broadcast_type"` // 0
OnlineHidden int `json:"online_hidden"` // 已废弃
}
type LiveWsConf ¶
type LiveWsConf struct {
RefreshRowFactor float64 `json:"refresh_row_factor"`
RefreshRate int `json:"refresh_rate"`
MaxDelay int `json:"max_delay"`
Port int `json:"port"`
Host string `json:"host"`
HostServerList []*struct {
Host string `json:"host"`
Port int `json:"port"`
WssPort int `json:"wss_port"`
WsPort int `json:"ws_port"`
} `json:"host_server_list"`
ServerList []*struct {
Host string `json:"host"`
Port int `json:"port"`
} `json:"server_list"`
Token string `json:"token"`
}
type NavInfoLevel ¶
type NavInfoLevel struct {
}
type NavInfoOfficial ¶
type NavInfoOfficial struct {
// 认证类型
//
// 0:无
//
// 1 2 7:个人认证
//
// 3 4 5 6:机构认证
}
type NavInfoOfficialVerify ¶
type NavInfoOfficialVerify struct {
}
type NavInfoPendant ¶
type NavInfoPendant struct {
}
type NavInfoVipLabel ¶
type NavInfoVipLabel struct {
//
// vip:大会员
//
// annual_vip:年度大会员
//
// ten_annual_vip:十年大会员
//
// hundred_annual_vip:百年大会员
LabelTheme string `json:"label_theme"`
}
type NavInfoWallet ¶
type NavInfoWallet struct {
}
type PopularVideoList ¶
type PopularVideoList struct {
Aid int64 `json:"aid"`
Bvid string `json:"bvid"`
Cid int64 `json:"cid"`
Copyright int64 `json:"copyright"`
Ctime int64 `json:"ctime"`
Desc string `json:"desc"`
Dimension struct {
Height int64 `json:"height"`
Rotate int64 `json:"rotate"`
Width int64 `json:"width"`
} `json:"dmension"`
Duration int64 `json:"duration"`
Dynamic string `json:"dynamic"`
FirstFrame string `json:"first_frame"`
IsOgv bool `json:"is_ogv"`
MissionID int64 `json:"mission_id"`
OgvInfo interface{} `json:"ogv_info"`
Owner struct {
Face string `json:"face"`
Mid int64 `json:"mid"`
Name string `json:"name"`
} `json:"owner"`
Pic string `json:"pic"`
PubLocation string `json:"pub_location"`
Pubdate int64 `json:"pubdate"`
RcmdReason struct {
Content string `json:"content"`
CornerMark int64 `json:"corner_mark"`
} `json:"rcmd_reason"`
Rights struct {
ArcPay int64 `json:"arc_pay"`
Autoplay int64 `json:"autoplay"`
Bp int64 `json:"bp"`
Download int64 `json:"download"`
Elec int64 `json:"elec"`
Hd5 int64 `json:"hd5"`
IsCooperation int64 `json:"is_cooperation"`
Movie int64 `json:"movie"`
NoBackground int64 `json:"no_background"`
NoReprint int64 `json:"no_reprint"`
Pay int64 `json:"pay"`
PayFreeWatch int64 `json:"pay_free_watch"`
UgcPay int64 `json:"ugc_pay"`
UgcPayPreview int64 `json:"ugc_pay_preview"`
} `json:"rights"`
SeasonID int64 `json:"season_id"`
SeasonType int64 `json:"season_type"`
ShortLink string `json:"short_link"`
ShortLinkV2 string `json:"short_link_v2"`
Stat struct {
Aid int64 `json:"aid"`
Coin int64 `json:"coin"`
Danmaku int64 `json:"danmaku"`
Dislike int64 `json:"dislike"`
Favorite int64 `json:"favorite"`
HisRank int64 `json:"his_rank"`
Like int64 `json:"like"`
NowRank int64 `json:"now_rank"`
Reply int64 `json:"reply"`
Share int64 `json:"share"`
View int64 `json:"view"`
} `json:"stat"`
State int64 `json:"state"`
Tid int64 `json:"tid"`
Title string `json:"title"`
Tname string `json:"tname"`
UpFromV2 int64 `json:"up_from_v2"`
Videos int64 `json:"videos"`
}
type PopularVideoLists ¶
type PopularVideoLists struct {
List []PopularVideoList `json:"list"`
NoMore bool `json:"no_more"`
}
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 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 ScanQrcode ¶
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 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 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 SpaceVideo ¶
type SpaceVideoCoin ¶
type SpaceVideoSearchList ¶
type SpaceVideoSearchList struct {
Tlist map[string]*SpaceVideoSearchTList `json:"tlist"` // 投稿视频分区索引 key为tid字符串形式,value为详细信息
Vlist []*SpaceVideoSearchVList `json:"vlist"` // 投稿视频列表
}
type SpaceVideoSearchPage ¶
type SpaceVideoSearchResult ¶
type SpaceVideoSearchResult struct {
List *SpaceVideoSearchList `json:"list"` // 列表信息
Page *SpaceVideoSearchPage `json:"page"` // 页面信息
EpisodicButton *SpaceVideoSearchEpisodicButton `json:"episodic_button"` // “播放全部“按钮
}
type SpaceVideoSearchTList ¶
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 UserInfo ¶
type UserInfo struct {
MID int64 `json:"mid"` // mid
Name string `json:"name"` // 昵称
Sex string `json:"sex"` // 性别 男/女/保密
Face string `json:"face"` // 头像链接
Sign string `json:"sign"` // 签名
Rank int `json:"rank"` // 10000
Level int `json:"level"` // 当前等级 0-6级
JoinTime int64 `json:"jointime"` // 0
Moral int `json:"moral"` // 0
Silence int `json:"silence"` // 封禁状态 0:正常 1:被封
// 硬币数 需要登录(Cookie)
//
// 只能查看自己的
//
// 默认为0
Coins float32 `json:"coins"`
FansBadge bool `json:"fans_badge"` // 是否具有粉丝勋章 false:无 true:有
Official 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:认证
} `json:"official"`
Vip struct {
// 会员类型
//
// 0:无
//
// 1:月大会员
//
// 2:年度及以上大会员
Type int `json:"type"`
Status int `json:"status"` // 会员状态 0:无 1:有
DueDate int64 `json:"due_date"` // 会员过期时间 Unix时间戳(毫秒)
VipPayType int `json:"vip_pay_type"` // 支付类型?
ThemeType int `json:"theme_type"` // 0
Label struct {
Path string `json:"path"` //
Text string `json:"text"` // 会员类型文案
// 会员标签
//
// vip:大会员
//
// annual_vip:年度大会员
//
// ten_annual_vip:十年大会员
//
// hundred_annual_vip:百年大会员
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"` // 是否显示会员图标 0:不显示 1:显示
NicknameColor string `json:"nickname_color"` // 会员昵称颜色 颜色码
Role int `json:"role"` //
AvatarSubscriptUrl string `json:"avatar_subscript_url"` // 会员图标url
} `json:"vip"` //
Pendant struct {
PID int64 `json:"pid"` // 头像框id
Name string `json:"name"` // 头像框名称
Image string `json:"image"` // 头像框图片url
Expire int64 `json:"expire"` // 0
ImageEnhance string `json:"image_enhance"` //
ImageEnhanceFrame string `json:"image_enhance_frame"` //
} `json:"pendant"` //
Nameplate struct {
NID int `json:"nid"` // 勋章id
Name string `json:"name"` // 勋章名称
Image string `json:"image"` // 挂件图片url 正常
ImageSmall string `json:"image_small"` // 勋章图片url 小
Level string `json:"level"` // 勋章等级
Condition string `json:"condition"` // 勋章条件
} `json:"nameplate"` //
// 是否关注此用户 true:已关注 false:未关注
//
// 需要登录(Cookie)
//
// 未登录恒为false
IsFollowed bool `json:"is_followed"` //
TopPhoto string `json:"top_photo"` // 主页头图链接
SysNotice struct {
// 系统提示类型id
//
// 8:争议账号
//
// 20:纪念账号
//
// 22:合约诉讼
ID int `json:"id"`
Content string `json:"content"` // 提示文案
URL string `json:"url"` // 提示信息页面url
NoticeType int `json:"notice_type"` //
Icon string `json:"icon"` // 提示图标url
TextColor string `json:"text_color"` // 提示文字颜色
BgColor string `json:"bg_color"` // 提示背景颜色
} `json:"sys_notice"` //
LiveRoom 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(真实ID)
BroadcastType int `json:"broadcast_type"` // 0
OnlineHidden int `json:"online_hidden"` // 已废弃
} `json:"live_room"` //
Birthday string `json:"birthday"` // 生日 MM-DD 如设置隐私为空
School struct {
Name string `json:"name"` // 就读大学名称
} `json:"school"` //
Profession struct {
Name string `json:"name"` //
} `json:"profession"` //
Series struct {
UserUpgradeStatus int `json:"user_upgrade_status"` //
ShowUpgradeWindow bool `json:"show_upgrade_window"` //
} `json:"series"` //
}
type VideoDimension ¶
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 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 VideoPlayURLFormat ¶
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"` // 投币枚数
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 VideoStaffVIP ¶
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"` // 投币枚数
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 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 ¶
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 作用尚不明确
}
