Documentation
¶
Index ¶
Constants ¶
View Source
const ( // WSUrl B站直播websocket接入地址 WSUrl = "wss://broadcastlv.chat.bilibili.com/sub" // LiveAPIURL B站直播API地址 LiveAPIURL = "https://api.live.bilibili.com" // APIURL B站API地址 APIURL = "https://api.bilibili.com" VcAPIURL = "https://api.vc.bilibili.com" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dynamic ¶ added in v0.1.1
type Dynamic struct {
Code int `json:"code"`
Msg string `json:"msg"`
Message string `json:"message"`
Data struct {
HasMore int `json:"has_more"`
Cards []struct {
Desc struct {
Uid int `json:"uid"`
Type int `json:"type"`
Rid int64 `json:"rid"`
View int `json:"view"`
Repost int `json:"repost"`
Comment int `json:"comment"`
Like int `json:"like"`
IsLiked int `json:"is_liked"`
DynamicId int64 `json:"dynamic_id"`
Timestamp int64 `json:"timestamp"`
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"`
DecorateCard struct {
Mid int `json:"mid"`
Id int `json:"id"`
CardUrl string `json:"card_url"`
CardType int `json:"card_type"`
Name string `json:"name"`
ExpireTime int `json:"expire_time"`
CardTypeName string `json:"card_type_name"`
Uid int `json:"uid"`
ItemId int `json:"item_id"`
ItemType int `json:"item_type"`
BigCardUrl string `json:"big_card_url"`
JumpUrl string `json:"jump_url"`
Fan struct {
IsFan int `json:"is_fan"`
Number int `json:"number"`
Color string `json:"color"`
NumDesc string `json:"num_desc"`
} `json:"fan"`
ImageEnhance string `json:"image_enhance"`
} `json:"decorate_card"`
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"`
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"`
Acl int `json:"acl,omitempty"`
PreDyId int64 `json:"pre_dy_id,omitempty"`
OrigDyId int64 `json:"orig_dy_id,omitempty"`
Stype int `json:"stype,omitempty"`
RType int `json:"r_type,omitempty"`
InnerId int `json:"inner_id,omitempty"`
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"`
Bvid string `json:"bvid"`
} `json:"origin,omitempty"`
} `json:"desc"`
Card string `json:"card"`
ExtendJson string `json:"extend_json"`
Extra struct {
IsSpaceTop int `json:"is_space_top"`
} `json:"extra"`
Display 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,omitempty"`
Relation struct {
Status int `json:"status"`
IsFollow int `json:"is_follow"`
IsFollowed int `json:"is_followed"`
} `json:"relation"`
CommentInfo struct {
CommentIds string `json:"comment_ids"`
} `json:"comment_info"`
Origin struct {
TopicInfo struct {
TopicDetails []struct {
TopicId int `json:"topic_id"`
TopicName string `json:"topic_name"`
IsActivity int `json:"is_activity"`
TopicLink string `json:"topic_link"`
} `json:"topic_details"`
} `json:"topic_info"`
UsrActionTxt string `json:"usr_action_txt"`
Relation struct {
Status int `json:"status"`
IsFollow int `json:"is_follow"`
IsFollowed int `json:"is_followed"`
} `json:"relation"`
ShowTip struct {
DelTip string `json:"del_tip"`
} `json:"show_tip"`
CoverPlayIconUrl string `json:"cover_play_icon_url"`
} `json:"origin,omitempty"`
} `json:"display"`
} `json:"cards"`
NextOffset int64 `json:"next_offset"`
Gt int `json:"_gt_"`
} `json:"data"`
}
Dynamic 动态
func GetDynamic ¶ added in v0.1.1
type RoomInfoResp ¶
type RoomInfoResp struct {
Code int `json:"code"`
Msg string `json:"msg"`
Message string `json:"message"`
Data struct {
RoomID int `json:"room_id"`
ShortID int `json:"short_id"`
UID int `json:"uid"`
NeedP2P int `json:"need_p2p"`
IsHidden bool `json:"is_hidden"`
IsLocked bool `json:"is_locked"`
IsPortrait bool `json:"is_portrait"`
LiveStatus int `json:"live_status"`
HiddenTill int `json:"hidden_till"`
LockTill int `json:"lock_till"`
Encrypted bool `json:"encrypted"`
PwdVerified bool `json:"pwd_verified"`
LiveTime int64 `json:"live_time"`
RoomShield int `json:"room_shield"`
IsSp int `json:"is_sp"`
SpecialType int `json:"special_type"`
} `json:"data"`
}
RoomInfoResp 直播房间信息
type UserInfoResp ¶
type UserInfoResp struct {
Code int `json:"code"`
Message string `json:"message"`
TTL int `json:"ttl"`
Data struct {
Mid int `json:"mid"`
Name string `json:"name"`
Sex string `json:"sex"`
Face string `json:"face"`
FaceNft int `json:"face_nft"`
Sign string `json:"sign"`
Rank int `json:"rank"`
Level int `json:"level"`
Jointime int `json:"jointime"`
Moral int `json:"moral"`
Silence int `json:"silence"`
Coins int `json:"coins"`
FansBadge bool `json:"fans_badge"`
FansMedal struct {
Show bool `json:"show"`
Wear bool `json:"wear"`
Medal interface{} `json:"medal"`
} `json:"fans_medal"`
Official struct {
Role int `json:"role"`
Title string `json:"title"`
Desc string `json:"desc"`
Type int `json:"type"`
} `json:"official"`
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"`
} `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"`
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"`
UserHonourInfo struct {
Mid int `json:"mid"`
Colour interface{} `json:"colour"`
Tags []interface{} `json:"tags"`
} `json:"user_honour_info"`
IsFollowed bool `json:"is_followed"`
TopPhoto string `json:"top_photo"`
Theme struct {
} `json:"theme"`
SysNotice struct {
} `json:"sys_notice"`
LiveRoom struct {
RoomStatus int `json:"roomStatus"`
LiveStatus int `json:"liveStatus"`
URL string `json:"url"`
Title string `json:"title"`
Cover string `json:"cover"`
Roomid int `json:"roomid"`
RoundStatus int `json:"roundStatus"`
BroadcastType int `json:"broadcast_type"`
WatchedShow struct {
Switch bool `json:"switch"`
Num int `json:"num"`
TextSmall string `json:"text_small"`
TextLarge string `json:"text_large"`
Icon string `json:"icon"`
IconLocation string `json:"icon_location"`
IconWeb string `json:"icon_web"`
} `json:"watched_show"`
} `json:"live_room"`
Birthday string `json:"birthday"`
School struct {
Name string `json:"name"`
} `json:"school"`
Profession struct {
Name string `json:"name"`
Department string `json:"department"`
Title string `json:"title"`
IsShow int `json:"is_show"`
} `json:"profession"`
Tags interface{} `json:"tags"`
Series struct {
UserUpgradeStatus int `json:"user_upgrade_status"`
ShowUpgradeWindow bool `json:"show_upgrade_window"`
} `json:"series"`
IsSeniorMember int `json:"is_senior_member"`
} `json:"data"`
}
func UserInfo ¶
func UserInfo(uid int) (*UserInfoResp, error)
Click to show internal directories.
Click to hide internal directories.