resource

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

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"
	UserAgentKey   = "User-Agent"
	UserAgentValue = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0"
	AcceptKey      = "Accept"
	AcceptValue    = "application/json, text/plain, */*"
	CookieKey      = "Cookie"
	CookieValue    = "buvid3=hi"
)
View Source
const CopiedLoginInfoCode = 1
View Source
const DefaultCookiePath = "cookie.json"
View Source
const NearlyExpiredLoginInfoCode = 2

Variables

This section is empty.

Functions

func EncWbi added in v0.4.0

func EncWbi(params map[string]interface{}, imgKey, subKey string) (int64, string)

func GetCookie added in v0.5.6

func GetCookie(cookiePath string) (cookie string, csrf string)

func GetWbiKeys added in v0.4.0

func GetWbiKeys(imgURL string, subURL string) (string, string, error)

func ListHttpCookies added in v0.5.6

func ListHttpCookies(cookiePath string) []*http.Cookie

Types

type API added in v0.6.0

type API struct {
	CookiePath      string
	LiveAPIClient   *resty.Client
	CommonAPIClient *resty.Client
	VcAPIClient     *resty.Client
}

func New added in v0.6.0

func New() *API

func NewWithOptions added in v0.6.0

func NewWithOptions(path string, debug bool) *API

func (*API) GetDanmuInfo added in v0.6.0

func (a *API) GetDanmuInfo(shortID int) (*GetDanmuInfoRsp, error)

GetDanmuInfo 获取弹幕数据

func (*API) GetDynamic added in v0.6.0

func (a *API) GetDynamic(uid int64) (*Dynamic, error)

func (*API) GetFollowerInfo added in v0.6.0

func (a *API) GetFollowerInfo(uid int) (*FollowerInfoResp, error)

func (*API) GetPlayURL added in v0.6.0

func (a *API) GetPlayURL(shortID int, qn int) (*PlayURLRsp, error)

GetPlayURL 获取直播推流URL

func (*API) GetRoomInfo added in v0.6.0

func (a *API) GetRoomInfo(shortID int) (*RoomInfoResp, error)

GetRoomInfo 获取直播间详细信息

func (*API) GetUserInfo added in v0.6.0

func (a *API) GetUserInfo(uid int) (*UserInfoResp, error)

func (*API) GetWRID added in v0.6.0

func (a *API) GetWRID(params map[string]interface{}) (int64, string)

func (*API) Nav added in v0.6.0

func (a *API) Nav() (*NavResp, error)

func (*API) RealRoomID added in v0.6.0

func (a *API) RealRoomID(shortID int) (int, error)

RealRoomID 获取真实直播房间号,主要用于websocket连接

func (*API) RoomInit added in v0.6.0

func (a *API) RoomInit(shortID int) (*RoomInitResp, error)

RoomInit 获取直播间详细信息

func (*API) VideoInfo added in v0.6.0

func (a *API) VideoInfo(bvId string) (*VideoInfoResponse, error)

func (*API) VideoTags added in v0.6.0

func (a *API) VideoTags(video Video) (*VideoTagResponse, error)

type CookieInfo added in v0.5.6

type CookieInfo struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
	Ttl     int64  `json:"ttl"`
	Data    struct {
		IsNew        bool   `json:"is_new"`
		Mid          int64  `json:"mid"`
		AccessToken  string `json:"access_token"`
		RefreshToken string `json:"refresh_token"`
		ExpiresIn    int64  `json:"expires_in"`
		TokenInfo    struct {
			Mid          int64  `json:"mid"`
			AccessToken  string `json:"access_token"`
			RefreshToken string `json:"refresh_token"`
			ExpiresIn    int64  `json:"expires_in"`
		} `json:"token_info"`
		CookieInfo struct {
			Cookies []struct {
				Name     string `json:"name"`
				Value    string `json:"value"`
				HttpOnly int64  `json:"http_only"`
				Expires  int64  `json:"expires"`
				Secure   int64  `json:"secure"`
			} `json:"cookies"`
			Domains []string `json:"domains"`
		} `json:"cookie_info"`
		Sso []string `json:"sso"`
	} `json:"data"`
}

func GetCookieInfo added in v0.5.6

func GetCookieInfo(cookiePath string) *CookieInfo

type Count added in v0.3.2

type Count struct {
	View  int `json:"view"`
	Use   int `json:"use"`
	Atten int `json:"atten"`
}

Count

type DataDimension added in v0.2.5

type DataDimension struct {
	Width  int `json:"width"`
	Height int `json:"height"`
	Rotate int `json:"rotate"`
}

DataDimension

type DescV2 added in v0.2.5

type DescV2 struct {
	RawText string `json:"raw_text"`
	Type    int    `json:"type"`
	BizId   int    `json:"biz_id"`
}

DescV2

type Dimension added in v0.2.5

type Dimension struct {
	Width  int `json:"width"`
	Height int `json:"height"`
	Rotate int `json:"rotate"`
}

Dimension

type Durl added in v0.4.2

type Durl struct {
	Order      int    `json:"order" json:"order,omitempty"`
	StreamType int    `json:"stream_type" json:"stream_type,omitempty"`
	P2pType    int    `json:"p2p_type" json:"p_2_p_type,omitempty"`
	Url        string `json:"url" json:"url,omitempty"`
	Length     int    `json:"length" json:"length,omitempty"`
}

Durl

type Dynamic

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 动态

type FollowerInfo added in v0.3.3

type FollowerInfo struct {
	Mid       int  `json:"mid"`
	Following uint `json:"following"`
	Follower  uint `json:"follower"`
}

type FollowerInfoResp added in v0.3.3

type FollowerInfoResp struct {
	Code    int          `json:"code"`
	Message string       `json:"message"`
	TTL     int          `json:"ttl"`
	Data    FollowerInfo `json:"data"`
}

type Frame added in v0.4.7

type Frame struct {
	UseOldArea bool   `json:"use_old_area"`
	Name       string `json:"name"`
	Desc       string `json:"desc"`
	Area       int    `json:"area"`
	BgColor    string `json:"bg_color"`
	BgPic      string `json:"bg_pic"`
	Value      string `json:"value"`
	Position   int    `json:"position"`
	AreaOld    int    `json:"area_old"`
}

Frame

type GetDanmuInfoRsp added in v0.4.9

type GetDanmuInfoRsp struct {
	Code    int              `json:"code"`
	Msg     string           `json:"msg"`
	Message string           `json:"message"`
	Data    GetRoomDanmuInfo `json:"data"`
}

GetDanmuInfoRsp 进房响应

type GetRoomDanmuInfo added in v0.4.9

type GetRoomDanmuInfo struct {
	HostList         []HostList `yaml:"host_list"`
	Group            string     `yaml:"group"`
	BusinessId       int        `yaml:"business_id"`
	RefreshRowFactor float64    `yaml:"refresh_row_factor"`
	RefreshRate      int        `yaml:"refresh_rate"`
	MaxDelay         int        `yaml:"max_delay"`
	Token            string     `yaml:"token"`
}

GetRoomDanmuInfo

type HonorReply added in v0.2.5

type HonorReply struct {
}

HonorReply

type HostInfoResp

type HostInfoResp struct {
	Code    int    `json:"code"`
	Msg     string `json:"msg"`
	Message string `json:"message"`
	Data    struct {
		RoomID int `json:"room_id"`
	} `json:"data"`
}

HostInfoResp 主播信息

type HostList added in v0.4.9

type HostList struct {
	Host    string `yaml:"host"`
	Port    int    `yaml:"port"`
	WssPort int    `yaml:"wss_port"`
	WsPort  int    `yaml:"ws_port"`
}

HostList

type MobileFrame added in v0.4.7

type MobileFrame struct {
	Name       string `json:"name"`
	Value      string `json:"value"`
	Area       int    `json:"area"`
	UseOldArea bool   `json:"use_old_area"`
	Position   int    `json:"position"`
	Desc       string `json:"desc"`
	AreaOld    int    `json:"area_old"`
	BgColor    string `json:"bg_color"`
	BgPic      string `json:"bg_pic"`
}

MobileFrame

type NavResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	TTL     int    `json:"ttl"`
	Data    struct {
		WbiImg WbiImg `json:"wbi_img"`
	} `json:"data"`
}

type NewPendants added in v0.4.7

type NewPendants struct {
	Frame       Frame       `json:"frame"`
	Badge       interface{} `json:"badge"`
	MobileFrame MobileFrame `json:"mobile_frame"`
	MobileBadge interface{} `json:"mobile_badge"`
}

NewPendants

type Owner added in v0.2.5

type Owner struct {
	Mid  int    `json:"mid"`
	Name string `json:"name"`
	Face string `json:"face"`
}

Owner

type Pages added in v0.2.5

type Pages struct {
	Weblink   string    `json:"weblink"`
	Dimension Dimension `json:"dimension"`
	Cid       int       `json:"cid"`
	Page      int       `json:"page"`
	From      string    `json:"from"`
	Part      string    `json:"part"`
	Duration  int       `json:"duration"`
	Vid       string    `json:"vid"`
}

Pages

type PlayURLData added in v0.4.2

type PlayURLData struct {
	CurrentQuality     int                  `json:"current_quality" json:"current_quality,omitempty"`
	AcceptQuality      []string             `json:"accept_quality" json:"accept_quality,omitempty"`
	CurrentQn          int                  `json:"current_qn" json:"current_qn,omitempty"`
	QualityDescription []QualityDescription `json:"quality_description" json:"quality_description,omitempty"`
	Durl               []Durl               `json:"durl" json:"durl,omitempty"`
}

PlayURLData

type PlayURLRsp added in v0.4.2

type PlayURLRsp struct {
	Code    int         ` json:"code" json:"code,omitempty"`
	Message string      `json:"message" json:"message,omitempty"`
	Ttl     int         `json:"ttl" json:"ttl,omitempty"`
	Data    PlayURLData `json:"data" json:"data"`
}

PlayURLRsp

type QualityDescription added in v0.4.2

type QualityDescription struct {
	Qn   int    `json:"qn" json:"qn,omitempty"`
	Desc string `json:"desc" json:"desc,omitempty"`
}

QualityDescription

type Rights added in v0.2.5

type Rights struct {
	Elec          int `json:"elec"`
	Pay           int `json:"pay"`
	UgcPayPreview int `json:"ugc_pay_preview"`
	CleanMode     int `json:"clean_mode"`
	FreeWatch     int `json:"free_watch"`
	Bp            int `json:"bp"`
	Download      int `json:"download"`
	UgcPay        int `json:"ugc_pay"`
	IsSteinGate   int `json:"is_stein_gate"`
	Hd5           int `json:"hd5"`
	IsCooperation int `json:"is_cooperation"`
	NoBackground  int `json:"no_background"`
	ArcPay        int `json:"arc_pay"`
	Movie         int `json:"movie"`
	NoReprint     int `json:"no_reprint"`
	Autoplay      int `json:"autoplay"`
	Is360         int `json:"is_360"`
	NoShare       int `json:"no_share"`
}

Rights

type RoomInfo added in v0.4.4

type RoomInfo struct {
	RoomID               int         `json:"room_id"`
	ShortID              int         `json:"short_id"`
	UID                  int         `json:"uid"`
	IsPortrait           bool        `json:"is_portrait"`
	IsAnchor             int         `json:"is_anchor"`
	PkId                 int         `json:"pk_id"`
	LiveStatus           int         `json:"live_status"`
	ParentAreaId         int         `json:"parent_area_id"`
	NewPendants          NewPendants `json:"new_pendants"`
	AllowUploadCoverTime int         `json:"allow_upload_cover_time"`
	Description          string      `json:"description"`
	Background           string      `json:"background"`
	Title                string      `json:"title"`
	Tags                 string      `json:"tags"`
	RoomSilentSecond     int         `json:"room_silent_second"`
	Pendants             string      `json:"pendants"`
	HotWordsStatus       int         `json:"hot_words_status"`
	UpSession            string      `json:"up_session"`
	AllowChangeAreaTime  int         `json:"allow_change_area_time"`
	Online               int         `json:"online"`
	OldAreaId            int         `json:"old_area_id"`
	UserCover            string      `json:"user_cover"`
	Keyframe             string      `json:"keyframe"`
	IsStrictRoom         bool        `json:"is_strict_room"`
	RoomSilentLevel      int         `json:"room_silent_level"`
	AreaName             string      `json:"area_name"`
	PkStatus             int         `json:"pk_status"`
	Attention            int         `json:"attention"`
	Verify               string      `json:"verify"`
	BattleId             int         `json:"battle_id"`
	AreaId               int         `json:"area_id"`
	RoomSilentType       string      `json:"room_silent_type"`
	ParentAreaName       string      `json:"parent_area_name"`
	LiveTime             string      `json:"live_time"`
	StudioInfo           StudioInfo  `json:"studio_info"`
	AreaPendants         string      `json:"area_pendants"`
	HotWords             []string    `json:"hot_words"`
}

type RoomInfoResp

type RoomInfoResp struct {
	Code    int      `json:"code"`
	Msg     string   `json:"msg"`
	Message string   `json:"message"`
	Data    RoomInfo `json:"data"`
}

RoomInfoResp 直播房间信息

type RoomInitInfo added in v0.4.9

type RoomInitInfo 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"`
	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"`
}

type RoomInitResp added in v0.4.9

type RoomInitResp struct {
	Code    int          `json:"code"`
	Msg     string       `json:"msg"`
	Message string       `json:"message"`
	Data    RoomInitInfo `json:"data"`
}

RoomInitResp 直播进房信息

type Stat added in v0.2.5

type Stat struct {
	Coin       int    `json:"coin"`
	Share      int    `json:"share"`
	HisRank    int    `json:"his_rank"`
	Evaluation string `json:"evaluation"`
	Aid        int    `json:"aid"`
	View       int    `json:"view"`
	Favorite   int    `json:"favorite"`
	Like       int    `json:"like"`
	Dislike    int    `json:"dislike"`
	ArgueMsg   string `json:"argue_msg"`
	Danmaku    int    `json:"danmaku"`
	Reply      int    `json:"reply"`
	NowRank    int    `json:"now_rank"`
}

Stat

type StudioInfo added in v0.4.7

type StudioInfo struct {
	Status int `json:"status"`
}

StudioInfo

type Subtitle added in v0.2.5

type Subtitle struct {
	AllowSubmit bool `json:"allow_submit"`
}

Subtitle

type UserGarb added in v0.2.5

type UserGarb struct {
	UrlImageAniCut string `json:"url_image_ani_cut"`
}

UserGarb

type UserInfo

type UserInfo 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   []string `json:"tags"`
	Series struct {
		UserUpgradeStatus int  `json:"user_upgrade_status"`
		ShowUpgradeWindow bool `json:"show_upgrade_window"`
	} `json:"series"`
	IsSeniorMember int `json:"is_senior_member"`
}

type UserInfoResp

type UserInfoResp struct {
	Code    int      `json:"code"`
	Message string   `json:"message"`
	TTL     int      `json:"ttl"`
	Data    UserInfo `json:"data"`
}

type Video added in v0.3.2

type Video struct {
	Bvid               string        `json:"bvid"`
	Tname              string        `json:"tname"`
	Cid                int           `json:"cid"`
	Pages              []Pages       `json:"pages"`
	DescV2             []DescV2      `json:"desc_v2"`
	Duration           int           `json:"duration"`
	TeenageMode        int           `json:"teenage_mode"`
	NoCache            bool          `json:"no_cache"`
	Copyright          int           `json:"copyright"`
	Dynamic            string        `json:"dynamic"`
	IsStory            bool          `json:"is_story"`
	HonorReply         HonorReply    `json:"honor_reply"`
	Desc               string        `json:"desc"`
	State              int           `json:"state"`
	Owner              Owner         `json:"owner"`
	Videos             int           `json:"videos"`
	Rights             Rights        `json:"rights"`
	Tid                int           `json:"tid"`
	Pubdate            int           `json:"pubdate"`
	Ctime              int           `json:"ctime"`
	IsChargeableSeason bool          `json:"is_chargeable_season"`
	Subtitle           Subtitle      `json:"subtitle"`
	LikeIcon           string        `json:"like_icon"`
	Aid                int           `json:"aid"`
	Title              string        `json:"title"`
	Stat               Stat          `json:"stat"`
	Dimension          DataDimension `json:"dimension"`
	Premiere           interface{}   `json:"premiere"`
	UserGarb           UserGarb      `json:"user_garb"`
	Pic                string        `json:"pic"`
	IsSeasonDisplay    bool          `json:"is_season_display"`
}

Video

type VideoInfoResponse added in v0.2.5

type VideoInfoResponse struct {
	Message string `json:"message"`
	Ttl     int    `json:"ttl"`
	Data    Video  `json:"data"`
	Code    int    `json:"code"`
}

VideoInfoResponse

type VideoTag added in v0.3.2

type VideoTag struct {
	IsActivity      bool   `json:"is_activity"`
	Alpha           int    `json:"alpha"`
	TagId           int    `json:"tag_id"`
	Cover           string `json:"cover"`
	Liked           int    `json:"liked"`
	Ctime           int    `json:"ctime"`
	IsAtten         int    `json:"is_atten"`
	Likes           int    `json:"likes"`
	JumpUrl         string `json:"jump_url"`
	ShortContent    string `json:"short_content"`
	Attribute       int    `json:"attribute"`
	Color           string `json:"color"`
	SubscribedCount int    `json:"subscribed_count"`
	ArchiveCount    string `json:"archive_count"`
	State           int    `json:"state"`
	Hates           int    `json:"hates"`
	ExtraAttr       int    `json:"extra_attr"`
	MusicId         string `json:"music_id"`
	Content         string `json:"content"`
	Count           Count  `json:"count"`
	FeaturedCount   int    `json:"featured_count"`
	TagName         string `json:"tag_name"`
	IsSeason        bool   `json:"is_season"`
	HeadCover       string `json:"head_cover"`
	Hated           int    `json:"hated"`
	TagType         string `json:"tag_type"`
	Type            int    `json:"type"`
}

VideoTag

type VideoTagResponse added in v0.3.2

type VideoTagResponse struct {
	Code    int        `json:"code,omitempty"`
	Message string     `json:"message,omitempty"`
	Ttl     int        `json:"ttl,omitempty"`
	Data    []VideoTag `json:"data,omitempty"`
}

VideoTagResponse

type WbiImg added in v0.4.0

type WbiImg struct {
	ImgUrl string `json:"img_url"`
	SubUrl string `json:"sub_url"`
}

Jump to

Keyboard shortcuts

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