structs

package
v0.0.0-...-11bee1b Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Cmd

type Cmd struct {
	Cmd string `json:"cmd"`
}

type Comment

type Comment struct {
	CommentMeta *CommentMeta
	CommentText *string // 弹幕内容
	UserMeta    *UserMeta
	GuardMeta   *GuardMeta
}

Comment DANMU_MSG 普通弹幕类型

func (*Comment) String

func (o *Comment) String() string

type CommentMeta

type CommentMeta struct {
	Type      *int64
	TextSize  *int64
	Color     *int64
	Timestamp *int64
	ID        *int64
	SenderID  *string
}

func NewCommentMeta

func NewCommentMeta(prefix string, jsonQ *gojsonq.JSONQ) *CommentMeta

type GetDanmuInfoResp

type GetDanmuInfoResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Ttl     int    `json:"ttl"`
	Data    struct {
		Group            string  `json:"group"`
		BusinessId       int     `json:"business_id"`
		RefreshRowFactor float64 `json:"refresh_row_factor"`
		RefreshRate      int     `json:"refresh_rate"`
		MaxDelay         int     `json:"max_delay"`
		Token            string  `json:"token"`
		HostList         []struct {
			Host    string `json:"host"`
			Port    int    `json:"port"`
			WssPort int    `json:"wss_port"`
			WsPort  int    `json:"ws_port"`
		} `json:"host_list"`
	} `json:"data"`
}

GetDanmuInfoResp https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo?type=0&id=&{room_id}

func NewGetDanmuInfoResp

func NewGetDanmuInfoResp() *GetDanmuInfoResp

type GetInfoByRoomResp

type GetInfoByRoomResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Ttl     int    `json:"ttl"`
	Data    struct {
		RoomInfo struct {
			Uid            int    `json:"uid"`
			RoomId         int    `json:"room_id"`
			ShortId        int    `json:"short_id"`
			Title          string `json:"title"`
			Cover          string `json:"cover"`
			Tags           string `json:"tags"`
			Background     string `json:"background"`
			Description    string `json:"description"`
			LiveStatus     int    `json:"live_status"`
			LiveStartTime  int    `json:"live_start_time"`
			LiveScreenType int    `json:"live_screen_type"`
			LockStatus     int    `json:"lock_status"`
			LockTime       int    `json:"lock_time"`
			HiddenStatus   int    `json:"hidden_status"`
			HiddenTime     int    `json:"hidden_time"`
			AreaId         int    `json:"area_id"`
			AreaName       string `json:"area_name"`
			ParentAreaId   int    `json:"parent_area_id"`
			ParentAreaName string `json:"parent_area_name"`
			Keyframe       string `json:"keyframe"`
			SpecialType    int    `json:"special_type"`
			UpSession      string `json:"up_session"`
			PkStatus       int    `json:"pk_status"`
			IsStudio       bool   `json:"is_studio"`
			Pendants       struct {
				Frame struct {
					Name  string `json:"name"`
					Value string `json:"value"`
					Desc  string `json:"desc"`
				} `json:"frame"`
			} `json:"pendants"`
			OnVoiceJoin int `json:"on_voice_join"`
			Online      int `json:"online"`
			RoomType    struct {
				Field1 int `json:"2-3"`
				Field2 int `json:"3-13"`
				Field3 int `json:"3-21"`
			} `json:"room_type"`
		} `json:"room_info"`
		AnchorInfo struct {
			BaseInfo struct {
				Uname        string `json:"uname"`
				Face         string `json:"face"`
				Gender       string `json:"gender"`
				OfficialInfo struct {
					Role     int    `json:"role"`
					Title    string `json:"title"`
					Desc     string `json:"desc"`
					IsNft    int    `json:"is_nft"`
					NftDmark string `json:"nft_dmark"`
				} `json:"official_info"`
			} `json:"base_info"`
			LiveInfo struct {
				Level        int           `json:"level"`
				LevelColor   int           `json:"level_color"`
				Score        int           `json:"score"`
				UpgradeScore int           `json:"upgrade_score"`
				Current      []int         `json:"current"`
				Next         []interface{} `json:"next"`
				Rank         string        `json:"rank"`
			} `json:"live_info"`
			RelationInfo struct {
				Attention int `json:"attention"`
			} `json:"relation_info"`
			MedalInfo struct {
				MedalName string `json:"medal_name"`
				MedalId   int    `json:"medal_id"`
				Fansclub  int    `json:"fansclub"`
			} `json:"medal_info"`
		} `json:"anchor_info"`
		NewsInfo struct {
			Uid     int    `json:"uid"`
			Ctime   string `json:"ctime"`
			Content string `json:"content"`
		} `json:"news_info"`
		RankdbInfo struct {
			Roomid    int    `json:"roomid"`
			RankDesc  string `json:"rank_desc"`
			Color     string `json:"color"`
			H5Url     string `json:"h5_url"`
			WebUrl    string `json:"web_url"`
			Timestamp int    `json:"timestamp"`
		} `json:"rankdb_info"`
		AreaRankInfo struct {
			AreaRank struct {
				Index int    `json:"index"`
				Rank  string `json:"rank"`
			} `json:"areaRank"`
			LiveRank struct {
				Rank string `json:"rank"`
			} `json:"liveRank"`
		} `json:"area_rank_info"`
		BattleRankEntryInfo struct {
			FirstRankImgUrl string `json:"first_rank_img_url"`
			RankName        string `json:"rank_name"`
			ShowStatus      int    `json:"show_status"`
		} `json:"battle_rank_entry_info"`
		TabInfo struct {
			List []struct {
				Type      string `json:"type"`
				Desc      string `json:"desc"`
				IsFirst   int    `json:"isFirst"`
				IsEvent   int    `json:"isEvent"`
				EventType string `json:"eventType"`
				ListType  string `json:"listType"`
				ApiPrefix string `json:"apiPrefix"`
				RankName  string `json:"rank_name"`
			} `json:"list"`
		} `json:"tab_info"`
		ActivityInitInfo struct {
			EventList []interface{} `json:"eventList"`
			WeekInfo  struct {
				BannerInfo interface{} `json:"bannerInfo"`
				GiftName   interface{} `json:"giftName"`
			} `json:"weekInfo"`
			GiftName interface{} `json:"giftName"`
			Lego     struct {
				Timestamp int    `json:"timestamp"`
				Config    string `json:"config"`
			} `json:"lego"`
		} `json:"activity_init_info"`
		VoiceJoinInfo struct {
			Status struct {
				Open        int    `json:"open"`
				AnchorOpen  int    `json:"anchor_open"`
				Status      int    `json:"status"`
				Uid         int    `json:"uid"`
				UserName    string `json:"user_name"`
				HeadPic     string `json:"head_pic"`
				Guard       int    `json:"guard"`
				StartAt     int    `json:"start_at"`
				CurrentTime int    `json:"current_time"`
			} `json:"status"`
			Icons struct {
				IconClose    string `json:"icon_close"`
				IconOpen     string `json:"icon_open"`
				IconWait     string `json:"icon_wait"`
				IconStarting string `json:"icon_starting"`
			} `json:"icons"`
			WebShareLink string `json:"web_share_link"`
		} `json:"voice_join_info"`
		AdBannerInfo struct {
			Data []struct {
				Id                   int         `json:"id"`
				Title                string      `json:"title"`
				Location             string      `json:"location"`
				Position             int         `json:"position"`
				Pic                  string      `json:"pic"`
				Link                 string      `json:"link"`
				Weight               int         `json:"weight"`
				RoomId               int         `json:"room_id"`
				UpId                 int         `json:"up_id"`
				ParentAreaId         int         `json:"parent_area_id"`
				AreaId               int         `json:"area_id"`
				LiveStatus           int         `json:"live_status"`
				AvId                 int         `json:"av_id"`
				IsAd                 bool        `json:"is_ad"`
				AdTransparentContent interface{} `json:"ad_transparent_content"`
				ShowAdIcon           bool        `json:"show_ad_icon"`
			} `json:"data"`
		} `json:"ad_banner_info"`
		SkinInfo struct {
			Id          int    `json:"id"`
			SkinName    string `json:"skin_name"`
			SkinConfig  string `json:"skin_config"`
			ShowText    string `json:"show_text"`
			SkinUrl     string `json:"skin_url"`
			StartTime   int    `json:"start_time"`
			EndTime     int    `json:"end_time"`
			CurrentTime int    `json:"current_time"`
		} `json:"skin_info"`
		WebBannerInfo struct {
			Id               int    `json:"id"`
			Title            string `json:"title"`
			Left             string `json:"left"`
			Right            string `json:"right"`
			JumpUrl          string `json:"jump_url"`
			BgColor          string `json:"bg_color"`
			HoverColor       string `json:"hover_color"`
			TextBgColor      string `json:"text_bg_color"`
			TextHoverColor   string `json:"text_hover_color"`
			LinkText         string `json:"link_text"`
			LinkColor        string `json:"link_color"`
			InputColor       string `json:"input_color"`
			InputTextColor   string `json:"input_text_color"`
			InputHoverColor  string `json:"input_hover_color"`
			InputBorderColor string `json:"input_border_color"`
			InputSearchColor string `json:"input_search_color"`
		} `json:"web_banner_info"`
		LolInfo struct {
			LolActivity struct {
				Status     int    `json:"status"`
				GuessCover string `json:"guess_cover"`
				VoteCover  string `json:"vote_cover"`
				VoteH5Url  string `json:"vote_h5_url"`
				VoteUseH5  bool   `json:"vote_use_h5"`
			} `json:"lol_activity"`
		} `json:"lol_info"`
		PkInfo         interface{} `json:"pk_info"`
		BattleInfo     interface{} `json:"battle_info"`
		SilentRoomInfo struct {
			Type       string `json:"type"`
			Level      int    `json:"level"`
			Second     int    `json:"second"`
			ExpireTime int    `json:"expire_time"`
		} `json:"silent_room_info"`
		SwitchInfo struct {
			CloseGuard   bool `json:"close_guard"`
			CloseGift    bool `json:"close_gift"`
			CloseOnline  bool `json:"close_online"`
			CloseDanmaku bool `json:"close_danmaku"`
		} `json:"switch_info"`
		RecordSwitchInfo struct {
			RecordTab bool `json:"record_tab"`
		} `json:"record_switch_info"`
		RoomConfigInfo struct {
			DmText string `json:"dm_text"`
		} `json:"room_config_info"`
		GiftMemoryInfo struct {
			List interface{} `json:"list"`
		} `json:"gift_memory_info"`
		NewSwitchInfo struct {
			RoomSocket           int `json:"room-socket"`
			RoomPropSend         int `json:"room-prop-send"`
			RoomSailing          int `json:"room-sailing"`
			RoomInfoPopularity   int `json:"room-info-popularity"`
			RoomDanmakuEditor    int `json:"room-danmaku-editor"`
			RoomEffect           int `json:"room-effect"`
			RoomFansMedal        int `json:"room-fans_medal"`
			RoomReport           int `json:"room-report"`
			RoomFeedback         int `json:"room-feedback"`
			RoomPlayerWatermark  int `json:"room-player-watermark"`
			RoomRecommendLiveOff int `json:"room-recommend-live_off"`
			RoomActivity         int `json:"room-activity"`
			RoomWebBanner        int `json:"room-web_banner"`
			RoomSilverSeedsBox   int `json:"room-silver_seeds-box"`
			RoomWishingBottle    int `json:"room-wishing_bottle"`
			RoomBoard            int `json:"room-board"`
			RoomSupplication     int `json:"room-supplication"`
			RoomHourRank         int `json:"room-hour_rank"`
			RoomWeekRank         int `json:"room-week_rank"`
			RoomAnchorRank       int `json:"room-anchor_rank"`
			RoomInfoIntegral     int `json:"room-info-integral"`
			RoomSuperChat        int `json:"room-super-chat"`
			RoomTab              int `json:"room-tab"`
			RoomHotRank          int `json:"room-hot-rank"`
			FansMedalProgress    int `json:"fans-medal-progress"`
			GiftBayScreen        int `json:"gift-bay-screen"`
			RoomEnter            int `json:"room-enter"`
			RoomMyIdol           int `json:"room-my-idol"`
			RoomTopic            int `json:"room-topic"`
			FansClub             int `json:"fans-club"`
		} `json:"new_switch_info"`
		SuperChatInfo struct {
			Status      int    `json:"status"`
			JumpUrl     string `json:"jump_url"`
			Icon        string `json:"icon"`
			RankedMark  int    `json:"ranked_mark"`
			MessageList []struct {
				Id                    int    `json:"id"`
				Uid                   int    `json:"uid"`
				Price                 int    `json:"price"`
				Rate                  int    `json:"rate"`
				BackgroundImage       string `json:"background_image"`
				BackgroundColor       string `json:"background_color"`
				BackgroundIcon        string `json:"background_icon"`
				BackgroundPriceColor  string `json:"background_price_color"`
				BackgroundBottomColor string `json:"background_bottom_color"`
				FontColor             string `json:"font_color"`
				Time                  int    `json:"time"`
				StartTime             int    `json:"start_time"`
				EndTime               int    `json:"end_time"`
				Message               string `json:"message"`
				TransMark             int    `json:"trans_mark"`
				IsRanked              int    `json:"is_ranked"`
				MessageTrans          string `json:"message_trans"`
				Token                 string `json:"token"`
				Ts                    int    `json:"ts"`
				UserInfo              struct {
					Face       string `json:"face"`
					FaceFrame  string `json:"face_frame"`
					Uname      string `json:"uname"`
					UserLevel  int    `json:"user_level"`
					GuardLevel int    `json:"guard_level"`
					IsVip      int    `json:"is_vip"`
					IsSvip     int    `json:"is_svip"`
					IsMainVip  int    `json:"is_main_vip"`
				} `json:"user_info"`
			} `json:"message_list"`
		} `json:"super_chat_info"`
		OnlineGoldRankInfoV2 struct {
			List []struct {
				Uid        int    `json:"uid"`
				Face       string `json:"face"`
				Uname      string `json:"uname"`
				Score      string `json:"score"`
				Rank       int    `json:"rank"`
				GuardLevel int    `json:"guard_level"`
			} `json:"list"`
		} `json:"online_gold_rank_info_v2"`
		DmEmoticonInfo struct {
			IsOpenEmoticon   int `json:"is_open_emoticon"`
			IsShieldEmoticon int `json:"is_shield_emoticon"`
		} `json:"dm_emoticon_info"`
		DmTagInfo struct {
			DmTag           int           `json:"dm_tag"`
			Platform        []interface{} `json:"platform"`
			Extra           string        `json:"extra"`
			DmChronosExtra  string        `json:"dm_chronos_extra"`
			DmMode          []interface{} `json:"dm_mode"`
			DmSettingSwitch int           `json:"dm_setting_switch"`
		} `json:"dm_tag_info"`
		TopicInfo struct {
			TopicId   int    `json:"topic_id"`
			TopicName string `json:"topic_name"`
		} `json:"topic_info"`
		GameInfo struct {
			GameStatus int `json:"game_status"`
		} `json:"game_info"`
		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 int    `json:"icon_location"`
			IconWeb      string `json:"icon_web"`
		} `json:"watched_show"`
		VideoConnectionInfo interface{} `json:"video_connection_info"`
		PlayerThrottleInfo  struct {
			Status              int `json:"status"`
			NormalSleepTime     int `json:"normal_sleep_time"`
			FullscreenSleepTime int `json:"fullscreen_sleep_time"`
			TabSleepTime        int `json:"tab_sleep_time"`
			PromptTime          int `json:"prompt_time"`
		} `json:"player_throttle_info"`
		GuardInfo struct {
			Count                   int `json:"count"`
			AnchorGuardAchieveLevel int `json:"anchor_guard_achieve_level"`
		} `json:"guard_info"`
		HotRankInfo struct {
			Rank      int    `json:"rank"`
			Trend     int    `json:"trend"`
			Countdown int    `json:"countdown"`
			Timestamp int    `json:"timestamp"`
			Url       string `json:"url"`
			Icon      string `json:"icon"`
			AreaName  string `json:"area_name"`
			NewData   struct {
				Rank      int    `json:"rank"`
				Trend     int    `json:"trend"`
				Countdown int    `json:"countdown"`
				Timestamp int    `json:"timestamp"`
				Url       string `json:"url"`
				Icon      string `json:"icon"`
				AreaName  string `json:"area_name"`
				RankDesc  string `json:"rank_desc"`
			} `json:"new_data"`
		} `json:"hot_rank_info"`
	} `json:"data"`
}

func NewGetInfoByRoomResp

func NewGetInfoByRoomResp() *GetInfoByRoomResp

type GuardMeta

type GuardMeta struct {
	GuardLevel *int64
	GuardName  *string
	UpName     *string
	UpRoomID   *int64
}

func NewGuardMeta

func NewGuardMeta(prefix string, jsonQ *gojsonq.JSONQ) *GuardMeta

type Interact

type Interact struct {
	Cmd  string `json:"cmd"`
	Data struct {
		Contribution struct {
			Grade int `json:"grade"`
		} `json:"contribution"`
		Dmscore   int `json:"dmscore"`
		FansMedal struct {
			AnchorRoomid     int    `json:"anchor_roomid"`
			GuardLevel       int    `json:"guard_level"`
			IconId           int    `json:"icon_id"`
			IsLighted        int    `json:"is_lighted"`
			MedalColor       int    `json:"medal_color"`
			MedalColorBorder int    `json:"medal_color_border"`
			MedalColorEnd    int    `json:"medal_color_end"`
			MedalColorStart  int    `json:"medal_color_start"`
			MedalLevel       int    `json:"medal_level"`
			MedalName        string `json:"medal_name"`
			Score            int    `json:"score"`
			Special          string `json:"special"`
			TargetId         int    `json:"target_id"`
		} `json:"fans_medal"`
		Identities  []int           `json:"identities"`
		IsSpread    int             `json:"is_spread"`
		MsgType     InteractMsgType `json:"msg_type"`
		Roomid      int             `json:"roomid"`
		Score       int64           `json:"score"`
		SpreadDesc  string          `json:"spread_desc"`
		SpreadInfo  string          `json:"spread_info"`
		TailIcon    int             `json:"tail_icon"`
		Timestamp   int             `json:"timestamp"`
		TriggerTime int64           `json:"trigger_time"`
		Uid         int             `json:"uid"`
		Uname       string          `json:"uname"`
		UnameColor  string          `json:"uname_color"`
	} `json:"data"`
}

Interact INTERACT_WORD 观众互动信息

func (*Interact) String

func (o *Interact) String() string

type InteractMsgType

type InteractMsgType int

func (InteractMsgType) String

func (o InteractMsgType) String() string

type StopLiveRoomList

type StopLiveRoomList struct {
	Cmd  string `json:"cmd"`
	Data struct {
		RoomIdList []int `json:"room_id_list"`
	} `json:"data"`
}

StopLiveRoomList STOP_LIVE_ROOM_LIST 最近关闭的直播间

func (*StopLiveRoomList) String

func (o *StopLiveRoomList) String() string

type UserMeta

type UserMeta struct {
	UserID   *int64
	UserName *string
}

func NewUserMeta

func NewUserMeta(prefix string, jsonQ *gojsonq.JSONQ) *UserMeta

type WatchedChange

type WatchedChange struct {
	Cmd  string `json:"cmd"`
	Data struct {
		Num       int    `json:"num"`
		TextSmall string `json:"text_small"`
		TextLarge string `json:"text_large"`
	} `json:"data"`
}

WatchedChange WATCHED_CHANGE 观看人数变化

func (*WatchedChange) String

func (o *WatchedChange) String() string

Jump to

Keyboard shortcuts

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