Documentation
¶
Index ¶
- Variables
- func CleanFavourResources(mediaId int) error
- func CoinArticle(id, upid, multiply int) (bool, error)
- func CoinVideoByAvid(avid int, multiply int, like bool) (bool, error)
- func CoinVideoByBvid(bvid string, multiply int, like bool) (bool, error)
- func CoinVideoByShortUrl(shortUrl string, multiply int, like bool) (bool, error)
- func CopyFavourResources(srcMediaId, tarMediaId, mid int, resources []Resource, platform string) error
- func CreateDynamic(content, extension string, atUids []int, ctrl []*FormatCtrl) (dynamicId int, err error)
- func DeleteFavourFolder(mediaIds []int) error
- func DeleteFavourResources(mediaId int, resources []Resource, platform string) error
- func FavourArticle(id int) error
- func FavourVideoByAvid(avid int, addMediaIds, delMediaIds []int) (bool, error)
- func FavourVideoByBvid(bvid string, addMediaIds, delMediaIds []int) (bool, error)
- func FavourVideoByShortUrl(shortUrl string, addMediaIds, delMediaIds []int) (bool, error)
- func GetBvidByShortUrl(shortUrl string) (string, error)
- func GetCookies() []*http.Cookie
- func GetCookiesString() string
- func GetLogger() resty.Logger
- func GetRoomidByShortUrl(shortUrl string) (int, error)
- func GetTimeout() time.Duration
- func GetVideoDescByAvid(avid int) (string, error)
- func GetVideoDescByBvid(bvid string) (string, error)
- func GetVideoDescByShortUrl(shortUrl string) (string, error)
- func HateVideoTag(avid, tagId int) error
- func LikeArticle(id int, like bool) error
- func LikeVideoByAvid(avid int, like bool) error
- func LikeVideoByBvid(bvid string, like bool) error
- func LikeVideoByShortUrl(shortUrl string, like bool) error
- func LikeVideoTag(avid, tagId int) error
- func ListCountry() (common []CountryInfo, others []CountryInfo, err error)
- func LoginWithPassword(userName, password string, captchaResult *CaptchaResult, ...) error
- func LoginWithQRCode(qrCode *QRCode) error
- func LoginWithSMS(tel, cid, code int, captchaKey string) error
- func MoveFavourResources(srcMediaId, tarMediaId, mid int, resources []Resource, platform string) error
- func ReceiveVipPrivilege(privilegeType int) error
- func RemoveDynamic(dynamicId int) error
- func SendPrivateMessageImage(senderUid, receiverId int, url string) (int, string, error)
- func SendPrivateMessageRecall(senderUid, receiverId, msgKey int) (int, string, error)
- func SendPrivateMessageText(senderUid, receiverId int, content string) (int, string, error)
- func SendSMS(tel, cid int, captchaResult *CaptchaResult, validate, seccode string) (captchaKey string, err error)
- func SetCookies(cookies []*http.Cookie)
- func SetCookiesString(cookiesString string)
- func SetLogger(logger resty.Logger)
- func SetTimeout(timeout time.Duration)
- func SignVipScore() error
- func StopLive(roomId int) (bool, error)
- func UpdateLive(roomId int, title string) error
- type AccountInformation
- type AllFavourFolderInfo
- type ArchivesList
- type Article
- type ArticleViewInfo
- type ArticlesInfo
- type CaptchaResult
- type Client
- func (c *Client) AddFavourFolder(title, intro string, privacy bool, cover string) (*FavourFolderInfo, error)
- func (c *Client) Captcha() (*CaptchaResult, error)
- func (c *Client) CleanFavourResources(mediaId int) error
- func (c *Client) CoinArticle(id, upid, multiply int) (bool, error)
- func (c *Client) CoinVideoByAvid(avid int, multiply int, like bool) (bool, error)
- func (c *Client) CoinVideoByBvid(bvid string, multiply int, like bool) (bool, error)
- func (c *Client) CoinVideoByShortUrl(shortUrl string, multiply int, like bool) (bool, error)
- func (c *Client) CopyFavourResources(srcMediaId, tarMediaId, mid int, resources []Resource, platform string) error
- func (c *Client) CreateDynamic(content, extension string, atUids []int, ctrl []*FormatCtrl) (dynamicId int, err error)
- func (c *Client) DeleteFavourFolder(mediaIds []int) error
- func (c *Client) DeleteFavourResources(mediaId int, resources []Resource, platform string) error
- func (c *Client) EditFavourFolder(mediaId int, title, intro string, privacy bool, cover string) (*FavourFolderInfo, error)
- func (c *Client) FavourArticle(id int) error
- func (c *Client) FavourVideoByAvid(avid int, addMediaIds, delMediaIds []int) (bool, error)
- func (c *Client) FavourVideoByBvid(bvid string, addMediaIds, delMediaIds []int) (bool, error)
- func (c *Client) FavourVideoByShortUrl(shortUrl string, addMediaIds, delMediaIds []int) (bool, error)
- func (c *Client) FetchDynamics(topicId int, topicName string, sortby, offset int) (*DynamicList, error)
- func (c *Client) GetAccountInformation() (*AccountInformation, error)
- func (c *Client) GetAllFavourFolderInfo(upMid, attrType, rid int) (*AllFavourFolderInfo, error)
- func (c *Client) GetArchivesList(mid int, sid int, pn int, ps int, sort_reverse bool) (*ArchivesList, error)
- func (c *Client) GetArticleViewInfo(id int) (*ArticleViewInfo, error)
- func (c *Client) GetArticlesInfo(id int) (*ArticlesInfo, error)
- func (c *Client) GetBvidByShortUrl(shortUrl string) (string, error)
- func (c *Client) GetCookies() []*http.Cookie
- func (c *Client) GetCookiesString() string
- func (c *Client) GetDynamicDetail(dynamicId int) (*DynamicDetail, error)
- func (c *Client) GetDynamicLikeList(dynamicId, offset int) (*DynamicLikeList, error)
- func (c *Client) GetDynamicLiveUserList(size int) (*DynamicLiveUserList, error)
- func (c *Client) GetDynamicPortal() (*DynamicPortal, error)
- func (c *Client) GetDynamicRepostDetail(dynamicId, offset int) (*DynamicRepostDetail, error)
- func (c *Client) GetDynamicUpList(size int) (*DynamicUpList, error)
- func (c *Client) GetFavourFolderInfo(mediaId int) (*FavourFolderInfo, error)
- func (c *Client) GetFavourIds(mediaId int, platform string) ([]*FavourId, error)
- func (c *Client) GetFavourInfo(resources []Resource, platform string) ([]*FavourInfo, error)
- func (c *Client) GetFavourList(mediaId, tid int, keyword, order string, searchType, ps, pn int, ...) (*FavourList, error)
- func (c *Client) GetLiveAreaList() ([]LiveAreaData, error)
- func (c *Client) GetLogger() resty.Logger
- func (c *Client) GetQRCode() (*QRCode, error)
- func (c *Client) GetRecommendVideoByAvid(avid int) ([]*VideoInfo, error)
- func (c *Client) GetRecommendVideoByBvid(bvid string) ([]*VideoInfo, error)
- func (c *Client) GetRoomInfo(roomId int) (*RoomInfo, error)
- func (c *Client) GetRoomidByShortUrl(shortUrl string) (int, error)
- func (c *Client) GetSessionMessages(talkerId, sessionType, size int, mobiApp string) (*SessionMessages, error)
- func (c *Client) GetSessions(sessionType int, mobiApp string) (*SessionList, error)
- func (c *Client) GetTimeout() time.Duration
- func (c *Client) GetTopRecommendVideo(freshType, ps int) ([]*VideoInfo, error)
- func (c *Client) GetTopicHistory(topicId int, topicName string, offsetDynamicId int) (*DynamicList, error)
- func (c *Client) GetUnreadMessage() (*UnreadMessage, error)
- func (c *Client) GetUnreadPrivateMessage() (*UnreadPrivateMessage, error)
- func (c *Client) GetUserArticleList(mid, pn, ps int, sort string) (*UserArticleList, error)
- func (c *Client) GetUserArticlesList(mid, sort int) (*UserArticlesList, error)
- func (c *Client) GetUserCard(mid int, photo bool) (*UserCardResult, error)
- func (c *Client) GetUserSpaceDynamic(mid int, offset string) (*DynamicInfo, error)
- func (c *Client) GetUserVideos(mid int, order OrderType, tid int, keyword string, pn int, ps int) (*GetUserVideosResult, error)
- func (c *Client) GetVideoComment(oidType, oid, sort, root int) (*HotReply, error)
- func (c *Client) GetVideoDescByAvid(avid int) (string, error)
- func (c *Client) GetVideoDescByBvid(bvid string) (string, error)
- func (c *Client) GetVideoDescByShortUrl(shortUrl string) (string, error)
- func (c *Client) GetVideoDetailInfoByAvid(avid int) (*VideoDetailInfo, error)
- func (c *Client) GetVideoDetailInfoByBvid(bvid string) (*VideoDetailInfo, error)
- func (c *Client) GetVideoDetailInfoByShortUrl(shortUrl string) (*VideoDetailInfo, error)
- func (c *Client) GetVideoInfoByAvid(avid int) (*VideoInfo, error)
- func (c *Client) GetVideoInfoByBvid(bvid string) (*VideoInfo, error)
- func (c *Client) GetVideoInfoByShortUrl(shortUrl string) (*VideoInfo, error)
- func (c *Client) GetVideoOnlineInfoByAvid(avid, cid int) (*VideoOnlineInfo, error)
- func (c *Client) GetVideoOnlineInfoByBvid(bvid string, cid int) (*VideoOnlineInfo, error)
- func (c *Client) GetVideoOnlineInfoByShortUrl(shortUrl string, cid int) (*VideoOnlineInfo, error)
- func (c *Client) GetVideoPageListByAvid(avid int) ([]*VideoPage, error)
- func (c *Client) GetVideoPageListByBvid(bvid string) ([]*VideoPage, error)
- func (c *Client) GetVideoPageListByShortUrl(shortUrl string) ([]*VideoPage, error)
- func (c *Client) GetVideoPbPInfo(cid int) (*VideoPbPInfo, error)
- func (c *Client) GetVideoStatusNumberByAvid(avid int) (*VideoStatusNumber, error)
- func (c *Client) GetVideoStatusNumberByBvid(bvid string) (*VideoStatusNumber, error)
- func (c *Client) GetVideoStatusNumberByShortUrl(shortUrl string) (*VideoStatusNumber, error)
- func (c *Client) GetVideoTagsByAvid(avid int) ([]*VideoTag, error)
- func (c *Client) GetVideoTagsByBvid(bvid string) ([]*VideoTag, error)
- func (c *Client) GetVideoTagsByShortUrl(shortUrl string) ([]*VideoTag, error)
- func (c *Client) GetVipCenterInfo() (*VipCenterInfo, error)
- func (c *Client) GetVipPrivilege() (*VipPrivilege, error)
- func (c *Client) HateVideoTag(avid, tagId int) error
- func (c *Client) LikeArticle(id int, like bool) error
- func (c *Client) LikeCoinFavourVideoByAvid(avid int) (*LikeCoinFavourResult, error)
- func (c *Client) LikeCoinFavourVideoByBvid(bvid string) (*LikeCoinFavourResult, error)
- func (c *Client) LikeCoinFavourVideoByShortUrl(shortUrl string) (*LikeCoinFavourResult, error)
- func (c *Client) LikeVideoByAvid(avid int, like bool) error
- func (c *Client) LikeVideoByBvid(bvid string, like bool) error
- func (c *Client) LikeVideoByShortUrl(shortUrl string, like bool) error
- func (c *Client) LikeVideoTag(avid, tagId int) error
- func (c *Client) ListCountry() (common []CountryInfo, others []CountryInfo, err error)
- func (c *Client) LoginWithPassword(userName, password string, captchaResult *CaptchaResult, ...) error
- func (c *Client) LoginWithQRCode(qrCode *QRCode) error
- func (c *Client) LoginWithSMS(tel, cid, code int, captchaKey string) error
- func (c *Client) MoveFavourResources(srcMediaId, tarMediaId, mid int, resources []Resource, platform string) error
- func (c *Client) ReceiveVipPrivilege(privilegeType int) error
- func (c *Client) RemoveDynamic(dynamicId int) error
- func (c *Client) SearchDynamicAt(uid int, keyword string) (*SearchDynamicAtResult, error)
- func (c *Client) SendPrivateMessageImage(senderUid, receiverId int, url string) (int, string, error)
- func (c *Client) SendPrivateMessageRecall(senderUid, receiverId, msgKey int) (int, string, error)
- func (c *Client) SendPrivateMessageText(senderUid, receiverId int, content string) (int, string, error)
- func (c *Client) SendSMS(tel, cid int, captchaResult *CaptchaResult, validate, seccode string) (captchaKey string, err error)
- func (c *Client) SetCookies(cookies []*http.Cookie)
- func (c *Client) SetCookiesString(cookiesString string)
- func (c *Client) SetLogger(logger resty.Logger)
- func (c *Client) SetTimeout(timeout time.Duration)
- func (c *Client) SignVipScore() error
- func (c *Client) StartLive(roomId, area int) (*StartLiveResult, error)
- func (c *Client) StopLive(roomId int) (bool, error)
- func (c *Client) UpdateLive(roomId int, title string) error
- func (c *Client) UploadDynamicBfs(fileName string, file io.Reader, category string) (url string, size Size, err error)
- type Comment
- type CountryInfo
- type DynamicCard
- type DynamicDetail
- type DynamicInfo
- type DynamicItem
- type DynamicLikeList
- type DynamicList
- type DynamicLiveUserList
- type DynamicPortal
- type DynamicRepostDetail
- type DynamicUpList
- type FavourFolderInfo
- type FavourId
- type FavourInfo
- type FavourList
- type FormatCtrl
- type GetUserVideosResult
- type GoodsSku
- type HotReply
- type LikeCoinFavourResult
- type LiveAreaData
- type NamePlate
- type OfficialInfo
- type OfficialVerify
- type OrderType
- type Pendant
- type QRCode
- type Resource
- type ResourceType
- type RoomInfo
- type SearchDynamicAtResult
- type SessionList
- type SessionMessages
- type Size
- type StartLiveResult
- type UnreadMessage
- type UnreadPrivateMessage
- type UpdateLiveResult
- type UserArticleList
- type UserArticlesList
- type UserCardResult
- type Video
- type VideoDetailInfo
- type VideoDimension
- type VideoInfo
- func GetRecommendVideoByAvid(avid int) ([]*VideoInfo, error)
- func GetRecommendVideoByBvid(bvid string) ([]*VideoInfo, error)
- func GetTopRecommendVideo(freshType, ps int) ([]*VideoInfo, error)
- func GetVideoInfoByAvid(avid int) (*VideoInfo, error)
- func GetVideoInfoByBvid(bvid string) (*VideoInfo, error)
- func GetVideoInfoByShortUrl(shortUrl string) (*VideoInfo, error)
- type VideoOnlineInfo
- type VideoPage
- type VideoPbPInfo
- type VideoStatusNumber
- type VideoTag
- type Vip
- type VipCenterInfo
- type VipPrivilege
Constants ¶
This section is empty.
Variables ¶
var ( ResourceTypeVideo ResourceType = 2 // 视频稿件 ResourceTypeAudio = 12 // 音频 ResourceTypeVideoList = 21 // 视频合集 )
Functions ¶
func CleanFavourResources ¶
CleanFavourResources 清空所有失效收藏内容
func CoinArticle ¶
CoinArticle 投币文章,id为文章cvid,upid为作者mid,mutiply为投币数量。返回的bool值为是否附加点赞成功,若已赞过则附加点赞失败
func CoinVideoByAvid ¶
CoinVideoByAvid 通过Avid投币视频,multiply为投币数量,上限为2,like为是否附加点赞。返回是否附加点赞成功
func CoinVideoByBvid ¶
CoinVideoByBvid 通过Bvid投币视频,multiply为投币数量,上限为2,like为是否附加点赞。返回是否附加点赞成功
func CoinVideoByShortUrl ¶
CoinVideoByShortUrl 通过短链接投币视频,multiply为投币数量,上限为2,like为是否附加点赞。返回是否附加点赞成功
func CopyFavourResources ¶
func CopyFavourResources(srcMediaId, tarMediaId, mid int, resources []Resource, platform string) error
CopyFavourResources 批量复制收藏内容
func CreateDynamic ¶
func CreateDynamic(content, extension string, atUids []int, ctrl []*FormatCtrl) (dynamicId int, err error)
CreateDynamic 发表纯文本动态
TODO: extension 字段尚不知如何使用,需自行填写。参考 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/dynamic/publish.md
func DeleteFavourResources ¶
DeleteFavourResources 批量删除收藏内容
func FavourVideoByAvid ¶
FavourVideoByAvid 通过Avid收藏视频,addMediaIds和delMediaIds为要增加/删除的收藏列表,非必填。返回是否为未关注用户收藏
func FavourVideoByBvid ¶
FavourVideoByBvid 通过Bvid收藏视频,addMediaIds和delMediaIds为要增加/删除的收藏列表,非必填。返回是否为未关注用户收藏
func FavourVideoByShortUrl ¶
FavourVideoByShortUrl 通过短链接收藏视频,addMediaIds和delMediaIds为要增加/删除的收藏列表,非必填。返回是否为未关注用户收藏
func GetBvidByShortUrl ¶
GetBvidByShortUrl 通过视频短链接获取bvid
func GetCookiesString ¶
func GetCookiesString() string
GetCookiesString 获取字符串格式的cookies,方便自行存储后下次使用。配合下面的 SetCookiesString 使用。
func GetRoomidByShortUrl ¶
GetRoomidByShortUrl 通过直播短链接获取直播间id
func GetVideoDescByAvid ¶
GetVideoDescByAvid 通过Avid获取视频简介
func GetVideoDescByBvid ¶
GetVideoDescByBvid 通过Bvid获取视频简介
func GetVideoDescByShortUrl ¶
GetVideoDescByShortUrl 通过短链接获取视频简介
func LikeVideoByAvid ¶
LikeVideoByAvid 通过Avid点赞视频,like为false表示取消点赞
func LikeVideoByBvid ¶
LikeVideoByBvid 通过Bvid点赞视频,like为false表示取消点赞
func LikeVideoByShortUrl ¶
LikeVideoByShortUrl 通过短链接点赞视频,like为false表示取消点赞
func ListCountry ¶
func ListCountry() (common []CountryInfo, others []CountryInfo, err error)
ListCountry 获取国际地区代码
func LoginWithPassword ¶
func LoginWithPassword(userName, password string, captchaResult *CaptchaResult, validate, seccode string) error
LoginWithPassword 账号密码登录
func LoginWithSMS ¶
LoginWithSMS 使用短信验证码登录
func MoveFavourResources ¶
func MoveFavourResources(srcMediaId, tarMediaId, mid int, resources []Resource, platform string) error
MoveFavourResources 批量移动收藏内容
func ReceiveVipPrivilege ¶
ReceiveVipPrivilege 兑换大会员卡券,1:B币券,2:会员购优惠券,3:漫画福利券,4:会员购包邮券,5:漫画商城优惠券
func SendPrivateMessageImage ¶
SendPrivateMessageImage 发送私信(图片消息)
func SendPrivateMessageRecall ¶
SendPrivateMessageRecall 发送私信(撤回消息)
func SendPrivateMessageText ¶
SendPrivateMessageText 发送私信(文字消息)
func SendSMS ¶
func SendSMS(tel, cid int, captchaResult *CaptchaResult, validate, seccode string) (captchaKey string, err error)
SendSMS 发送短信验证码
func SetCookies ¶
SetCookies 设置Cookies。有些功能必须登录之后才能使用,设置Cookies可以代替登录。
func SetCookiesString ¶
func SetCookiesString(cookiesString string)
SetCookiesString 设置Cookies,但是是字符串格式,配合 GetCookiesString 使用。有些功能必须登录或设置Cookies后才能使用。
Types ¶
type AccountInformation ¶
type AccountInformation struct {
Mid int64 `json:"mid"` //我的mid
Uname string `json:"uname"` //我的昵称
Userid string `json:"userid"` //我的用户名
Sign string `json:"sign"` //我的签名
Birthday string `json:"birthday"` //我的生日
Sex string `json:"sex"` //我的性别
NickFree bool `json:"nick_free"` //false:设置过昵称 true:未设置昵称
Rank string `json:"rank"` //我的会员等级
}
AccountInformation 自己账号相关的简单信息
func GetAccountInformation ¶
func GetAccountInformation() (*AccountInformation, error)
GetAccountInformation 获取我的信息 无参数
type AllFavourFolderInfo ¶
type AllFavourFolderInfo struct {
Count int `json:"count"` // 创建的收藏夹总数
List []struct {
Id int `json:"id"` // 收藏夹mlid(完整id),收藏夹原始id+创建者mid尾号2位
Fid int `json:"fid"` // 收藏夹原始id
Mid int `json:"mid"` // 创建者mid
Attr int `json:"attr"` // 属性位(?)
Title string `json:"title"` // 收藏夹标题
FavState int `json:"fav_state"` // 目标id是否存在于该收藏夹,存在于该收藏夹:1,不存在于该收藏夹:0
MediaCount int `json:"media_count"` // 收藏夹内容数量
} `json:"list"`
}
func GetAllFavourFolderInfo ¶
func GetAllFavourFolderInfo(upMid, attrType, rid int) (*AllFavourFolderInfo, error)
GetAllFavourFolderInfo 获取指定用户创建的所有收藏夹信息
type ArchivesList ¶
type ArchivesList struct {
Aids []int `json:"aids"`
Archives []struct {
Aid int `json:"aid"`
Bvid string `json:"bvid"`
Ctime int `json:"ctime"`
Duration int `json:"duration"`
EnableVt bool `json:"enable_vt"`
InteractiveVideo bool `json:"interactive_video"`
Pic string `json:"pic"`
PlaybackPosition int `json:"playback_position"`
Pubdate int `json:"pubdate"`
Stat struct {
View int `json:"view"`
Vt int `json:"vt"`
} `json:"stat"`
State int `json:"state"`
Title string `json:"title"`
UgcPay int `json:"ugc_pay"`
VtDisplay string `json:"vt_display"`
} `json:"archives"`
Meta struct {
Category int `json:"category"`
Cover string `json:"cover"`
Description string `json:"description"`
Mid int `json:"mid"`
Name string `json:"name"`
Ptime int `json:"ptime"`
SeasonID int `json:"season_id"`
Total int `json:"total"`
} `json:"meta"`
Page struct {
PageNum int `json:"page_num"`
PageSize int `json:"page_size"`
Total int `json:"total"`
} `json:"page"`
}
type Article ¶
type Article struct {
Id int `json:"id"` // 专栏cvid
Title string `json:"title"` // 文章标题
State int `json:"state"` // 固定值0,作用尚不明确
PublishTime int `json:"publish_time"` // 发布时间戳(秒)
Words int `json:"words"` // 文章字数
ImageUrls []string `json:"image_urls"` // 文章封面
Category struct {
Id int `json:"id"`
ParentId int `json:"parent_id"`
Name string `json:"name"`
} `json:"category"`
Categories []struct {
Id int `json:"id"`
ParentId int `json:"parent_id"`
Name string `json:"name"`
} `json:"categories"`
Summary string `json:"summary"` // 文章摘要
Stats struct {
View int `json:"view"` // 阅读数
Favorite int `json:"favorite"` // 收藏数
Like int `json:"like"` // 点赞数
Dislike int `json:"dislike"` // 点踩数
Reply int `json:"reply"` // 评论数
Share int `json:"share"` // 分享数
Coin int `json:"coin"` // 投币数
Dynamic int `json:"dynamic"` // 动态转发数
} `json:"stats"`
LikeState int `json:"like_state"` // 是否点赞
}
type ArticleViewInfo ¶
type ArticleViewInfo struct {
Like int `json:"like"` // 是否点赞,0:未点赞,1:已点赞
Attention bool `json:"attention"` // 是否关注文章作者
Favorite bool `json:"favorite"` // 是否收藏
Coin int `json:"coin"` // 为文章投币数
Stats struct {
View int `json:"view"` // 阅读数
Favorite int `json:"favorite"` // 收藏数
Like int `json:"like"` // 点赞数
Dislike int `json:"dislike"` // 点踩数
Reply int `json:"reply"` // 评论数
Share int `json:"share"` // 分享数
Coin int `json:"coin"` // 投币数
Dynamic int `json:"dynamic"` // 动态转发数
} `json:"stats"`
Title string `json:"title"` // 文章标题
BannerUrl string `json:"banner_url"` // 文章头图url
Mid int `json:"mid"` // 文章作者mid
AuthorName string `json:"author_name"` // 文章作者昵称
IsAuthor bool `json:"is_author"` // 固定值true,作用尚不明确
ImageUrls []string `json:"image_urls"` // 动态封面图片url
OriginImageUrls []string `json:"origin_image_urls"` // 文章封面图片url
ShowLaterWatch bool `json:"show_later_watch"` // 固定值true,作用尚不明确
ShowSmallWindow bool `json:"show_small_window"` // 固定值true,作用尚不明确
InList bool `json:"in_list"` // 是否收于文集
Pre int `json:"pre"` // 上一篇文章cvid
Next int `json:"next"` // 下一篇文章cvid
Name string `json:"name"` // 分享名称:QQ,QQ空间,微信,朋友圈,微博
Picture string `json:"picture"` // 分享图片url
ShareChannel string `json:"share_channel"` // 分享代号:QQ,QZONE,WEIXIN,WEIXIN_MOMENT,SINA
} `json:"share_channels"`
}
func GetArticleViewInfo ¶
func GetArticleViewInfo(id int) (*ArticleViewInfo, error)
GetArticleViewInfo 获取专栏文章基本信息
type ArticlesInfo ¶
type ArticlesInfo struct {
List struct {
Id int `json:"id"` // 文集rlid
Mid int `json:"mid"` // 文集作者mid
Name string `json:"name"` // 文集名称
ImageUrl string `json:"image_url"` // 文集封面图片url
UpdateTime int `json:"update_time"` // 文集更新时间戳
Ctime int `json:"ctime"` // 文集创建时间戳
PublishTime int `json:"publish_time"` // 文集发布时间戳
Summary string `json:"summary"` // 文集简介
Words int `json:"words"` // 文集字数
Read int `json:"read"` // 文集阅读量
ArticlesCount int `json:"articles_count"` // 1或3,作用尚不明确
State int `json:"state"` // 空,作用尚不明确
Reason string `json:"reason"` // 空,作用尚不明确
ApplyTime string `json:"apply_time"` // 空,作用尚不明确
CheckTime string `json:"check_time"` // 空,作用尚不明确
} `json:"list"`
Articles []Article `json:"articles"` // 文集内的文章列表
Author struct {
Mid int `json:"mid"` // 作者mid
Name string `json:"name"` // 作者昵称
Face string `json:"face"` // 作者头像url
Pendant Pendant `json:"pendant"`
OfficialVerify OfficialVerify `json:"official_verify"` // 作者认证信息
Nameplate NamePlate `json:"nameplate"`
Vip Vip `json:"vip"`
} `json:"author"`
Last Article `json:"last"` // 作用尚不明确
Attention bool `json:"attention"` // 是否关注文集作者
}
type CaptchaResult ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddFavourFolder ¶
func (*Client) Captcha ¶
func (c *Client) Captcha() (*CaptchaResult, error)
func (*Client) CleanFavourResources ¶
func (*Client) CoinVideoByAvid ¶
func (*Client) CoinVideoByBvid ¶
func (*Client) CoinVideoByShortUrl ¶
func (*Client) CopyFavourResources ¶
func (*Client) CreateDynamic ¶
func (*Client) DeleteFavourFolder ¶
func (*Client) DeleteFavourResources ¶
func (*Client) EditFavourFolder ¶
func (*Client) FavourArticle ¶
func (*Client) FavourVideoByAvid ¶
func (*Client) FavourVideoByBvid ¶
func (*Client) FavourVideoByShortUrl ¶
func (*Client) FetchDynamics ¶
func (*Client) GetAccountInformation ¶
func (c *Client) GetAccountInformation() (*AccountInformation, error)
func (*Client) GetAllFavourFolderInfo ¶
func (c *Client) GetAllFavourFolderInfo(upMid, attrType, rid int) (*AllFavourFolderInfo, error)
func (*Client) GetArchivesList ¶
func (*Client) GetArticleViewInfo ¶
func (c *Client) GetArticleViewInfo(id int) (*ArticleViewInfo, error)
func (*Client) GetArticlesInfo ¶
func (c *Client) GetArticlesInfo(id int) (*ArticlesInfo, error)
func (*Client) GetBvidByShortUrl ¶
func (*Client) GetCookies ¶
func (*Client) GetCookiesString ¶
func (*Client) GetDynamicDetail ¶
func (c *Client) GetDynamicDetail(dynamicId int) (*DynamicDetail, error)
func (*Client) GetDynamicLikeList ¶
func (c *Client) GetDynamicLikeList(dynamicId, offset int) (*DynamicLikeList, error)
func (*Client) GetDynamicLiveUserList ¶
func (c *Client) GetDynamicLiveUserList(size int) (*DynamicLiveUserList, error)
func (*Client) GetDynamicPortal ¶
func (c *Client) GetDynamicPortal() (*DynamicPortal, error)
func (*Client) GetDynamicRepostDetail ¶
func (c *Client) GetDynamicRepostDetail(dynamicId, offset int) (*DynamicRepostDetail, error)
func (*Client) GetDynamicUpList ¶
func (c *Client) GetDynamicUpList(size int) (*DynamicUpList, error)
func (*Client) GetFavourFolderInfo ¶
func (c *Client) GetFavourFolderInfo(mediaId int) (*FavourFolderInfo, error)
func (*Client) GetFavourIds ¶
func (*Client) GetFavourInfo ¶
func (c *Client) GetFavourInfo(resources []Resource, platform string) ([]*FavourInfo, error)
func (*Client) GetFavourList ¶
func (*Client) GetLiveAreaList ¶
func (c *Client) GetLiveAreaList() ([]LiveAreaData, error)
func (*Client) GetRecommendVideoByAvid ¶
func (*Client) GetRecommendVideoByBvid ¶
func (*Client) GetRoomidByShortUrl ¶
func (*Client) GetSessionMessages ¶
func (c *Client) GetSessionMessages(talkerId, sessionType, size int, mobiApp string) (*SessionMessages, error)
func (*Client) GetSessions ¶
func (c *Client) GetSessions(sessionType int, mobiApp string) (*SessionList, error)
func (*Client) GetTimeout ¶
func (*Client) GetTopRecommendVideo ¶
func (*Client) GetTopicHistory ¶
func (*Client) GetUnreadMessage ¶
func (c *Client) GetUnreadMessage() (*UnreadMessage, error)
func (*Client) GetUnreadPrivateMessage ¶
func (c *Client) GetUnreadPrivateMessage() (*UnreadPrivateMessage, error)
func (*Client) GetUserArticleList ¶
func (c *Client) GetUserArticleList(mid, pn, ps int, sort string) (*UserArticleList, error)
func (*Client) GetUserArticlesList ¶
func (c *Client) GetUserArticlesList(mid, sort int) (*UserArticlesList, error)
func (*Client) GetUserCard ¶
func (c *Client) GetUserCard(mid int, photo bool) (*UserCardResult, error)
func (*Client) GetUserSpaceDynamic ¶
func (c *Client) GetUserSpaceDynamic(mid int, offset string) (*DynamicInfo, error)
func (*Client) GetUserVideos ¶
func (*Client) GetVideoComment ¶
GetVideoComment 用于获取视频评论 及二级评论
func (*Client) GetVideoDescByBvid ¶
func (*Client) GetVideoDescByShortUrl ¶
func (*Client) GetVideoDetailInfoByAvid ¶
func (c *Client) GetVideoDetailInfoByAvid(avid int) (*VideoDetailInfo, error)
func (*Client) GetVideoDetailInfoByBvid ¶
func (c *Client) GetVideoDetailInfoByBvid(bvid string) (*VideoDetailInfo, error)
func (*Client) GetVideoDetailInfoByShortUrl ¶
func (c *Client) GetVideoDetailInfoByShortUrl(shortUrl string) (*VideoDetailInfo, error)
func (*Client) GetVideoInfoByAvid ¶
func (*Client) GetVideoInfoByBvid ¶
func (*Client) GetVideoInfoByShortUrl ¶
func (*Client) GetVideoOnlineInfoByAvid ¶
func (c *Client) GetVideoOnlineInfoByAvid(avid, cid int) (*VideoOnlineInfo, error)
func (*Client) GetVideoOnlineInfoByBvid ¶
func (c *Client) GetVideoOnlineInfoByBvid(bvid string, cid int) (*VideoOnlineInfo, error)
func (*Client) GetVideoOnlineInfoByShortUrl ¶
func (c *Client) GetVideoOnlineInfoByShortUrl(shortUrl string, cid int) (*VideoOnlineInfo, error)
func (*Client) GetVideoPageListByAvid ¶
func (*Client) GetVideoPageListByBvid ¶
func (*Client) GetVideoPageListByShortUrl ¶
func (*Client) GetVideoPbPInfo ¶
func (c *Client) GetVideoPbPInfo(cid int) (*VideoPbPInfo, error)
func (*Client) GetVideoStatusNumberByAvid ¶
func (c *Client) GetVideoStatusNumberByAvid(avid int) (*VideoStatusNumber, error)
func (*Client) GetVideoStatusNumberByBvid ¶
func (c *Client) GetVideoStatusNumberByBvid(bvid string) (*VideoStatusNumber, error)
func (*Client) GetVideoStatusNumberByShortUrl ¶
func (c *Client) GetVideoStatusNumberByShortUrl(shortUrl string) (*VideoStatusNumber, error)
func (*Client) GetVideoTagsByAvid ¶
func (*Client) GetVideoTagsByBvid ¶
func (*Client) GetVideoTagsByShortUrl ¶
func (*Client) GetVipCenterInfo ¶
func (c *Client) GetVipCenterInfo() (*VipCenterInfo, error)
func (*Client) GetVipPrivilege ¶
func (c *Client) GetVipPrivilege() (*VipPrivilege, error)
func (*Client) HateVideoTag ¶
func (*Client) LikeCoinFavourVideoByAvid ¶
func (c *Client) LikeCoinFavourVideoByAvid(avid int) (*LikeCoinFavourResult, error)
func (*Client) LikeCoinFavourVideoByBvid ¶
func (c *Client) LikeCoinFavourVideoByBvid(bvid string) (*LikeCoinFavourResult, error)
func (*Client) LikeCoinFavourVideoByShortUrl ¶
func (c *Client) LikeCoinFavourVideoByShortUrl(shortUrl string) (*LikeCoinFavourResult, error)
func (*Client) LikeVideoByShortUrl ¶
func (*Client) LikeVideoTag ¶
func (*Client) ListCountry ¶
func (c *Client) ListCountry() (common []CountryInfo, others []CountryInfo, err error)
func (*Client) LoginWithPassword ¶
func (c *Client) LoginWithPassword(userName, password string, captchaResult *CaptchaResult, validate, seccode string) error
func (*Client) LoginWithQRCode ¶
func (*Client) LoginWithSMS ¶
func (*Client) MoveFavourResources ¶
func (*Client) ReceiveVipPrivilege ¶
func (*Client) RemoveDynamic ¶
func (*Client) SearchDynamicAt ¶
func (c *Client) SearchDynamicAt(uid int, keyword string) (*SearchDynamicAtResult, error)
func (*Client) SendPrivateMessageImage ¶
func (*Client) SendPrivateMessageRecall ¶
func (*Client) SendPrivateMessageText ¶
func (*Client) SetCookies ¶
func (*Client) SetCookiesString ¶
func (*Client) SetTimeout ¶
func (*Client) SignVipScore ¶
type Comment ¶
type Comment struct {
Rpid int64 `json:"rpid"` // 评论 rpid
Oid int `json:"oid"` // 评论区对象 id
Type int `json:"type"` // 评论区类型代码
Mid int `json:"mid"` // 发送者 mid
Root int `json:"root"` // 根评论 rpid,若为一级评论则为 0,大于一级评论则为根评论 id
Parent int `json:"parent"` // 回复父评论 rpid,若为一级评论则为 0,若为二级评论则为根评论 rpid,大于二级评论为上一级评论 rpid
Dialog int `json:"dialog"` // 回复对方 rpid,若为一级评论则为 0,若为二级评论则为该评论 rpid,大于二级评论为上一级评论 rpid
Count int `json:"count"` // 二级评论条数
Rcount int `json:"rcount"` // 回复评论条数
Floor int `json:"floor"` // 评论楼层号
State int `json:"state"` // 作用尚不明确
Fansgrade int `json:"fansgrade"` // 是否具有粉丝标签,0:无,1:有
Attr int `json:"attr"` // 作用尚不明确
Ctime 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"` // 评论获赞数
Action int `json:"action"` // 当前用户操作状态,需要登录(Cookie 或 APP),否则恒为 0,0:无,1:已点赞,2:已点踩
Member struct {
Mid int64 `json:"mid"` // 发送者 mid
Uname string `json:"uname"` // 发送者昵称
Sex string `json:"sex"` // 发送者性别
Sign string `json:"sign"` // 发送者签名
Avatar string `json:"avatar"` // 发送者头像 url
Rank string `json:"rank"`
DisplayRank string `json:"DisplayRank"`
LevelInfo struct {
CurrentLevel int `json:"current_level"` // 用户等级
CurrentMin int `json:"current_min"`
CurrentExp int `json:"current_exp"`
NextExp int `json:"next_exp"`
} `json:"level_info"` // 发送者等级
Pendant *struct {
Pid int `json:"pid"` // 头像框 id
Name string `json:"name"` // 头像框名称
Image string `json:"image"` // 头像框图片 url
Expire int `json:"expire"`
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"` // 发送者勋章信息
OfficialVerify *struct {
Type int `json:"type"` // 是否认证,-1:无,0:个人认证,1:机构认证
Desc string `json:"desc"` // 认证信息,无为空
} `json:"official_verify"` // 发送者认证信息
Vip *struct {
VipType int `json:"vipType"` // 大会员类型,0:无,1:月会员,2:年以上会员
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:"theme_type"` // 会员样式 id
Label struct {
Path string `json:"path"`
Text string `json:"text"` // 会员类型文案
LabelTheme string `json:"label_theme"` // 会员类型,vip:大会员,annual_vip:年度大会员,ten_annual_vip:十年大会员,hundred_annual_vip:百年大会员
TextColor string `json:"text_color"`
BgStyle int `json:"bg_style"`
BgColor string `json:"bg_color"`
BorderColor string `json:"border_color"`
} `json:"label"` // 会员铭牌样式
AvatarSubscript int `json:"avatar_subscript"`
AvatarSubscriptUrl string `json:"avatar_subscript_url"`
NicknameColor string `json:"nickname_color"` // 昵称颜色
} `json:"vip"` // 发送者会员信息
FansDetail *struct {
Uid int `json:"uid"` // 用户 mid
MedalId int `json:"medal_id"` // 粉丝标签 id
MedalName string `json:"medal_name"` // 粉丝标签名
Score int `json:"score"`
Level int `json:"level"` // 当前标签等级
Intimacy int `json:"intimacy"`
MasterStatus int `json:"master_status"`
IsReceive int `json:"is_receive"`
} `json:"fans_detail"` // 发送者粉丝标签
Following int `json:"following"` // 是否关注该用户,需要登录(Cookie或APP),否则恒为0,0:未关注,1:已关注
IsFollowed int `json:"is_followed"` // 是否被该用户关注,需要登录(Cookie或APP),否则恒为0,0:未关注,1:已关注
UserSailing *struct {
Pendant *struct {
Id int `json:"id"` // 头像框 id
Name string `json:"name"` // 头像框名称
Image string `json:"image"` // 头像框图片 url
JumpUrl string `json:"jump_url"`
Type string `json:"type"` // 装扮类型,suit:一般装扮,vip_suit:vip装扮
ImageEnhance string `json:"image_enhance"`
ImageEnhanceFrame string `json:"image_enhance_frame"`
} `json:"pendant"` // 头像框信息
Cardbg *struct {
Id int `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 int `json:"number"` // 粉丝专属编号
Color string `json:"color"` // 数字颜色
Name string `json:"name"` // 装扮名称
NumDesc string `json:"num_desc"` // 粉丝专属编号,字串格式
} `json:"fan"` // 粉丝专属信息
Type string `json:"type"` // 装扮类型,suit:一般装扮,vip_suit:vip装扮
} `json:"cardbg"` // 评论卡片装扮
CardbgWithFocus interface{} `json:"cardbg_with_focus"` // null
} `json:"user_sailing"` // 发送者评论条目装扮信息
IsContractor bool `json:"is_contractor"` // 是否为合作用户
ContractDesc string `json:"contract_desc"` // 合作用户说明
} `json:"member"`
Content struct {
Message string `json:"message"` // 评论内容
Plat int `json:"plat"` // 评论发送端,1:web端,2:安卓客户端,3:ios客户端,4:wp客户端
Device string `json:"device"` // 评论发送平台设备
Members []interface{} `json:"members"` // at到的用户信息
Emote map[string]struct {
Id int `json:"id"` // 表情 id
PackageId int `json:"package_id"` // 表情包 id
State int `json:"state"`
Type int `json:"type"` // 表情类型,1:免费,2:会员专属,3:购买所得,4:颜文字
Attr int `json:"attr"`
Text string `json:"text"` // 表情转义符
Url string `json:"url"` // 表情图片 url
Meta struct {
Size int `json:"size"` // 表情尺寸信息,1:小,2:大
Alias string `json:"alias"` // 简写名,无则无此项
} `json:"meta"`
Mtime int64 `json:"mtime"` // 表情创建时间,时间戳
JumpTitle string `json:"jump_title"` // 表情名称
} `json:"emote"` // 需要渲染的表情转义,评论内容无表情则无此项
JumpUrl map[string]struct {
Title string `json:"title"` // 标题
State int `json:"state"` // 图标 url
PrefixIcon string `json:"prefixIcon"`
AppUrlSchema string `json:"appUrlSchema"`
AppName string `json:"appName"`
AppPackageName string `json:"appPackageName"`
ClickReport string `json:"clickReport"` // 上报 id
} `json:"jump_url"` // 需要高亮的超链转义
MaxLine int `json:"max_line"` // 收起最大行数
Pictures []struct {
ImgSrc string `json:"img_src"` // 图片地址
ImgWidth int `json:"img_width"` // 图片宽度
ImgHeight int `json:"img_height"` // 图片高度
ImgSize int `json:"img_size"` // 图片大小,单位KB
} `json:"pictures"` // 评论图片数组
} `json:"content"`
Replies []Comment `json:"replies"` // 评论回复条目预览,仅嵌套一层
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"` // 评论是否被隐藏
CardLabel struct {
Rpid int64 `json:"rpid"` // 评论 rpid
TextContent string `json:"text_content"` // 标签文本,已知有"妙评"
TextColorDay string `json:"text_color_day"` // 日间文本颜色,十六进制颜色值
TextColorNight string `json:"text_color_night"` // 夜间文本颜色,十六进制颜色值
LabelColorDay string `json:"label_color_day"` // 日间标签颜色,十六进制颜色值
LabelColorNight string `json:"label_color_night"` // 夜间标签颜色,十六进制颜色值
Image string `json:"image"` // 作用不明
Type string `json:"type"` // 1,作用不明
Background string `json:"background"` // 背景图片 url
BackgroundWidth int `json:"background_width"` // 背景图片宽度
BackgroundHeight int `json:"background_height"` // 背景图片高度
JumpUrl string `json:"jump_url"` // 跳转链接
Effect int `json:"effect"` // 0,作用不明,可能用于控制动画
EffectStartTime int `json:"effect_start_time"` // 0,作用不明,可能用于控制动画
} `json:"card_label"` // 右上角卡片标签信息
ReplyControl struct {
SubReplyEntryText string `json:"sub_reply_entry_text"` // 回复提示,"共 xx 条回复"
SubReplyTitleText string `json:"sub_reply_title_text"` // 回复提示,"相关回复共有 xx 条"
TimeDesc string `json:"time_desc"` // 时间提示,"xx 天/小时 前发布"
// 评论者发送评论时的IP地址属地,仅对2022-07-25 11:00及以后发布的评论有
Location string `json:"location"`
} `json:"reply_control"`
}
type CountryInfo ¶
type DynamicCard ¶
type DynamicCard struct {
ActivityInfos map[string]interface{} `json:"activity_infos"` // 该条动态参与的活动
Card string `json:"card"` // 动态详细信息
Desc map[string]interface{} `json:"desc"` // 动态相关信息
Display map[string]interface{} `json:"display"` // 动态部分的可操作项
ExtendJson string `json:"extend_json"` // 动态扩展项
}
DynamicCard 动态卡片内容。因为 ActivityInfos 、 Desc 、 Display 等字段会随着此动态类型不同发生一定的变化, // 无法统一,因此都转换成了 map[string]interface{} ,请自行解析
type DynamicDetail ¶
type DynamicDetail struct {
Card *DynamicCard `json:"card"` // 动态卡片内容
Result int `json:"result"`
Gt int `json:"_gt_"`
}
func GetDynamicDetail ¶
func GetDynamicDetail(dynamicId int) (*DynamicDetail, error)
GetDynamicDetail 获取特定动态卡片信息
type DynamicInfo ¶
type DynamicInfo struct {
HasMore bool `json:"has_more"` // 是否有更多数据
Items []DynamicItem `json:"items"` // 数据数组
Offset string `json:"offset"` // 偏移量,等于items中最后一条记录的id,获取下一页时使用
UpdateBaseline string `json:"update_baseline"` // 更新基线,等于items中第一条记录的id
UpdateNum int `json:"update_num"` // 本次获取获取到了多少条新动态,在更新基线以上的动态条数
}
func GetUserSpaceDynamic ¶
func GetUserSpaceDynamic(mid int, offset string) (*DynamicInfo, error)
GetUserSpaceDynamic 获取用户空间动态,mid就是用户UID,无需登录。
返回结构较为繁琐,见 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/dynamic/space.md
type DynamicItem ¶
type DynamicItem struct {
Basic struct {
CommentIdStr string `json:"comment_id_str"`
CommentType int `json:"comment_type"`
LikeIcon struct {
ActionUrl string `json:"action_url"`
EndUrl string `json:"end_url"`
Id int `json:"id"`
StartUrl string `json:"start_url"`
} `json:"like_icon"`
RidStr string `json:"rid_str"`
} `json:"basic"`
IdStr interface{} `json:"id_str"` // 这个字段,B站返回的数据有时是number,有时是string,不知道为什么。这里用interface{}会带来一个问题,number会解析成为float64,有可能存在丢失精度问题。请谨慎使用
Modules struct {
ModuleAuthor struct {
Avatar struct {
ContainerSize struct {
Height float64 `json:"height"`
Width float64 `json:"width"`
} `json:"container_size"`
FallbackLayers struct {
IsCriticalGroup bool `json:"is_critical_group"`
Layers []struct {
GeneralSpec struct {
PosSpec struct {
AxisX float64 `json:"axis_x"`
AxisY float64 `json:"axis_y"`
CoordinatePos int `json:"coordinate_pos"`
} `json:"pos_spec"`
RenderSpec struct {
Opacity int `json:"opacity"`
} `json:"render_spec"`
SizeSpec struct {
Height float64 `json:"height"`
Width float64 `json:"width"`
} `json:"size_spec"`
} `json:"general_spec"`
LayerConfig struct {
IsCritical bool `json:"is_critical,omitempty"`
Tags struct {
AvatarLayer struct {
} `json:"AVATAR_LAYER,omitempty"`
GeneralCfg struct {
ConfigType int `json:"config_type"`
GeneralConfig struct {
WebCssStyle struct {
BorderRadius string `json:"borderRadius"`
BackgroundColor string `json:"background-color,omitempty"`
Border string `json:"border,omitempty"`
BoxSizing string `json:"boxSizing,omitempty"`
} `json:"web_css_style"`
} `json:"general_config"`
} `json:"GENERAL_CFG"`
IconLayer struct{} `json:"ICON_LAYER,omitempty"`
} `json:"tags"`
} `json:"layer_config"`
Resource struct {
ResAnimation struct {
WebpSrc struct {
Placeholder int `json:"placeholder"`
Remote struct {
BfsStyle string `json:"bfs_style"`
Url string `json:"url"`
} `json:"remote"`
SrcType int `json:"src_type"`
} `json:"webp_src"`
} `json:"res_animation,omitempty"`
ResType int `json:"res_type"`
ResImage struct {
ImageSrc struct {
Local int `json:"local"`
SrcType int `json:"src_type"`
} `json:"image_src"`
} `json:"res_image,omitempty"`
} `json:"resource"`
Visible bool `json:"visible"`
} `json:"layers"`
} `json:"fallback_layers"`
Mid string `json:"mid"`
} `json:"avatar"`
Face string `json:"face"`
FaceNft bool `json:"face_nft"`
Following interface{} `json:"following"`
JumpUrl string `json:"jump_url"`
Label string `json:"label"`
Mid int `json:"mid"`
Name string `json:"name"`
OfficialVerify struct {
Desc string `json:"desc"`
Type int `json:"type"`
} `json:"official_verify"`
Pendant struct {
Expire int `json:"expire"`
Image string `json:"image"`
ImageEnhance string `json:"image_enhance"`
ImageEnhanceFrame string `json:"image_enhance_frame"`
NPid int `json:"n_pid"`
Name string `json:"name"`
Pid int `json:"pid"`
} `json:"pendant"`
PubAction string `json:"pub_action"`
PubLocationText string `json:"pub_location_text"`
PubTime string `json:"pub_time"`
PubTs int `json:"pub_ts"`
Type string `json:"type"`
Vip struct {
AvatarSubscript int `json:"avatar_subscript"`
AvatarSubscriptUrl string `json:"avatar_subscript_url"`
DueDate int64 `json:"due_date"`
Label struct {
BgColor string `json:"bg_color"`
BgStyle int `json:"bg_style"`
BorderColor string `json:"border_color"`
ImgLabelUriHans string `json:"img_label_uri_hans"`
ImgLabelUriHansStatic string `json:"img_label_uri_hans_static"`
ImgLabelUriHant string `json:"img_label_uri_hant"`
ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"`
LabelTheme string `json:"label_theme"`
Path string `json:"path"`
Text string `json:"text"`
TextColor string `json:"text_color"`
UseImgLabel bool `json:"use_img_label"`
} `json:"label"`
NicknameColor string `json:"nickname_color"`
Status int `json:"status"`
ThemeType int `json:"theme_type"`
Type int `json:"type"`
} `json:"vip"`
} `json:"module_author"`
ModuleDynamic struct {
Additional interface{} `json:"additional"`
Desc *struct {
RichTextNodes []struct {
OrigText string `json:"orig_text"`
Text string `json:"text"`
Type string `json:"type"`
JumpUrl string `json:"jump_url,omitempty"`
Style interface{} `json:"style"`
Emoji struct {
IconUrl string `json:"icon_url"`
Size int `json:"size"`
Text string `json:"text"`
Type int `json:"type"`
} `json:"emoji,omitempty"`
Rid string `json:"rid,omitempty"`
} `json:"rich_text_nodes"`
Text string `json:"text"`
} `json:"desc"`
Major *struct {
Draw struct {
Id int `json:"id"`
Items []struct {
Height int `json:"height"`
Size float64 `json:"size"`
Src string `json:"src"`
Tags []interface{} `json:"tags"`
Width int `json:"width"`
} `json:"items"`
} `json:"draw,omitempty"`
Type string `json:"type"`
Archive struct {
Aid string `json:"aid"`
Badge struct {
BgColor string `json:"bg_color"`
Color string `json:"color"`
IconUrl interface{} `json:"icon_url"`
Text string `json:"text"`
} `json:"badge"`
Bvid string `json:"bvid"`
Cover string `json:"cover"`
Desc string `json:"desc"`
DisablePreview int `json:"disable_preview"`
DurationText string `json:"duration_text"`
JumpUrl string `json:"jump_url"`
Stat struct {
Danmaku string `json:"danmaku"`
Play string `json:"play"`
} `json:"stat"`
Title string `json:"title"`
Type int `json:"type"`
} `json:"archive,omitempty"`
} `json:"major"`
Topic interface{} `json:"topic"`
} `json:"module_dynamic"`
ModuleMore struct {
ThreePointItems []struct {
Label string `json:"label"`
Type string `json:"type"`
} `json:"three_point_items"`
} `json:"module_more"`
ModuleStat struct {
Comment struct {
Count int `json:"count"`
Forbidden bool `json:"forbidden"`
} `json:"comment"`
Forward struct {
Count int `json:"count"`
Forbidden bool `json:"forbidden"`
} `json:"forward"`
Like struct {
Count int `json:"count"`
Forbidden bool `json:"forbidden"`
Status bool `json:"status"`
} `json:"like"`
} `json:"module_stat"`
} `json:"modules"`
Orig struct {
Basic struct {
CommentIdStr string `json:"comment_id_str"`
CommentType int `json:"comment_type"`
LikeIcon struct {
ActionUrl string `json:"action_url"`
EndUrl string `json:"end_url"`
Id int `json:"id"`
StartUrl string `json:"start_url"`
} `json:"like_icon"`
RidStr string `json:"rid_str"`
} `json:"basic"`
IdStr interface{} `json:"id_str"`
Modules struct {
ModuleAuthor struct {
Avatar struct {
ContainerSize struct {
Height float64 `json:"height"`
Width float64 `json:"width"`
} `json:"container_size"`
FallbackLayers struct {
IsCriticalGroup bool `json:"is_critical_group"`
Layers []struct {
GeneralSpec struct {
PosSpec struct {
AxisX float64 `json:"axis_x"`
AxisY float64 `json:"axis_y"`
CoordinatePos int `json:"coordinate_pos"`
} `json:"pos_spec"`
RenderSpec struct {
Opacity int `json:"opacity"`
} `json:"render_spec"`
SizeSpec struct {
Height float64 `json:"height"`
Width float64 `json:"width"`
} `json:"size_spec"`
} `json:"general_spec"`
LayerConfig struct {
IsCritical bool `json:"is_critical,omitempty"`
Tags struct {
AVATARLAYER struct {
} `json:"AVATAR_LAYER,omitempty"`
GENERALCFG struct {
ConfigType int `json:"config_type"`
GeneralConfig struct {
WebCssStyle struct {
BorderRadius string `json:"borderRadius"`
BackgroundColor string `json:"background-color,omitempty"`
Border string `json:"border,omitempty"`
BoxSizing string `json:"boxSizing,omitempty"`
} `json:"web_css_style"`
} `json:"general_config"`
} `json:"GENERAL_CFG,omitempty"`
PENDENTLAYER struct {
} `json:"PENDENT_LAYER,omitempty"`
ICONLAYER struct {
} `json:"ICON_LAYER,omitempty"`
} `json:"tags"`
} `json:"layer_config"`
Resource struct {
ResImage struct {
ImageSrc struct {
Placeholder int `json:"placeholder,omitempty"`
Remote struct {
BfsStyle string `json:"bfs_style"`
Url string `json:"url"`
} `json:"remote,omitempty"`
SrcType int `json:"src_type"`
Local int `json:"local,omitempty"`
} `json:"image_src"`
} `json:"res_image"`
ResType int `json:"res_type"`
} `json:"resource"`
Visible bool `json:"visible"`
} `json:"layers"`
} `json:"fallback_layers"`
Mid string `json:"mid"`
} `json:"avatar"`
Decorate struct {
CardUrl string `json:"card_url"`
Fan struct {
Color string `json:"color"`
IsFan bool `json:"is_fan"`
NumStr string `json:"num_str"`
Number int `json:"number"`
} `json:"fan"`
Id int `json:"id"`
JumpUrl string `json:"jump_url"`
Name string `json:"name"`
Type int `json:"type"`
} `json:"decorate,omitempty"`
Face string `json:"face"`
FaceNft bool `json:"face_nft"`
Following interface{} `json:"following"`
JumpUrl string `json:"jump_url"`
Label string `json:"label"`
Mid int `json:"mid"`
Name string `json:"name"`
OfficialVerify struct {
Desc string `json:"desc"`
Type int `json:"type"`
} `json:"official_verify"`
Pendant struct {
Expire int `json:"expire"`
Image string `json:"image"`
ImageEnhance string `json:"image_enhance"`
ImageEnhanceFrame string `json:"image_enhance_frame"`
NPid int `json:"n_pid"`
Name string `json:"name"`
Pid int `json:"pid"`
} `json:"pendant"`
PubAction string `json:"pub_action"`
PubTime string `json:"pub_time"`
PubTs int `json:"pub_ts"`
Type string `json:"type"`
Vip struct {
AvatarSubscript int `json:"avatar_subscript"`
AvatarSubscriptUrl string `json:"avatar_subscript_url"`
DueDate int64 `json:"due_date"`
Label struct {
BgColor string `json:"bg_color"`
BgStyle int `json:"bg_style"`
BorderColor string `json:"border_color"`
ImgLabelUriHans string `json:"img_label_uri_hans"`
ImgLabelUriHansStatic string `json:"img_label_uri_hans_static"`
ImgLabelUriHant string `json:"img_label_uri_hant"`
ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"`
LabelTheme string `json:"label_theme"`
Path string `json:"path"`
Text string `json:"text"`
TextColor string `json:"text_color"`
UseImgLabel bool `json:"use_img_label"`
} `json:"label"`
NicknameColor string `json:"nickname_color"`
Status int `json:"status"`
ThemeType int `json:"theme_type"`
Type int `json:"type"`
} `json:"vip"`
} `json:"module_author"`
ModuleDynamic struct {
Additional interface{} `json:"additional"`
Desc *struct {
RichTextNodes []struct {
JumpUrl string `json:"jump_url,omitempty"`
OrigText string `json:"orig_text"`
Text string `json:"text"`
Type string `json:"type"`
Emoji struct {
IconUrl string `json:"icon_url"`
Size int `json:"size"`
Text string `json:"text"`
Type int `json:"type"`
} `json:"emoji,omitempty"`
} `json:"rich_text_nodes"`
Text string `json:"text"`
} `json:"desc"`
Major struct {
Archive struct {
Aid string `json:"aid"`
Badge struct {
BgColor string `json:"bg_color"`
Color string `json:"color"`
IconUrl interface{} `json:"icon_url"`
Text string `json:"text"`
} `json:"badge"`
Bvid string `json:"bvid"`
Cover string `json:"cover"`
Desc string `json:"desc"`
DisablePreview int `json:"disable_preview"`
DurationText string `json:"duration_text"`
JumpUrl string `json:"jump_url"`
Stat struct {
Danmaku string `json:"danmaku"`
Play string `json:"play"`
} `json:"stat"`
Title string `json:"title"`
Type int `json:"type"`
} `json:"archive,omitempty"`
Type string `json:"type"`
Draw struct {
Id int `json:"id"`
Items []struct {
Height int `json:"height"`
Size float64 `json:"size"`
Src string `json:"src"`
Tags []interface{} `json:"tags"`
Width int `json:"width"`
} `json:"items"`
} `json:"draw,omitempty"`
} `json:"major"`
Topic interface{} `json:"topic"`
} `json:"module_dynamic"`
} `json:"modules"`
Type string `json:"type"`
Visible bool `json:"visible"`
} `json:"orig,omitempty"`
Type string `json:"type"`
Visible bool `json:"visible"`
}
type DynamicLikeList ¶
type DynamicLikeList struct {
ItemLikes []struct {
Uid int `json:"uid"`
Time int `json:"time"`
FaceUrl string `json:"face_url"`
Uname string `json:"uname"`
UserInfo struct {
Uid int `json:"uid"`
Uname string `json:"uname"`
Face string `json:"face"`
Rank string `json:"rank"`
OfficialVerify struct {
Type int `json:"type"`
Desc string `json:"desc"`
} `json:"official_verify"`
Vip struct {
VipType int `json:"vipType"`
VipDueDate int64 `json:"vipDueDate"`
VipStatus int `json:"vipStatus"`
ThemeType int `json:"themeType"`
Label struct {
Path string `json:"path"`
Text string `json:"text"`
LabelTheme string `json:"label_theme"`
TextColor string `json:"text_color"`
BgStyle int `json:"bg_style"`
BgColor string `json:"bg_color"`
BorderColor string `json:"border_color"`
} `json:"label"`
AvatarSubscript int `json:"avatar_subscript"`
NicknameColor string `json:"nickname_color"`
Role int `json:"role"`
AvatarSubscriptUrl string `json:"avatar_subscript_url"`
} `json:"vip"`
Pendant struct {
Pid int `json:"pid"`
Name string `json:"name"`
Image string `json:"image"`
Expire int `json:"expire"`
ImageEnhance string `json:"image_enhance"`
ImageEnhanceFrame string `json:"image_enhance_frame"`
} `json:"pendant"`
Sign string `json:"sign"`
LevelInfo struct {
CurrentLevel int `json:"current_level"`
} `json:"level_info"`
} `json:"user_info"`
Attend int `json:"attend"`
} `json:"item_likes"`
HasMore int `json:"has_more"` // 是否还有下一页
TotalCount int `json:"total_count"` // 总计点赞数
Gt int `json:"_gt_"` // 固定值0
}
func GetDynamicLikeList ¶
func GetDynamicLikeList(dynamicId, offset int) (*DynamicLikeList, error)
GetDynamicLikeList 获取动态点赞列表。offset是非必填项
type DynamicList ¶
type DynamicList struct {
Cards *DynamicCard `json:"cards"` // 动态列表
FounderUid int `json:"founder_uid,omitempty"`
HasMore int `json:"has_more"` // 当前话题是否有额外的动态,0:无额外动态,1:有额外动态
IsDrawerTopic int `json:"is_drawer_topic,omitempty"`
Offset string `json:"offset"` // 接下来获取列表时的偏移值,一般为当前获取的话题列表下最后一个动态id
Gt int `json:"_gt_"` // 固定值0,作用尚不明确
}
DynamicList 包含置顶及热门的动态列表
TODO: 因为不清楚 attentions 字段(关注列表)的格式,暂未对此字段进行解析
func FetchDynamics ¶
func FetchDynamics(topicId int, topicName string, sortby, offset int) (*DynamicList, error)
FetchDynamics 获取包含置顶及热门的动态列表,topicId与topicName任选一个
func GetTopicHistory ¶
func GetTopicHistory(topicId int, topicName string, offsetDynamicId int) (*DynamicList, error)
GetTopicHistory 获取历史动态列表,topicId与topicName任选一个
type DynamicLiveUserList ¶
type DynamicLiveUserList struct {
Count int `json:"count"` // 直播者数量
Group string `json:"group"` // 固定值"default",作用尚不明确
Items []struct {
Uid int `json:"uid"` // 直播者id
Uname string `json:"uname"` // 直播者昵称
Face string `json:"face"` // 直播者头像
Link string `json:"link"` // 直播链接
Title string `json:"title"` // 直播标题
} `json:"items"`
Gt int `json:"_gt_"` // 固定值0,作用尚不明确
}
func GetDynamicLiveUserList ¶
func GetDynamicLiveUserList(size int) (*DynamicLiveUserList, error)
GetDynamicLiveUserList 获取正在直播的已关注者。size是非必填项
type DynamicPortal ¶
type DynamicPortal struct {
MyInfo struct {
Dyns int `json:"dyns"` // 个人动态
Face string `json:"face"` // 头像url
FaceNft int `json:"face_nft"` // 含义尚不明确
Follower int `json:"follower"` // 粉丝数量
Following int `json:"following"` // 我的关注
LevelInfo struct {
CurrentExp int `json:"current_exp"`
CurrentLevel int `json:"current_level"` // 当前等级,0-6级
CurrentMin int `json:"current_min"`
LevelUp int64 `json:"level_up"`
NextExp int `json:"next_exp"`
} `json:"level_info"`
Mid int `json:"mid"` // 账户mid
Name string `json:"name"` // 账户名称
Official struct {
Desc string `json:"desc"` // 认证备注
Role int `json:"role"` // 认证类型,0:无,1 2 7:个人认证,3 4 5 6:机构认证
Title string `json:"title"` // 认证信息
Type int `json:"type"` // 是否认证,-1:无,0:认证
} `json:"official"`
SpaceBg string `json:"space_bg"` // 账户个人中心的背景横幅url
Vip struct {
AvatarSubscript int `json:"avatar_subscript"` // 是否显示会员图标,0:不显示,1:显示
AvatarSubscriptUrl string `json:"avatar_subscript_url"` // 大会员角标地址
DueDate int64 `json:"due_date"` // 会员过期时间,Unix时间戳(毫秒)
Label struct {
BgColor string `json:"bg_color"` // 会员标签背景颜色,颜色码,一般为#FB7299,曾用于愚人节改变大会员配色
BgStyle int `json:"bg_style"` // 固定值1,作用尚不明确
BorderColor string `json:"border_color"` // 会员标签边框颜色,未使用
ImgLabelUriHans string `json:"img_label_uri_hans"` // 固定值空
ImgLabelUriHansStatic string `json:"img_label_uri_hans_static"` // 大会员牌子图片,简体版
ImgLabelUriHant string `json:"img_label_uri_hant"` // 固定值空
ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"` // 大会员牌子图片,繁体版
LabelTheme string `json:"label_theme"` // 会员标签,vip,annual_vip,ten_annual_vip,hundred_annual_vip,fools_day_hundred_annual_vip
Path string `json:"path"` // 固定值空,作用尚不明确
Text string `json:"text"` // 会员类型文案,大会员,年度大会员,十年大会员,百年大会员,最强绿鲤鱼
TextColor string `json:"text_color"` // 会员标签文字颜色
UseImgLabel bool `json:"use_img_label"` // 固定值true
} `json:"label"`
NicknameColor string `json:"nickname_color"` // 会员昵称颜色,颜色码,一般为#FB7299,曾用于愚人节改变大会员配色
Role int `json:"role"` // 大会员类型,1:月度大会员,3:年度大会员,7:十年大会员,15:百年大会员
Status int `json:"status"` // 会员状态,0:无,1:有
ThemeType int `json:"theme_type"` // 固定值0,作用尚不明确
TvVipPayType int `json:"tv_vip_pay_type"` // 电视大会员支付类型
TvVipStatus int `json:"tv_vip_status"` // 电视大会员状态,0:未开通
Type int `json:"type"` // 会员类型,0:无,1:月大会员,2:年度及以上大会员
VipPayType int `json:"vip_pay_type"` // 支付类型,0:未支付,1:已支付
} `json:"vip"`
} `json:"my_info"`
UpList []struct {
Face string `json:"face"` // UP主头像
HasUpdate bool `json:"has_update"` // 最近是否有更新
IsReserveRecall bool `json:"is_reserve_recall"`
Mid int `json:"mid"` // UP主mid
Uname string `json:"uname"` // UP主昵称
} `json:"up_list"`
}
func GetDynamicPortal ¶
func GetDynamicPortal() (*DynamicPortal, error)
GetDynamicPortal 获取最近更新UP主列表(其实就是获取自己的动态门户)
type DynamicRepostDetail ¶
type DynamicRepostDetail struct {
HasMore int `json:"has_more"` // 是否还有下一页
Total int `json:"total"` // 总计包含
Items []struct {
Desc struct {
Uid int `json:"uid"`
Type int `json:"type"`
Rid int64 `json:"rid"`
Acl int `json:"acl"`
View int `json:"view"`
Repost int `json:"repost"`
Like int `json:"like"`
IsLiked int `json:"is_liked"`
DynamicId int64 `json:"dynamic_id"`
Timestamp int `json:"timestamp"`
PreDyId int64 `json:"pre_dy_id"`
OrigDyId int64 `json:"orig_dy_id"`
OrigType int `json:"orig_type"`
UserProfile struct {
Info struct {
Uid int `json:"uid"`
Uname string `json:"uname"`
Face string `json:"face"`
FaceNft int `json:"face_nft"`
} `json:"info"`
Card struct {
OfficialVerify struct {
Type int `json:"type"`
Desc string `json:"desc"`
} `json:"official_verify"`
} `json:"card"`
Vip struct {
VipType int `json:"vipType"`
VipDueDate int64 `json:"vipDueDate"`
VipStatus int `json:"vipStatus"`
ThemeType int `json:"themeType"`
Label struct {
Path string `json:"path"`
Text string `json:"text"`
LabelTheme string `json:"label_theme"`
TextColor string `json:"text_color"`
BgStyle int `json:"bg_style"`
BgColor string `json:"bg_color"`
BorderColor string `json:"border_color"`
} `json:"label"`
AvatarSubscript int `json:"avatar_subscript"`
NicknameColor string `json:"nickname_color"`
Role int `json:"role"`
AvatarSubscriptUrl string `json:"avatar_subscript_url"`
} `json:"vip"`
Pendant struct {
Pid int `json:"pid"`
Name string `json:"name"`
Image string `json:"image"`
Expire int `json:"expire"`
ImageEnhance string `json:"image_enhance"`
ImageEnhanceFrame string `json:"image_enhance_frame"`
} `json:"pendant"`
Rank string `json:"rank"`
Sign string `json:"sign"`
LevelInfo struct {
CurrentLevel int `json:"current_level"`
} `json:"level_info"`
} `json:"user_profile"`
UidType int `json:"uid_type"`
Stype int `json:"stype"`
RType int `json:"r_type"`
InnerId int `json:"inner_id"`
Status int `json:"status"`
DynamicIdStr string `json:"dynamic_id_str"`
PreDyIdStr string `json:"pre_dy_id_str"`
OrigDyIdStr string `json:"orig_dy_id_str"`
RidStr string `json:"rid_str"`
Origin struct {
Uid int `json:"uid"`
Type int `json:"type"`
Rid int `json:"rid"`
Acl int `json:"acl"`
View int `json:"view"`
Repost int `json:"repost"`
Like int `json:"like"`
DynamicId int64 `json:"dynamic_id"`
Timestamp int `json:"timestamp"`
PreDyId int `json:"pre_dy_id"`
OrigDyId int `json:"orig_dy_id"`
UidType int `json:"uid_type"`
Stype int `json:"stype"`
RType int `json:"r_type"`
InnerId int `json:"inner_id"`
Status int `json:"status"`
DynamicIdStr string `json:"dynamic_id_str"`
PreDyIdStr string `json:"pre_dy_id_str"`
OrigDyIdStr string `json:"orig_dy_id_str"`
RidStr string `json:"rid_str"`
} `json:"origin"`
Previous struct {
Uid int `json:"uid"`
Type int `json:"type"`
Rid int64 `json:"rid"`
Acl int `json:"acl"`
View int `json:"view"`
Repost int `json:"repost"`
Like int `json:"like"`
DynamicId int64 `json:"dynamic_id"`
Timestamp int `json:"timestamp"`
PreDyId int64 `json:"pre_dy_id"`
OrigDyId int64 `json:"orig_dy_id"`
UidType int `json:"uid_type"`
Stype int `json:"stype"`
RType int `json:"r_type"`
InnerId int `json:"inner_id"`
Status int `json:"status"`
DynamicIdStr string `json:"dynamic_id_str"`
PreDyIdStr string `json:"pre_dy_id_str"`
OrigDyIdStr string `json:"orig_dy_id_str"`
RidStr string `json:"rid_str"`
} `json:"previous"`
} `json:"desc"`
Card string `json:"card"`
ExtendJson string `json:"extend_json"`
Display struct {
Origin struct {
EmojiInfo struct {
EmojiDetails []struct {
EmojiName string `json:"emoji_name"`
Id int `json:"id"`
PackageId int `json:"package_id"`
State int `json:"state"`
Type int `json:"type"`
Attr int `json:"attr"`
Text string `json:"text"`
Url string `json:"url"`
Meta struct {
Size int `json:"size"`
} `json:"meta"`
Mtime int `json:"mtime"`
} `json:"emoji_details"`
} `json:"emoji_info"`
Relation struct {
Status int `json:"status"`
IsFollow int `json:"is_follow"`
IsFollowed int `json:"is_followed"`
} `json:"relation"`
} `json:"origin"`
Relation struct {
Status int `json:"status"`
IsFollow int `json:"is_follow"`
IsFollowed int `json:"is_followed"`
} `json:"relation"`
} `json:"display"`
} `json:"items"`
Gt int `json:"_gt_"` // 固定值0
}
func GetDynamicRepostDetail ¶
func GetDynamicRepostDetail(dynamicId, offset int) (*DynamicRepostDetail, error)
GetDynamicRepostDetail 获取动态转发列表
type DynamicUpList ¶
type DynamicUpList struct {
ButtonStatement string `json:"button_statement"` // 固定值空,作用尚不明确
Items []struct {
UserProfile struct {
Info struct {
Uid int `json:"uid"`
Uname string `json:"uname"`
Face string `json:"face"`
} `json:"info"`
Card struct {
OfficialVerify struct {
Type int `json:"type"`
Desc string `json:"desc"`
} `json:"official_verify"`
} `json:"card"`
Vip struct {
VipType int `json:"vipType"`
VipDueDate int64 `json:"vipDueDate"`
DueRemark string `json:"dueRemark"`
AccessStatus int `json:"accessStatus"`
VipStatus int `json:"vipStatus"`
VipStatusWarn string `json:"vipStatusWarn"`
ThemeType int `json:"themeType"`
Label struct {
Path string `json:"path"`
} `json:"label"`
} `json:"vip"`
Pendant struct {
Pid int `json:"pid"`
Name string `json:"name"`
Image string `json:"image"`
Expire int `json:"expire"`
ImageEnhance string `json:"image_enhance"`
} `json:"pendant"`
Rank string `json:"rank"`
Sign string `json:"sign"`
LevelInfo struct {
CurrentLevel int `json:"current_level"`
CurrentMin int `json:"current_min"`
CurrentExp int `json:"current_exp"`
NextExp string `json:"next_exp"`
} `json:"level_info"`
} `json:"user_profile"`
HasUpdate int `json:"has_update"`
} `json:"items"`
Gt int `json:"_gt_"` // 固定值0,作用尚不明确
}
func GetDynamicUpList ¶
func GetDynamicUpList(size int) (*DynamicUpList, error)
GetDynamicUpList 获取发布新动态的已关注者。size参数,0:不开启青少年模式,1:开启青少年模式
type FavourFolderInfo ¶
type FavourFolderInfo struct {
Id int `json:"id"` // 收藏夹mlid(完整id),收藏夹原始id+创建者mid尾号2位
Fid int `json:"fid"` // 收藏夹原始id
Mid int `json:"mid"` // 创建者mid
Attr int `json:"attr"` // 属性位(?)
Title string `json:"title"` // 收藏夹标题
Cover string `json:"cover"` // 收藏夹封面图片url
Upper struct {
Mid int `json:"mid"` // 创建者mid
Name string `json:"name"` // 创建者昵称
Face string `json:"face"` // 创建者头像url
Followed bool `json:"followed"` // 是否已关注创建者
VipType int `json:"vip_type"` // 会员类别,0:无,1:月大会员,2:年度及以上大会员
VipStatue int `json:"vip_statue"` // 0:无,1:有
} `json:"upper"`
CoverType int `json:"cover_type"` // 封面图类别(?)
CntInfo struct {
Collect int `json:"collect"` // 收藏数
Play int `json:"play"` // 播放数
ThumbUp int `json:"thumb_up"` // 点赞数
Share int `json:"share"` // 分享数
} `json:"cnt_info"`
Type int `json:"type"` // 类型(?)
Intro string `json:"intro"` // 备注
Ctime int `json:"ctime"` // 创建时间戳
Mtime int `json:"mtime"` // 收藏时间戳
State int `json:"state"` // 状态(?)
FavState int `json:"fav_state"` // 收藏夹收藏状态,已收藏:1,未收藏:0
LikeState int `json:"like_state"` // 点赞状态,已点赞:1,未点赞:0
MediaCount int `json:"media_count"` // 收藏夹内容数量
}
func AddFavourFolder ¶
func AddFavourFolder(title, intro string, privacy bool, cover string) (*FavourFolderInfo, error)
AddFavourFolder 新建收藏夹
title:收藏夹标题,必填。intro:收藏夹简介,非必填。 privacy:是否为私密收藏夹。cover:封面图url。
func EditFavourFolder ¶
func EditFavourFolder(mediaId int, title, intro string, privacy bool, cover string) (*FavourFolderInfo, error)
EditFavourFolder 修改收藏夹
media_id:目标收藏夹mdid,必填。 title:收藏夹标题,必填。intro:收藏夹简介,非必填。 privacy:是否为私密收藏夹。cover:封面图url。
func GetFavourFolderInfo ¶
func GetFavourFolderInfo(mediaId int) (*FavourFolderInfo, error)
GetFavourFolderInfo 获取收藏夹元数据
type FavourId ¶
type FavourInfo ¶
type FavourInfo struct {
Id int `json:"id"`
Type int `json:"type"`
Title string `json:"title"`
Cover string `json:"cover"`
Intro string `json:"intro"`
Page int `json:"page"`
Duration int `json:"duration"`
Upper struct {
Mid int `json:"mid"`
Name string `json:"name"`
Face string `json:"face"`
} `json:"upper"`
Attr int `json:"attr"`
CntInfo struct {
Collect int `json:"collect"`
Play int `json:"play"`
Danmaku int `json:"danmaku"`
} `json:"cnt_info"`
Link string `json:"link"`
Ctime int `json:"ctime"`
Pubtime int `json:"pubtime"`
FavTime int `json:"fav_time"`
BvId string `json:"bv_id"`
Bvid string `json:"bvid"`
Season interface{} `json:"season"`
}
func GetFavourInfo ¶
func GetFavourInfo(resources []Resource, platform string) ([]*FavourInfo, error)
GetFavourInfo 获取收藏内容
type FavourList ¶
type FavourList struct {
Info struct {
Id int `json:"id"` // 收藏夹mlid(完整id),收藏夹原始id+创建者mid尾号2位
Fid int `json:"fid"` // 收藏夹原始id
Mid int `json:"mid"` // 创建者mid
Attr int `json:"attr"` // 属性,0:正常,1:失效
Title string `json:"title"` // 收藏夹标题
Cover string `json:"cover"` // 收藏夹封面图片url
Upper struct {
Mid int `json:"mid"` // 创建者mid
Name string `json:"name"` // 创建者昵称
Face string `json:"face"` // 创建者头像url
Followed bool `json:"followed"` // 是否已关注创建者
VipType int `json:"vip_type"` // 会员类别,0:无,1:月大会员,2:年度及以上大会员
VipStatue int `json:"vip_statue"` // 会员开通状态,0:无,1:有
} `json:"upper"`
CoverType int `json:"cover_type"` // 封面图类别(?)
CntInfo struct {
Collect int `json:"collect"` // 收藏数
Play int `json:"play"` // 播放数
ThumbUp int `json:"thumb_up"` // 点赞数
Share int `json:"share"` // 分享数
} `json:"cnt_info"`
Type int `json:"type"` // 类型(?),一般是11
Intro string `json:"intro"` // 备注
Ctime int `json:"ctime"` // 创建时间戳
Mtime int `json:"mtime"` // 收藏时间戳
State int `json:"state"` // 状态(?),一般为0
FavState int `json:"fav_state"` // 收藏夹收藏状态,已收藏收藏夹:1,未收藏收藏夹:0
LikeState int `json:"like_state"` // 点赞状态,已点赞:1,未点赞:0
MediaCount int `json:"media_count"` // 收藏夹内容数量
} `json:"info"`
Medias []struct {
Id int `json:"id"` // 内容id,视频稿件:视频稿件avid,音频:音频auid,视频合集:视频合集id
Type int `json:"type"` // 内容类型,2:视频稿件,12:音频,21:视频合集
Title string `json:"title"` // 标题
Cover string `json:"cover"` // 封面url
Intro string `json:"intro"` // 简介
Page int `json:"page"` // 视频分P数
Duration int `json:"duration"` // 音频/视频时长
Upper struct {
Mid int `json:"mid"` // UP主mid
Name string `json:"name"` // UP主昵称
Face string `json:"face"` // UP主头像url
} `json:"upper"`
Attr int `json:"attr"` // 属性位(?)
CntInfo struct {
Collect int `json:"collect"` // 收藏数
Play int `json:"play"` // 播放数
Danmaku int `json:"danmaku"` // 弹幕数
} `json:"cnt_info"`
Link string `json:"link"` // 跳转uri
Ctime int `json:"ctime"` // 投稿时间戳
Pubtime int `json:"pubtime"` // 发布时间戳
FavTime int `json:"fav_time"` // 收藏时间戳
BvId string `json:"bv_id"` // 视频稿件bvid
Bvid string `json:"bvid"` // 视频稿件bvid
} `json:"medias"`
HasMore bool `json:"has_more"`
}
func GetFavourList ¶
func GetFavourList(mediaId, tid int, keyword, order string, searchType, ps, pn int, platform string) (*FavourList, error)
GetFavourList 获取收藏夹内容明细列表
type FormatCtrl ¶
type GetUserVideosResult ¶
type GetUserVideosResult struct {
List struct {
Tlist map[int]struct {
Count int `json:"count"` // 投稿至该分区的视频数
Name string `json:"name"` // 该分区名称
Tid int `json:"tid"` // 该分区tid
} `json:"tlist"`
Vlist []Video `json:"vlist"` // 投稿视频列表
} `json:"list"`
Page struct {
Count int `json:"count"` // 总计稿件数
Pn int `json:"pn"` // 当前页码
Ps int `json:"ps"` // 每页项数
} `json:"page"`
EpisodicButton struct {
Text string `json:"text"` // 按钮文字
Uri string `json:"uri"` // 全部播放页url
} `json:"episodic_button"`
}
func GetUserVideos ¶
func GetUserVideos(mid int, order OrderType, tid int, keyword string, pn int, ps int) (*GetUserVideosResult, error)
GetUserVideos 获取用户投稿视频明细
type GoodsSku ¶
type GoodsSku struct {
Base struct {
Token string `json:"token"` // 商品token
Title string `json:"title"` // 商品名称
Picture string `json:"picture"` // 商品图片url
RotationPictures []string `json:"rotation_pictures"` // 商品图片组
Price struct {
Origin int `json:"origin"` // 商品原价,单位为积分
Promotion *struct {
Price int `json:"price"` // 折后价格,单位为积分
Type int `json:"type"` // 折扣类型,1:普通折扣,2:秒杀
Discount int `json:"discount"` // 折扣力度
Label string `json:"label"` // 标签文案
} `json:"promotion"`
} `json:"price"`
Inventory struct {
AvailableNum int `json:"available_num"` // 库存总量
UsedNum int `json:"used_num"` // 已售数量
SurplusNum int `json:"surplus_num"` // 剩余数量
} `json:"inventory"`
UserType int `json:"user_type"`
ExchangeLimitType int `json:"exchange_limit_type"`
ExchangeLimitNum int `json:"exchange_limit_num"` // 限购数量
StartTime int `json:"start_time"` // 起售时间戳,单位:秒
EndTime int `json:"end_time"` // 止售时间,单位:秒
State int `json:"state"` // 状态,固定值2
} `json:"base"`
}
type HotReply ¶
type HotReply struct {
Page struct {
Acount int `json:"acount"` // 总评论数
Count int `json:"count"` // 热评数
Num int `json:"num"` // 当前页码
Size int `json:"size"` // 每页项数
} `json:"page"`
Replies []Comment `json:"replies"` // 热评列表
}
HotReply 视频热评信息
func GetVideoComment ¶
GetVideoComment 获取视频评论,sort:0按时间、1按点赞数、2按回复数
oidType:见 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/comment/readme.md
type LikeCoinFavourResult ¶
type LikeCoinFavourResult struct {
Like bool `json:"like"` // 是否点赞成功
Coin bool `json:"coin"` // 是否投币成功
Fav bool `json:"fav"` // 是否收藏成功
Multiply int `json:"multiply"` // 投币枚数
}
func LikeCoinFavourVideoByAvid ¶
func LikeCoinFavourVideoByAvid(avid int) (*LikeCoinFavourResult, error)
LikeCoinFavourVideoByAvid 通过Avid一键三连视频
func LikeCoinFavourVideoByBvid ¶
func LikeCoinFavourVideoByBvid(bvid string) (*LikeCoinFavourResult, error)
LikeCoinFavourVideoByBvid 通过Bvid一键三连视频
func LikeCoinFavourVideoByShortUrl ¶
func LikeCoinFavourVideoByShortUrl(shortUrl string) (*LikeCoinFavourResult, error)
LikeCoinFavourVideoByShortUrl 通过短链接一键三连视频
type LiveAreaData ¶
type OfficialInfo ¶
type OfficialInfo struct {
Role int `json:"role"` // 成员认证级别,0:无,1 2 7:个人认证,3 4 5 6:机构认证
Title string `json:"title"` // 成员认证名
Desc string `json:"desc"` // 成员认证备注
Type int `json:"type"` // 成员认证类型,-1:无,0:有
}
OfficialInfo 成员认证信息
type OfficialVerify ¶
type QRCode ¶
type QRCode struct {
Url string `json:"url"` // 二维码内容url
QrcodeKey string `json:"qrcode_key"` // 扫码登录秘钥
}
type Resource ¶
type Resource struct {
Id int
Type ResourceType
}
type ResourceType ¶
type ResourceType int
type RoomInfo ¶
type RoomInfo struct {
Uid int `json:"uid"`
RoomId int `json:"room_id"` // 直播间id
ShortId int `json:"short_id"`
Attention int `json:"attention"`
Online int `json:"online"` // 直播间人气,值为上次直播时刷新
IsPortrait bool `json:"is_portrait"`
Description string `json:"description"`
LiveStatus int `json:"live_status"` // 直播状态,0:未开播,1:直播中
AreaId int `json:"area_id"`
ParentAreaId int `json:"parent_area_id"`
ParentAreaName string `json:"parent_area_name"`
OldAreaId int `json:"old_area_id"`
Background string `json:"background"`
Title string `json:"title"` // 直播间标题
UserCover string `json:"user_cover"`
Keyframe string `json:"keyframe"`
IsStrictRoom bool `json:"is_strict_room"`
LiveTime string `json:"live_time"`
Tags string `json:"tags"`
IsAnchor int `json:"is_anchor"`
RoomSilentType string `json:"room_silent_type"`
RoomSilentLevel int `json:"room_silent_level"`
RoomSilentSecond int `json:"room_silent_second"`
AreaName string `json:"area_name"`
Pendants string `json:"pendants"`
AreaPendants string `json:"area_pendants"`
HotWords []string `json:"hot_words"`
HotWordsStatus int `json:"hot_words_status"`
Verify string `json:"verify"`
NewPendants struct {
Frame struct {
Name string `json:"name"`
Value string `json:"value"`
Position int `json:"position"`
Desc string `json:"desc"`
Area int `json:"area"`
AreaOld int `json:"area_old"`
BgColor string `json:"bg_color"`
BgPic string `json:"bg_pic"`
UseOldArea bool `json:"use_old_area"`
} `json:"frame"`
//Badge interface{} `json:"badge"`
MobileFrame struct {
Name string `json:"name"`
Value string `json:"value"`
Position int `json:"position"`
Desc string `json:"desc"`
Area int `json:"area"`
AreaOld int `json:"area_old"`
BgColor string `json:"bg_color"`
BgPic string `json:"bg_pic"`
UseOldArea bool `json:"use_old_area"`
} `json:"mobile_frame"`
} `json:"new_pendants"`
UpSession string `json:"up_session"`
PkStatus int `json:"pk_status"`
PkId int `json:"pk_id"`
BattleId int `json:"battle_id"`
AllowChangeAreaTime int `json:"allow_change_area_time"`
AllowUploadCoverTime int `json:"allow_upload_cover_time"`
StudioInfo struct {
Status int `json:"status"`
} `json:"studio_info"`
}
func GetRoomInfo ¶
GetRoomInfo 获取直播间状态
SocialSisterYi/bilibili-API-collect 文档中的接口已经无法使用了。下面的实现是参照 https://github.com/SocialSisterYi/bilibili-API-collect/issues/272 的接口,已验证,可以使用。
type SearchDynamicAtResult ¶
type SearchDynamicAtResult struct {
Groups []struct {
GroupType int `json:"group_type"` // 2:我的关注,4:其他
GroupName string `json:"group_name"` // 分组名字
Items []struct {
Uid int `json:"uid"` // 用户id
Uname string `json:"uname"` // 用户昵称
Face string `json:"face"` // 用户头像url
Fans int `json:"fans"` // 用户粉丝数
OfficialVerifyType int `json:"official_verify_type"`
} `json:"items"`
} `json:"groups"`
Gt int `json:"_gt_"` // 固定值0
}
func SearchDynamicAt ¶
func SearchDynamicAt(uid int, keyword string) (*SearchDynamicAtResult, error)
SearchDynamicAt 根据关键字搜索用户(at别人时的填充列表)
type SessionList ¶
type SessionList struct {
SessionList []struct {
TalkerId int64 `json:"talker_id"`
SessionType int `json:"session_type"`
AtSeqno int `json:"at_seqno"`
TopTs int `json:"top_ts"`
GroupName string `json:"group_name"`
GroupCover string `json:"group_cover"`
IsFollow int `json:"is_follow"`
IsDnd int `json:"is_dnd"`
AckSeqno int64 `json:"ack_seqno"`
AckTs int64 `json:"ack_ts"`
SessionTs int64 `json:"session_ts"`
UnreadCount int `json:"unread_count"`
LastMsg struct {
SenderUid int64 `json:"sender_uid"`
ReceiverType int `json:"receiver_type"`
ReceiverId int `json:"receiver_id"`
MsgType int `json:"msg_type"`
Content string `json:"content"`
MsgSeqno int64 `json:"msg_seqno"`
Timestamp int `json:"timestamp"`
MsgKey int64 `json:"msg_key"`
MsgStatus int `json:"msg_status"`
NotifyCode string `json:"notify_code"`
NewFaceVersion int `json:"new_face_version,omitempty"`
} `json:"last_msg"`
GroupType int `json:"group_type"`
CanFold int `json:"can_fold"`
Status int `json:"status"`
MaxSeqno int64 `json:"max_seqno"`
NewPushMsg int `json:"new_push_msg"`
Setting int `json:"setting"`
IsGuardian int `json:"is_guardian"`
IsIntercept int `json:"is_intercept"`
IsTrust int `json:"is_trust"`
SystemMsgType int `json:"system_msg_type"`
LiveStatus int `json:"live_status"`
BizMsgUnreadCount int `json:"biz_msg_unread_count"`
AccountInfo struct {
Name string `json:"name"`
PicUrl string `json:"pic_url"`
} `json:"account_info,omitempty"`
} `json:"session_list"`
HasMore int `json:"has_more"`
AntiDisturbCleaning bool `json:"anti_disturb_cleaning"`
IsAddressListEmpty int `json:"is_address_list_empty"`
SystemMsg map[string]int64 `json:"system_msg"`
ShowLevel bool `json:"show_level"`
}
func GetSessions ¶
func GetSessions(sessionType int, mobiApp string) (*SessionList, error)
GetSessions 获取消息列表 session_type,1:系统,2:用户,3:应援团
type SessionMessages ¶
type SessionMessages struct {
Messages []struct {
SenderUid int `json:"sender_uid"` // 发送者uid
ReceiverType int `json:"receiver_type"` // 1为用户,2为粉丝团
ReceiverId int `json:"receiver_id"` // 接收者uid
MsgType int `json:"msg_type"` // 消息类型,1:文字消息,2:图片消息,5:撤回的消息,12、13:通知
Content string `json:"content"` // 消息内容
MsgSeqno int64 `json:"msg_seqno"` // 作用尚不明确
Timestamp int `json:"timestamp"` // 消息发送时间戳
AtUids []int `json:"at_uids"` // 作用尚不明确
MsgKey int64 `json:"msg_key"` // 作用尚不明确
MsgStatus int `json:"msg_status"` // 固定值0
NotifyCode string `json:"notify_code"` // 作用尚不明确
NewFaceVersion int `json:"new_face_version,omitempty"` // 作用尚不明确
} `json:"messages"`
HasMore int `json:"has_more"` // 固定值0
MinSeqno int64 `json:"min_seqno"` // 作用尚不明确
MaxSeqno int64 `json:"max_seqno"` // 作用尚不明确
EInfos []struct {
Text string `json:"text"` // 表情名称
Url string `json:"url"` // 表情链接
Size int `json:"size"` // 表情尺寸
} `json:"e_infos"`
}
func GetSessionMessages ¶
func GetSessionMessages(talkerId, sessionType, size int, mobiApp string) (*SessionMessages, error)
GetSessionMessages 获取私信消息记录
type StartLiveResult ¶
type StartLiveResult struct {
Change int `json:"change"` // 是否改变状态,0:未改变,1:改变
Status string `json:"status"` // 固定值LIVE
RoomType int `json:"room_type"` // 固定值0,作用尚不明确
Rtmp struct {
Addr string `json:"addr"` // RTMP推流(发送)地址,重要
Code string `json:"code"` // RTMP推流参数(密钥),重要
NewLink string `json:"new_link"` // 获取CDN推流ip地址重定向信息的url,没啥用
Provider string `json:"provider"` // 作用尚不明确
} `json:"rtmp"`
Protocols []struct {
Protocol string `json:"protocol"` // 固定值RTMP,作用尚不明确
Addr string `json:"addr"` // RTMP推流(发送)地址
Code string `json:"code"` // RTMP推流参数(密钥)
NewLink string `json:"new_link"` // 获取CDN推流ip地址重定向信息的url
Provider string `json:"provider"` // 固定值txy,作用尚不明确
} `json:"protocols"`
TryTime string `json:"try_time"` // 作用尚不明确
LiveKey string `json:"live_key"` // 作用尚不明确
Notice struct {
Type int `json:"type"` // 固定值1,作用尚不明确
Status int `json:"status"` // 固定值0,作用尚不明确
Title string `json:"title"` // 固定值空,作用尚不明确
Msg string `json:"msg"` // 固定值空,作用尚不明确
ButtonText string `json:"button_text"` // 固定值空,作用尚不明确
ButtonUrl string `json:"button_url"` // 固定值空,作用尚不明确
} `json:"notice"`
}
type UnreadMessage ¶
type UnreadPrivateMessage ¶
type UnreadPrivateMessage struct {
UnfollowUnread int `json:"unfollow_unread"` // 未关注用户未读私信数
FollowUnread int `json:"follow_unread"` // 已关注用户未读私信数
Gt int `json:"_gt_"` // 固定值0,作用尚不明确
}
func GetUnreadPrivateMessage ¶
func GetUnreadPrivateMessage() (*UnreadPrivateMessage, error)
GetUnreadPrivateMessage 获取未读私信数
type UpdateLiveResult ¶
type UserArticleList ¶
type UserArticleList struct {
Articles []struct {
Id int `json:"id"` // 专栏文章id
Category struct {
Id int `json:"id"` // 分类id
ParentId int `json:"parent_id"` // 父级分类id
Name string `json:"name"` // 分类名称
} `json:"category"`
Categories []struct {
Id int `json:"id"` // 分类id
ParentId int `json:"parent_id"` // 父级分类id
Name string `json:"name"` // 分类名称
} `json:"categories"`
Title string `json:"title"` // 标题
Summary string `json:"summary"` // 摘要
BannerUrl string `json:"banner_url"` // 封面图
TemplateId int `json:"template_id"`
State int `json:"state"`
Author struct {
Mid int `json:"mid"` // 用户uid
Name string `json:"name"` // 用户名
Face string `json:"face"` // 头像
Pendant struct {
Pid int `json:"pid"` // 头像框id
Name string `json:"name"` // 头像框名称
Image string `json:"image"` // 头像框图片url
Expire int `json:"expire"` // 过期时间
} `json:"pendant"`
OfficialVerify struct {
Type int `json:"type"` // 是否认证,-1:无,0:个人认证,1:机构认证
Desc string `json:"desc"` // 认证备注
} `json:"official_verify"`
Nameplate struct {
Nid int `json:"nid"` // 勋章id
Name string `json:"name"` // 勋章名称
Image string `json:"image"` // 勋章图标
ImageSmall string `json:"image_small"` // 勋章图标(小)
Level string `json:"level"` // 勋章等级
Condition string `json:"condition"` // 获取条件
} `json:"nameplate"`
Vip struct {
Type int `json:"type"` // 大会员类型,0:无,1:月大会员,2:年度及以上大会员
Status int `json:"status"` // 大会员状态,0:无,1:有
DueDate int `json:"due_date"` // 大会员过期时间时间戳,单位:毫秒
VipPayType int `json:"vip_pay_type"` // 支付类型
ThemeType int `json:"theme_type"` // 固定值0
Label struct {
Path string `json:"path"` // 空串
Text string `json:"text"` // 会员类型文案,大会员,年度大会员,十年大会员,百年大会员,最强绿鲤鱼
LabelTheme string `json:"label_theme"` // 会员标签,vip,annual_vip,ten_annual_vip,hundred_annual_vip,fools_day_hundred_annual_vip
} `json:"label"`
AvatarSubscript int `json:"avatar_subscript"` // 是否显示大会员图标,0:不显示,1:显示
NicknameColor string `json:"nickname_color"` // 大会员昵称颜色
} `json:"vip"`
} `json:"author"`
Reprint int `json:"reprint"`
ImageUrls []string `json:"image_urls"`
PublishTime int `json:"publish_time"` // 发布时间戳,单位:秒
Ctime int `json:"ctime"` // 提交时间戳,单位:秒
Stats struct {
View int `json:"view"` // 浏览数
Favorite int `json:"favorite"` // 收藏数
Like int `json:"like"` // 点赞数
Dislike int `json:"dislike"` // 点踩数
Reply int `json:"reply"` // 回复数
Share int `json:"share"` // 转发数
Coin int `json:"coin"` // 投币数
Dynamic int `json:"dynamic"`
} `json:"stats"`
Words int `json:"words"`
Dynamic string `json:"dynamic"` // 粉丝动态文案
OriginImageUrls []string `json:"origin_image_urls"`
IsLike bool `json:"is_like"`
Media struct {
Score int `json:"score"`
MediaId int `json:"media_id"`
Title string `json:"title"`
Cover string `json:"cover"`
Area string `json:"area"`
TypeId int `json:"type_id"`
TypeName string `json:"type_name"`
Spoiler int `json:"spoiler"`
} `json:"media"`
ApplyTime string `json:"apply_time"`
CheckTime string `json:"check_time"`
Original int `json:"original"`
ActId int `json:"act_id"`
CoverAvid int `json:"cover_avid"`
Type int `json:"type"`
Tags []struct {
Tid int `json:"tid"` // 标签id
Name string `json:"name"` // 标签名称
} `json:"tags,omitempty"`
} `json:"articles"`
Pn int `json:"pn"` // 本次请求分页页数
Ps int `json:"ps"` // 本次请求分页大小
Count int `json:"count"` // 专栏文章总数
}
func GetUserArticleList ¶
func GetUserArticleList(mid, pn, ps int, sort string) (*UserArticleList, error)
GetUserArticleList 获取用户专栏文章列表。sort可选值"publish_time","view","fav",不填默认"publish_time"。
type UserArticlesList ¶
type UserArticlesList struct {
Lists []struct {
Id int `json:"id"` // 文集id
Mid int `json:"mid"` // 作者uid
Name string `json:"name"` // 文集名称
ImageUrl string `json:"image_url"` // 封面
UpdateTime int `json:"update_time"` // 最后更新时间戳,单位:秒
Ctime int `json:"ctime"` // 创建时间戳,单位:秒
PublishTime int `json:"publish_time"` // 发布时间戳,单位:秒
Summary string `json:"summary"`
Words int `json:"words"` // 总字数
Read int `json:"read"` // 阅读量
ArticlesCount int `json:"articles_count"` // 包含文章数
State int `json:"state"` // 固定值1
Reason string `json:"reason"`
ApplyTime string `json:"apply_time"`
CheckTime string `json:"check_time"`
} `json:"lists"`
Total int `json:"total"` // 文集总数
}
func GetUserArticlesList ¶
func GetUserArticlesList(mid, sort int) (*UserArticlesList, error)
GetUserArticlesList 获取用户专栏文集列表。sort可选值,0:最近更新,1:最多阅读。
type UserCardResult ¶
type UserCardResult struct {
Card struct {
Mid string `json:"mid"`
Name string `json:"name"`
Approve bool `json:"approve"`
Sex string `json:"sex"`
Rank string `json:"rank"`
Face string `json:"face"`
FaceNft int `json:"face_nft"`
FaceNftType int `json:"face_nft_type"`
DisplayRank string `json:"DisplayRank"`
Regtime int `json:"regtime"`
Spacesta int `json:"spacesta"`
Birthday string `json:"birthday"`
Place string `json:"place"`
Description string `json:"description"`
Article int `json:"article"`
Attentions []interface{} `json:"attentions"`
Fans int `json:"fans"`
Friend int `json:"friend"`
Attention int `json:"attention"`
Sign string `json:"sign"`
LevelInfo struct {
CurrentLevel int `json:"current_level"`
CurrentMin int `json:"current_min"`
CurrentExp int `json:"current_exp"`
NextExp int `json:"next_exp"`
} `json:"level_info"`
Pendant struct {
Pid int `json:"pid"`
Name string `json:"name"`
Image string `json:"image"`
Expire int `json:"expire"`
ImageEnhance string `json:"image_enhance"`
ImageEnhanceFrame string `json:"image_enhance_frame"`
NPid int `json:"n_pid"`
} `json:"pendant"`
Nameplate struct {
Nid int `json:"nid"`
Name string `json:"name"`
Image string `json:"image"`
ImageSmall string `json:"image_small"`
Level string `json:"level"`
Condition string `json:"condition"`
} `json:"nameplate"`
Official struct {
Role int `json:"role"`
Title string `json:"title"`
Desc string `json:"desc"`
Type int `json:"type"`
} `json:"Official"`
OfficialVerify struct {
Type int `json:"type"`
Desc string `json:"desc"`
} `json:"official_verify"`
Vip struct {
Type int `json:"type"`
Status int `json:"status"`
DueDate int64 `json:"due_date"`
VipPayType int `json:"vip_pay_type"`
ThemeType int `json:"theme_type"`
Label struct {
Path string `json:"path"`
Text string `json:"text"`
LabelTheme string `json:"label_theme"`
TextColor string `json:"text_color"`
BgStyle int `json:"bg_style"`
BgColor string `json:"bg_color"`
BorderColor string `json:"border_color"`
UseImgLabel bool `json:"use_img_label"`
ImgLabelURIHans string `json:"img_label_uri_hans"`
ImgLabelURIHant string `json:"img_label_uri_hant"`
ImgLabelURIHansStatic string `json:"img_label_uri_hans_static"`
ImgLabelURIHantStatic string `json:"img_label_uri_hant_static"`
} `json:"label"`
AvatarSubscript int `json:"avatar_subscript"`
NicknameColor string `json:"nickname_color"`
Role int `json:"role"`
AvatarSubscriptURL string `json:"avatar_subscript_url"`
TvVipStatus int `json:"tv_vip_status"`
TvVipPayType int `json:"tv_vip_pay_type"`
TvDueDate int `json:"tv_due_date"`
AvatarIcon struct {
IconType int `json:"icon_type"`
IconResource struct {
} `json:"icon_resource"`
} `json:"avatar_icon"`
VipType int `json:"vipType"`
VipStatus int `json:"vipStatus"`
} `json:"vip"`
IsSeniorMember int `json:"is_senior_member"`
} `json:"card"`
Space *struct {
SImg string `json:"s_img,omitempty"`
LImg string `json:"l_img,omitempty"`
} `json:"space,omitempty"`
Following bool `json:"following"`
ArchiveCount int `json:"archive_count"`
ArticleCount int `json:"article_count"`
Follower int `json:"follower"`
LikeNum int `json:"like_num"`
}
func GetUserCard ¶
func GetUserCard(mid int, photo bool) (*UserCardResult, error)
GetUserCard 获取用户用户名片 免登录 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/user/info.md#%E7%94%A8%E6%88%B7%E5%90%8D%E7%89%87%E4%BF%A1%E6%81%AF
type Video ¶
type Video struct {
Aid int `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 int `json:"mid"` // 视频UP主mid,不一定为目标用户(合作视频)
Pic string `json:"pic"` // 视频封面
Play int `json:"play"` // 视频播放次数
Review int `json:"review"` // 固定值0,作用尚不明确
Subtitle string `json:"subtitle"` // 固定值空,作用尚不明确
Title string `json:"title"` // 视频标题
Typeid int `json:"typeid"` // 视频分区tid
VideoReview int `json:"video_review"` // 视频弹幕数
}
type VideoDetailInfo ¶
type VideoDetailInfo struct {
View VideoInfo `json:"View"` // 视频基本信息
Card struct {
Card struct {
Mid string `json:"mid"` // 用户mid
Name string `json:"name"` // 用户昵称
Approve bool `json:"approve"` // 固定值false,作用尚不明确
Sex string `json:"sex"` // 用户性别 男 女 保密
Rank string `json:"rank"` // 固定值"10000",作用尚不明确
Face string `json:"face"` // 用户头像链接
FaceNft int `json:"face_nft"` // 是否为 nft 头像,0:不是nft头像,1:是 nft 头像
FaceNftType int `json:"face_nft_type"` // ntf 头像类型
DisplayRank string `json:"DisplayRank"` // 固定值"0",作用尚不明确
Regtime int `json:"regtime"` // 固定值0,作用尚不明确
Spacesta int `json:"spacesta"` // 固定值0,作用尚不明确
Birthday string `json:"birthday"` // 固定值"",作用尚不明确
Place string `json:"place"` // 固定值"",作用尚不明确
Description string `json:"description"` // 固定值"",作用尚不明确
Article int `json:"article"` // 固定值0,作用尚不明确
Fans int `json:"fans"` // 粉丝数
Friend int `json:"friend"` // 关注数
Attention int `json:"attention"` // 关注数
Sign string `json:"sign"` // 签名
LevelInfo struct {
CurrentLevel int `json:"current_level"` // 当前等级,0-6级
CurrentMin int `json:"current_min"` // 固定值0,作用尚不明确
CurrentExp int `json:"current_exp"` // 固定值0,作用尚不明确
NextExp int `json:"next_exp"` // 固定值0,作用尚不明确
} `json:"level_info"`
Pendant Pendant `json:"pendant"` // 挂件
Nameplate NamePlate `json:"nameplate"` // 勋章
Official OfficialInfo `json:"Official"` // 认证信息
OfficialVerify OfficialVerify `json:"official_verify"` // 认证信息2
Vip Vip `json:"vip"` // 大会员状态
IsSeniorMember int `json:"is_senior_member"` // 是否为硬核会员,0:否,1:是
} `json:"card"`
Space struct {
SImg string `json:"s_img"` // 主页头图url 小图
LImg string `json:"l_img"` // 主页头图url 正常
} `json:"space"`
Following bool `json:"following"` // 是否关注此用户,true:已关注,false:未关注,需要登录(Cookie),未登录为false
ArchiveCount int `json:"archive_count"` // 用户稿件数
ArticleCount int `json:"article_count"` // 固定值0,作用尚不明确
Follower int `json:"follower"` // 粉丝数
LikeNum int `json:"like_num"` // UP主获赞次数
} `json:"Card"`
Tags []VideoTag `json:"Tags"` // 视频TAG信息
Reply HotReply `json:"Reply"` // 视频热评信息
Related []VideoInfo `json:"Related"` // 推荐视频信息
Show bool `json:"show"` // 固定为false,作用尚不明确
} `json:"hot_share"`
ViewAddit struct {
Field1 bool `json:"63"` // 固定为false,作用尚不明确
Field2 bool `json:"64"` // 固定为false,作用尚不明确
} `json:"view_addit"`
}
func GetVideoDetailInfoByAvid ¶
func GetVideoDetailInfoByAvid(avid int) (*VideoDetailInfo, error)
GetVideoDetailInfoByAvid 通过Avid获取视频超详细信息
func GetVideoDetailInfoByBvid ¶
func GetVideoDetailInfoByBvid(bvid string) (*VideoDetailInfo, error)
GetVideoDetailInfoByBvid 通过Bvid获取视频超详细信息
func GetVideoDetailInfoByShortUrl ¶
func GetVideoDetailInfoByShortUrl(shortUrl string) (*VideoDetailInfo, error)
GetVideoDetailInfoByShortUrl 通过短链接获取视频超详细信息
type VideoDimension ¶
type VideoInfo ¶
type VideoInfo struct {
Bvid string `json:"bvid"` // 稿件bvid
Aid int `json:"aid"` // 稿件avid
Videos int `json:"videos"` // 稿件分P总数,默认为1
Tid int `json:"tid"` // 分区tid
Tname string `json:"tname"` // 子分区名称
Copyright int `json:"copyright"` // 1:原创,2:转载
Pic string `json:"pic"` // 稿件封面图片url
Title string `json:"title"` // 稿件标题
Pubdate int64 `json:"pubdate"` // 稿件发布时间戳
Ctime int64 `json:"ctime"` // 用户投稿时间戳
Desc string `json:"desc"` // 视频简介
DescV2 []struct {
RawText string `json:"raw_text"` // 简介内容
Type int `json:"type"` // 作用尚不明确
BizId int `json:"biz_id"` // 作用尚不明确
} `json:"desc_v2"`
State int `json:"state"` // 视频状态
Duration int `json:"duration"` // 稿件总时长(所有分P,单位:秒)
Forward int `json:"forward"` // 撞车视频跳转avid
MissionId int `json:"mission_id"` // 稿件参与的活动id
RedirectUrl string `json:"redirect_url"` // 重定向url,仅番剧或影视视频存在此字段
Rights 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,作用尚不明确
CleanMode int `json:"clean_mode"`
Is360 int `json:"is_360"`
NoShare int `json:"no_share"`
ArcPay int `json:"arc_pay"`
FreeWatch int `json:"free_watch"`
}
Owner struct {
Mid int `json:"mid"` // UP主mid
Name string `json:"name"` // UP主昵称
Face string `json:"face"` // UP主头像url
} `json:"owner"`
Stat struct {
Aid int `json:"aid"` // 稿件avid
View int `json:"view"` // 播放数
Danmaku int `json:"danmaku"` // 弹幕数
Reply int `json:"reply"` // 评论数
Favorite int `json:"favorite"` // 收藏数
Coin int `json:"coin"` // 投币数
Share int `json:"share"` // 分享数
NowRank int `json:"now_rank"` // 当前排名
HisRank int `json:"his_rank"` // 历史最高排行
Like int `json:"like"` // 获赞数
Dislike int `json:"dislike"` // 点踩数,恒为0
Evaluation string `json:"evaluation"` // 视频评分
ArgueMsg string `json:"argue_msg"` // 警告/争议提示信息
} `json:"stat"`
Dynamic string `json:"dynamic"` // 视频同步发布的的动态的文字内容
Cid int `json:"cid"` // 视频1P cid
Dimension VideoDimension `json:"dimension"` // 视频1P分辨率
TeenageMode int `json:"teenage_mode"`
IsChargeableSeason bool `json:"is_chargeable_season"`
NoCache bool `json:"no_cache"` // 固定值true,作用尚不明确
Pages []struct {
Cid int `json:"cid"` // 当前分P cid
Page int `json:"page"` // 当前分P
From string `json:"from"` // 视频来源,vupload:普通上传(B站),hunan:芒果TV,qq:腾讯
Part string `json:"part"` // 当前分P标题
Duration int `json:"duration"` // 当前分P持续时间(单位:秒)
Vid string `json:"vid"` // 站外视频vid,仅站外视频有效
Weblink string `json:"weblink"` // 站外视频跳转url,仅站外视频有效
Dimension VideoDimension `json:"dimension"` // 当前分P分辨率,部分较老视频无分辨率值
} `json:"pages"`
Subtitle struct {
AllowCommit bool `json:"allow_commit"` // 是否允许提交字幕
List []struct {
Id int `json:"id"` // 字幕id
Lan string `json:"lan"` // 字幕语言
LanDoc string `json:"lan_doc"` // 字幕语言名称
IsLock bool `json:"is_lock"` // 是否锁定
AuthorMid int `json:"author_mid"` // 字幕上传者mid
SubtitleUrl string `json:"subtitle_url"` // json格式字幕文件url
Author struct {
Mid int `json:"mid"` // 字幕上传者mid
Name string `json:"name"` // 字幕上传者昵称
Sex string `json:"sex"` // 字幕上传者性别 男 女 保密
Face string `json:"face"` // 字幕上传者头像url
Sign string `json:"sign"` // 字幕上传者签名
Rank int `json:"rank"` // 固定值10000,作用尚不明确
Birthday int `json:"birthday"` // 固定值0,作用尚不明确
IsFakeAccount int `json:"is_fake_account"` // 固定值0,作用尚不明确
IsDeleted int `json:"is_deleted"` // 固定值0,作用尚不明确
} `json:"author"`
} `json:"list"`
} `json:"subtitle"`
IsSeasonDisplay bool `json:"is_season_display"`
Staff []struct {
Mid int `json:"mid"` // 成员mid
Title string `json:"title"` // 成员名称
Name string `json:"name"` // 成员昵称
Face string `json:"face"` // 成员头像url
Vip struct {
Type int `json:"type"` // 成员会员类型,0:无,1:月会员,2:年会员
Status int `json:"status"` // 会员状态,0:无,1:有
ThemeType int `json:"theme_type"` // 固定值0,作用尚不明确
} `json:"vip"`
Official OfficialInfo `json:"official"` // 成员认证信息
Follower int `json:"follower"` // 成员粉丝数
} `json:"staff"`
UserGarb struct {
UrlImageAniCut string `json:"url_image_ani_cut"` // 某url,作用尚不明确
} `json:"user_garb"`
HonorReply struct {
Honor []struct {
Aid int `json:"aid"`
Type int `json:"type"`
Desc string `json:"desc"`
WeeklyRecommendNum int `json:"weekly_recommend_num"`
} `json:"honor"`
} `json:"honor_reply"`
}
func GetRecommendVideoByAvid ¶
GetRecommendVideoByAvid 通过Avid获取推荐视频
func GetRecommendVideoByBvid ¶
GetRecommendVideoByBvid 通过Bvid获取推荐视频
func GetTopRecommendVideo ¶
GetTopRecommendVideo 获取首页视频推荐列表,freshType相关性(默认为3),ps单页返回的记录条数(默认为8)
func GetVideoInfoByAvid ¶
GetVideoInfoByAvid 通过Avid获取视频信息
func GetVideoInfoByBvid ¶
GetVideoInfoByBvid 通过Bvid获取视频信息
func GetVideoInfoByShortUrl ¶
GetVideoInfoByShortUrl 通过短链接获取视频信息
type VideoOnlineInfo ¶
type VideoOnlineInfo struct {
Total string `json:"total"` // 所有终端总计人数,例如“10万+”
Count string `json:"count"` // web端实时在线人数
ShowSwitch struct {
Total bool `json:"total"` // 是否展示所有终端总计人数
Count bool `json:"count"` // 是否展示web端实时在线人数
} `json:"show_switch"`
}
func GetVideoOnlineInfoByAvid ¶
func GetVideoOnlineInfoByAvid(avid, cid int) (*VideoOnlineInfo, error)
GetVideoOnlineInfoByAvid 通过Avid获取视频在线人数
func GetVideoOnlineInfoByBvid ¶
func GetVideoOnlineInfoByBvid(bvid string, cid int) (*VideoOnlineInfo, error)
GetVideoOnlineInfoByBvid 通过Bvid获取视频在线人数
func GetVideoOnlineInfoByShortUrl ¶
func GetVideoOnlineInfoByShortUrl(shortUrl string, cid int) (*VideoOnlineInfo, error)
GetVideoOnlineInfoByShortUrl 通过短链接获取视频在线人数
type VideoPage ¶
type VideoPage struct {
Cid int `json:"cid"`
Page int `json:"page"`
From string `json:"from"`
Part string `json:"part"`
Duration int `json:"duration"`
Vid string `json:"vid"`
Weblink string `json:"weblink"`
Dimension struct {
Width int `json:"width"`
Height int `json:"height"`
Rotate int `json:"rotate"`
} `json:"dimension"`
}
func GetVideoPageListByAvid ¶
GetVideoPageListByAvid 通过Avid获取视频分P列表(Avid转cid)
func GetVideoPageListByBvid ¶
GetVideoPageListByBvid 通过Bvid获取视频分P列表(Bvid转cid)
func GetVideoPageListByShortUrl ¶
GetVideoPageListByShortUrl 通过短链接获取视频分P列表
type VideoPbPInfo ¶
type VideoPbPInfo struct {
StepSec int `json:"step_sec"` // 采样间隔时间(单位为秒,由视频时长决定)
Tagstr string `json:"tagstr"` // 作用尚不明确
Events struct {
Default []float64 `json:"default"` // 顶点值列表(顶点个数由视频时长和采样时间决定)
} `json:"events"`
Debug string `json:"debug"` // 调试信息(json字串)
}
func GetVideoPbPInfo ¶
func GetVideoPbPInfo(cid int) (*VideoPbPInfo, error)
GetVideoPbPInfo 获取视频弹幕趋势顶点列表(高能进度条)
type VideoStatusNumber ¶
type VideoStatusNumber struct {
Aid int `json:"aid"` // 稿件avid
Bvid string `json:"bvid"` // 稿件bvid
View interface{} `json:"view"` // 播放次数(有值则为一个int,如果被屏蔽了则为字符串"--")
Danmaku int `json:"danmaku"` // 弹幕条数
Reply int `json:"reply"` // 评论条数
Favorite int `json:"favorite"` // 收藏人数
Coin int `json:"coin"` // 投币枚数
Like int `json:"like"` // 获赞次数
NowRank int `json:"now_rank"` // 固定值0,作用尚不明确
HisRank int `json:"his_rank"` // 历史最高排行
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"` // 视频评分
}
func GetVideoStatusNumberByAvid ¶
func GetVideoStatusNumberByAvid(avid int) (*VideoStatusNumber, error)
GetVideoStatusNumberByAvid 通过Avid获取视频状态数视频
func GetVideoStatusNumberByBvid ¶
func GetVideoStatusNumberByBvid(bvid string) (*VideoStatusNumber, error)
GetVideoStatusNumberByBvid 通过Bvid获取视频状态数
func GetVideoStatusNumberByShortUrl ¶
func GetVideoStatusNumberByShortUrl(shortUrl string) (*VideoStatusNumber, error)
GetVideoStatusNumberByShortUrl 通过短链接获取视频状态数
type VideoTag ¶
type VideoTag []struct {
TagId int `json:"tag_id"` // tag_id
TagName string `json:"tag_name"` // TAG名称
Cover string `json:"cover"` // TAG图片url
HeadCover string `json:"head_cover"` // TAG页面头图url
Content string `json:"content"` // TAG介绍
ShortContent string `json:"short_content"` // TAG简介
Type int `json:"type"` // 作用尚不明确
State int `json:"state"` // 固定值0,作用尚不明确
Ctime int `json:"ctime"` // 创建时间戳
Count struct {
View int `json:"view"` // 固定值0,作用尚不明确
Use int `json:"use"` // 视频添加TAG数
Atten int `json:"atten"` // TAG关注
} `json:"count"`
IsAtten int `json:"is_atten"` // 是否关注,0:未关注,1:已关注,需要登录(Cookie),未登录为0
Likes int `json:"likes"` // 固定值0,作用尚不明确
Hates int `json:"hates"` // 固定值0,作用尚不明确
Attribute int `json:"attribute"` // 固定值0,作用尚不明确
Liked int `json:"liked"` // 是否已经点赞,0:未点赞,1:已点赞,需要登录(Cookie),未登录为0
Hated int `json:"hated"` // 是否已经点踩,0:未点踩,1:已点踩,需要登录(Cookie),未登录为0
ExtraAttr int `json:"extra_attr"` // 作用尚不明确
MusicId string `json:"music_id"`
TagType string `json:"tag_type"`
IsActivity bool `json:"is_activity"`
Color string `json:"color"`
Alpha int `json:"alpha"`
IsSeason bool `json:"is_season"`
SubscribedCount int `json:"subscribed_count"`
ArchiveCount string `json:"archive_count"`
FeaturedCount int `json:"featured_count"`
JumpUrl string `json:"jump_url"`
}
VideoTag 视频TAG信息
func GetVideoTagsByAvid ¶
GetVideoTagsByAvid 通过Avid获取视频TAG
func GetVideoTagsByBvid ¶
GetVideoTagsByBvid 通过Bvid获取视频TAG
func GetVideoTagsByShortUrl ¶
GetVideoTagsByShortUrl 通过短链接获取视频TAG
type Vip ¶
type Vip struct {
Type int `json:"type"` // 大会员类型,0:无,1:月度大会员,2:年度及以上大会员
Status int `json:"status"` // 大会员状态,0:无,1:有
DueDate int64 `json:"due_date"` // 到期时间戳(毫秒)
VipPayType int `json:"vip_pay_type"` // 大会员付费类型
ThemeType int `json:"theme_type"` // 固定值0,作用尚不明确
Label struct {
Path string `json:"path"`
Text string `json:"text"` // 大会员标签上的文字
LabelTheme string `json:"label_theme"` // 大会员标签主题
TextColor string `json:"text_color"` // 大会员文字颜色
BgStyle int `json:"bg_style"` // 大会员背景样式
BgColor string `json:"bg_color"` // 大会员背景颜色
BorderColor string `json:"border_color"` // 大会员边框颜色
UseImgLabel bool `json:"use_img_label"` // 是否使用图片标签
ImgLabelUriHans string `json:"img_label_uri_hans"`
ImgLabelUriHant string `json:"img_label_uri_hant"`
ImgLabelUriHansStatic string `json:"img_label_uri_hans_static"` // 大会员图片标签(简体中文)的url
ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"` // 大会员图片标签(繁体中文)的url
} `json:"label"`
AvatarSubscript int `json:"avatar_subscript"` // 作用尚不明确
NicknameColor string `json:"nickname_color"` // 昵称颜色
Role int `json:"role"`
AvatarSubscriptUrl string `json:"avatar_subscript_url"` // 作用尚不明确
TvVipStatus int `json:"tv_vip_status"` // TV大会员状态,0:无,1:有
TvVipPayType int `json:"tv_vip_pay_type"` // TV大会员付费类型
VipType int `json:"vipType"` // 大会员类型,0:无,1:月度大会员,2:年度及以上大会员
VipStatus int `json:"vipStatus"` // 大会员状态,0:无,1:有
}
type VipCenterInfo ¶
type VipCenterInfo struct {
User struct {
Account struct {
Mid int `json:"mid"` // 用户mid
Name string `json:"name"` // 昵称
Sex string `json:"sex"` // 性别,男/女/保密
Face string `json:"face"` // 头像url
Sign string `json:"sign"` // 签名
Rank int `json:"rank"` // 等级
Birthday int `json:"birthday"` // 生日时间戳,单位:秒
IsFakeAccount int `json:"is_fake_account"`
IsDeleted int `json:"is_deleted"` // 是否注销,0:正常,1:注销
InRegAudit int `json:"in_reg_audit"` // 是否注册审核,0:正常,1:审核
IsSeniorMember int `json:"is_senior_member"` // 是否转正,0:未转正,1:正式会员
} `json:"account"`
Vip struct {
Mid int `json:"mid"` // 用户mid
VipType int `json:"vip_type"` // 会员类型,0:无,1:月大会员,2:年度及以上大会员
VipStatus int `json:"vip_status"` // 会员状态,0:无,1:有
VipDueDate int64 `json:"vip_due_date"` // 会员过期时间戳,单位:毫秒
VipPayType int `json:"vip_pay_type"` // 支付类型,0:未支付(常见于官方账号),1:已支付(以正常渠道获取的大会员均为此值)
ThemeType int `json:"theme_type"`
Label struct {
Text string `json:"text"` // 会员类型文案,大会员,年度大会员,十年大会员,百年大会员,最强绿鲤鱼
LabelTheme string `json:"label_theme"` // 会员标签,vip,annual_vip,ten_annual_vip,hundred_annual_vip,fools_day_hundred_annual_vip
TextColor string `json:"text_color"` // 会员标签文本颜色
BgStyle int `json:"bg_style"` // 固定值1
BgColor string `json:"bg_color"` // 会员标签背景颜色码,一般为#FB7299,曾用于愚人节改变大会员配色
BorderColor string `json:"border_color"` // 会员标签边框颜色
UseImgLabel bool `json:"use_img_label"` // 固定值true
ImgLabelUriHans string `json:"img_label_uri_hans"`
ImgLabelUriHant string `json:"img_label_uri_hant"`
ImgLabelUriHansStatic string `json:"img_label_uri_hans_static"` // 大会员牌子图片简体版
ImgLabelUriHantStatic string `json:"img_label_uri_hant_static"` // 大会员牌子图片繁体版
} `json:"label"`
AvatarSubscript int `json:"avatar_subscript"` // 是否显示会员图标,0:不显示,1:显示
AvatarSubscriptUrl string `json:"avatar_subscript_url"`
NicknameColor string `json:"nickname_color"` // 会员昵称颜色码,一般为#FB7299,曾用于愚人节改变大会员配色
IsNewUser bool `json:"is_new_user"`
TipMaterial interface{} `json:"tip_material"`
} `json:"vip"`
TV struct {
Type int `json:"type"` // 电视大会员类型,0:无,1:月大会员,2:年度及以上大会员
VipPayType int `json:"vip_pay_type"` // 电视大支付类型,0:未支付(常见于官方账号),1:已支付(以正常渠道获取的大会员均为此值)
Status int `json:"status"` // 电视大会员状态,0:无,1:有
DueDate int64 `json:"due_date"` // 电视大会员过期时间戳,单位:毫秒
} `json:"tv"`
BackgroundImageSmall string `json:"background_image_small"`
BackgroundImageBig string `json:"background_image_big"`
PanelTitle string `json:"panel_title"` // 用户昵称
PanelSubTitle string `json:"panel_sub_title"`
AvatarPendant struct {
Image string `json:"image"` // 头像框url
ImageEnhance string `json:"image_enhance"` // 头像框url,动态图
ImageEnhanceFrame string `json:"image_enhance_frame"` // 动态头像框帧波普版url
} `json:"avatar_pendant"`
VipOverdueExplain string `json:"vip_overdue_explain"` // 大会员提示文案
TvOverdueExplain string `json:"tv_overdue_explain"` // 电视大会员提示文案
AccountExceptionText string `json:"account_exception_text"`
IsAutoRenew bool `json:"is_auto_renew"` // 是否自动续费
IsTvAutoRenew bool `json:"is_tv_auto_renew"` // 是否自动续费电视大会员
SurplusSeconds int `json:"surplus_seconds"` // 大会员到期剩余时间,单位:秒
VipKeepTime int `json:"vip_keep_time"` // 持续开通大会员时间,单位:秒
Renew struct {
Text string `json:"text"`
Link string `json:"link"`
} `json:"renew"`
Notice struct {
Text string `json:"text"`
TvText string `json:"tv_text"`
Type int `json:"type"`
CanClose bool `json:"can_close"`
SurplusSeconds int `json:"surplus_seconds"`
TvSurplusSeconds int `json:"tv_surplus_seconds"`
} `json:"notice"`
} `json:"user"`
Wallet struct {
Coupon int `json:"coupon"` // 当前B币券
Point int `json:"point"`
PrivilegeReceived bool `json:"privilege_received"`
} `json:"wallet"`
Privileges []struct {
Id int `json:"id"` // 特权父类id
Name string `json:"name"` // 类型名称
ChildPrivileges []struct {
FirstId int `json:"first_id"` // 特权父类id
ReportId string `json:"report_id"` // 上报id
Name string `json:"name"` // 特权名称
Desc string `json:"desc"` // 特权简介文案
Explain string `json:"explain"` // 特权介绍正文
IconUrl string `json:"icon_url"` // 特权图标url
IconGrayUrl string `json:"icon_gray_url"` // 特权图标灰色主题url
BackgroundImageUrl string `json:"background_image_url"` // 背景图片url
Link string `json:"link"` // 特权介绍页url
ImageUrl string `json:"image_url"` // 特权示例图url
Type int `json:"type"` // 类型,目前为0
HotType int `json:"hot_type"` // 是否热门特权,0:普通特权,1:热门特权
NewType int `json:"new_type"` // 是否新特权,0:普通特权,1:新特权
Id int `json:"id"` // 特权子类id
} `json:"child_privileges"`
} `json:"privileges"`
Welfare struct {
Count int `json:"count"` // 福利数
List []struct {
Id int `json:"id"` // 福利id
Name string `json:"name"` // 福利名称
HomepageUri string `json:"homepage_uri"` // 福利图片url
BackdropUri string `json:"backdrop_uri"` // 福利图片banner url
Tid int `json:"tid"` // 目前为0
Rank int `json:"rank"` // 排列顺序
ReceiveUri string `json:"receive_uri"` // 福利跳转页url
} `json:"list"`
} `json:"welfare"`
RecommendPendants struct {
List []struct {
Id int `json:"id"` // 头像框id
Name string `json:"name"` // 头像框名称
Image string `json:"image"` // 头像框图片url
JumpUrl string `json:"jump_url"` // 头像框页面url
} `json:"list"`
JumpUrl string `json:"jump_url"` // 头像框商城页面跳转url
} `json:"recommend_pendants"`
RecommendCards struct {
List []struct {
Id int `json:"id"` // 个性装扮id
Name string `json:"name"` // 个性装扮名称
Image string `json:"image"` // 个性装扮图标url
JumpUrl string `json:"jump_url"` // 个性装扮页面url
} `json:"list"`
JumpUrl string `json:"jump_url"` // 推荐个性装扮商城页面跳转url
} `json:"recommend_cards"`
Sort []struct {
Key string `json:"key"` // 扩展row字段名
Sort int `json:"sort"` // 排列顺序
} `json:"sort"`
InReview bool `json:"in_review"`
BigPoint struct {
PointInfo struct {
Point int `json:"point"` // 当前拥有大积分数量
ExpirePoint int `json:"expire_point"` // 失效积分,目前为0
ExpireTime int `json:"expire_time"` // 失效时间,目前为0
ExpireDays int `json:"expire_days"` // 失效天数,目前为0
} `json:"point_info"`
SignInfo struct {
SignRemind bool `json:"sign_remind"`
Benefit int `json:"benefit"` // 签到收益,单位为积分
BonusBenefit int `json:"bonus_benefit"`
NormalRemind bool `json:"normal_remind"`
MuggleTask bool `json:"muggle_task"`
} `json:"sign_info"`
SkuInfo struct {
Skus []GoodsSku `json:"skus"`
} `json:"sku_info"`
PointSwitchOff bool `json:"point_switch_off"`
Tips []struct {
Content string `json:"content"`
} `json:"tips"`
} `json:"big_point"`
HotList struct {
Taps []struct {
Oid string `json:"oid"` // 分类数据,类似json
RankId int `json:"rank_id"` // 分类id
RankTitle string `json:"rank_title"` // 分类名称
} `json:"taps"`
} `json:"hot_list"`
}
type VipPrivilege ¶
type VipPrivilege struct {
List []struct {
Type int `json:"type"` // 卡券类型,1:B币券,2:会员购优惠券,3:漫画福利券,4:会员购包邮券,5:漫画商城优惠券
State int `json:"state"` // 兑换状态,0:当月未兑换,1:已兑换
ExpireTime int `json:"expire_time"` // 本轮卡券过期时间戳(秒)
VipType int `json:"vip_type"` // 可兑换的会员类型,2:年度大会员
NextReceiveDays int `json:"next_receive_days"` // 距下一轮兑换剩余天数
PeriodEndUnix int `json:"period_end_unix"` // 下一轮兑换开始时间戳(秒)
} `json:"list"`
IsShortVip bool `json:"is_short_vip"`
IsFreightOpen bool `json:"is_freight_open"`
}