decode

package
v0.0.0-...-1879a00 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	U32 protoType = iota
	I32
	U64
	I64
	Bytes
	Strings
)

Variables

View Source
var File_decode_danmaku_proto protoreflect.FileDescriptor

Functions

func CheckValid

func CheckValid(typ api_url.ApiUrl, dat interface{}) bool

func DanmakuOnlineOld

func DanmakuOnlineOld(body []byte) (un []byte, err error)

func Encode

func Encode(dm []DanmakuStruct) (proto []byte, err error)

func Json2Struct

func Json2Struct(jsonData interface{}, structPointer interface{}) (err error)

Json2Struct Json 转 预设Struct

func JsonDecode

func JsonDecode(body []byte) (data interface{}, err error)

JsonDecode 解析JSON, 注意会 UseNumber

func JsonGet

func JsonGet(dat interface{}, args ...string) (val interface{}, err error)

JsonGet 获取值, 传 string 或 int

Types

type BangumiDetailInfoStruct

type BangumiDetailInfoStruct struct {
	EpInfo struct {
		Aid       string `path:"/aid" json:"aid"`
		BvId      string `path:"/bvid" json:"bvid"`
		Cid       string `path:"/cid" json:"cid"`
		Cover     string `path:"/cover" json:"cover"`
		Dimension struct {
			Height int `path:"/height" json:"height"`
			Rotate int `path:"/rotate" json:"rotate"`
			Width  int `path:"/width" json:"width"`
		} `path:"/dimension" optional:"" json:"dimension"`
		Duration    int64  `path:"/duration" json:"duration"`
		Id          string `path:"/id" json:"id"` // ep号
		LongTitle   string `path:"/long_title" json:"long_title"`
		PubTime     int64  `path:"/pub_time" json:"pub_time"`
		ShareCopy   string `path:"/share_copy" json:"share_copy"`
		Subtitle    string `path:"/subtitle" json:"subtitle"`
		Title       string `path:"/title" json:"title"`
		TitleFormat string `path:"/titleFormat" json:"titleFormat"`
		I           int64  `path:"/i" json:"i"`
	} `path:"/epInfo" json:"epInfo"` // 当前EP的信息
	MediaInfo struct {
		//Activity struct {
		//	Id    int64  `path:"/id"`    // 活动ID
		//	Title string `path:"/title"` // 活动标题
		//} `path:"/activity"` // 参与的活动
		Areas []struct {
			Id   int    `path:"/id" json:"id"`     // 所属地区编号
			Name string `path:"/name" json:"name"` // 所属地区名称
		} `path:"/areas" json:"areas"` // 地区
		//BkgCover string `path:"/bkg_cover"` // 网页背景图片URL
		Cover    string `path:"/cover" json:"cover"` // 剧集封面图片URL
		Episodes []struct {
			Aid       string `path:"/aid" json:"aid"`     // 单集稿件avid
			Badge     string `path:"/badge" json:"badge"` // 标签文字; 如 会员、限免 等
			BvId      string `path:"/bvid" json:"bvid"`   // 单集稿件bvid
			Cid       string `path:"/cid" json:"cid"`     // 视频cid
			Cover     string `path:"/cover" json:"cover"` // 单集封面URL
			Dimension struct {
				Height int `path:"/height" json:"height"`
				Width  int `path:"/width" json:"width"`
				Rotate int `path:"/rotate" json:"rotate"`
			} `path:"/dimension" json:"dimension"` // 分辨率信息
			Duration  int64  `path:"/duration" json:"duration"`
			From      string `path:"/from" json:"from"`
			Id        string `path:"/id" json:"id"`                 // 单集epid
			Link      string `path:"/link" json:"link"`             // 单集网页URL
			LongTitle string `path:"/long_title" json:"long_title"` // 单集完整标题
			PubTime   int64  `path:"/pub_time" json:"pub_time"`     // 发布时间; 时间戳
			ShareCopy string `path:"/share_copy" json:"share_copy"` // 《{标题}》 + 第n话 + {单集完整标题}
			ShareUrl  string `path:"/share_url" json:"share_url"`   // 单集网页URL
			ShortLink string `path:"/short_link" json:"short_link"` // 单集网页URL短链接
			Subtitle  string `path:"/subtitle" json:"subtitle"`     // 单集副标题; 观看次数文字
			Title     string `path:"/title" json:"title"`           // 单集标题
			Vid       string `path:"/vid" json:"vid"`               // 单集vid; vupload_+{cid}
		} `path:"/episodes" json:"episodes"` // 正片剧集列表
		Evaluate string `path:"/evaluate" json:"evaluate"` // 简介
		Link     string `path:"/link" json:"link"`         // 简介页面URL
		MediaId  string `path:"/media_id" json:"media_id"` // 剧集mdid
		//NewEp    struct {
		//	Desc  string `path:"/desc"`   // 更新备注
		//	Id    string `path:"/id"`     // 最新一话epid
		//	IsNew int    `path:"/is_new"` // 是否最新发布; 0: 否; 1: 是
		//	Title string `path:"/title"`  // 最新一话标题
		//} `path:"/new_ep"` // 更新信息
		Publish struct {
			IsFinish    int    `path:"/is_finish" json:"is_finish"`         // 完结状态; 0: 未完结; 1: 已完结
			IsStarted   int    `path:"/is_started" json:"is_started"`       // 是否发布; 0: 未发布; 1: 已发布
			PubTime     string `path:"/pub_time" json:"pub_time"`           // 发布时间; YYYY-MM-DD hh:mm:ss
			PubTimeShow string `path:"/pub_time_show" json:"pub_time_show"` // 发布时间文字介绍
		} `path:"/publish" json:"publish"`
		//Rating struct {
		//	Count int64 `path:"/count"` // 总计评分人数
		//	Score int   `path:"/score"` // 评分
		//} `path:"/ration"`
		Rights struct {
			Copyright string `path:"/copyright" json:"copyright"` // 版权标志; bilibili: 授权; dujia: 独家
		} `path:"/rights" json:"rights"`
		SeasonId    string `path:"/season_id" json:"season_id"`
		SeasonTitle string `path:"/season_title" json:"season_title"`
		Section     []struct {
			Episodes []struct {
				Aid       string `path:"/aid" json:"aid"`     // 单集稿件avid
				Badge     string `path:"/badge" json:"badge"` // 标签文字; 如 会员、限免 等
				BvId      string `path:"/bvid" json:"bvid"`   // 单集稿件bvid
				Cid       string `path:"/cid" json:"cid"`     // 视频cid
				Cover     string `path:"/cover" json:"cover"` // 单集封面URL
				Dimension struct {
					Height int `path:"/height" json:"height"`
					Width  int `path:"/width" json:"width"`
					Rotate int `path:"/rotate" json:"rotate"`
				} `path:"/dimension" json:"dimension"` // 分辨率信息
				Duration  int64  `path:"/duration" json:"duration"`
				From      string `path:"/from" json:"from"`
				Id        string `path:"/id" json:"id"`                 // 单集epid
				Link      string `path:"/link" json:"link"`             // 单集网页URL
				LongTitle string `path:"/long_title" json:"long_title"` // 单集完整标题
				PubTime   int64  `path:"/pub_time" json:"pub_time"`     // 发布时间; 时间戳
				ShareCopy string `path:"/share_copy" json:"share_copy"` // 《{标题}》 + 第n话 + {单集完整标题}
				ShareUrl  string `path:"/share_url" json:"share_url"`   // 单集网页URL
				ShortLink string `path:"/short_link" json:"short_link"` // 单集网页URL短链接
				Subtitle  string `path:"/subtitle" json:"subtitle"`     // 单集副标题; 观看次数文字
				Title     string `path:"/title" json:"title"`           // 单集标题
				Vid       string `path:"/vid" json:"vid"`               // 单集vid; vupload_+{cid}
			} `path:"/episodes" json:"episodes"`
			Id    int64  `path:"/id" json:"id"`
			Title string `path:"/title" json:"title"`
		} `path:"/section" optional:"" json:"section"` // 花絮、PV、番外等非正片内容
		Title    string `path:"/title" json:"title"`
		Subtitle string `path:"/subtitle" json:"subtitle"`
		Id       string `path:"/id" json:"id"`
		SsId     string `path:"/ssId" json:"ssId"`
		Stat     struct {
			Coins     int64 `path:"/coins" json:"coins"`
			Danmakus  int64 `path:"/danmakus" json:"danmakus"`
			Favorite  int64 `path:"/favorite" json:"favorite"`
			Favorites int64 `path:"/favorites" json:"favorites"`
			Likes     int64 `path:"/likes" json:"likes"`
			Reply     int64 `path:"/reply" json:"reply"`
			Share     int64 `path:"/share" json:"share"`
			Views     int64 `path:"/views" json:"views"`
		} `path:"/stat" json:"stat"`
	} `path:"/mediaInfo" json:"mediaInfo"` // 所属番剧信息
}

func BangumiDetailInfo

func BangumiDetailInfo(body []byte) (dat BangumiDetailInfoStruct, err error)

type BangumiInfoStruct

type BangumiInfoStruct struct {
	//Activity struct {
	//	Id    int64  `path:"/id"`    // 活动ID
	//	Title string `path:"/title"` // 活动标题
	//} `path:"/mediaInfo/activity"` // 参与的活动
	Actors string `path:"/mediaInfo/actors" json:"actors"` // 角色配音
	Areas  []struct {
		Id   int    `path:"/id" json:"id"`     // 所属地区编号
		Name string `path:"/name" json:"name"` // 所属地区名称
	} `path:"/mediaInfo/areas" json:"areas"` // 地区
	//Copyright struct {
	//	IsFinish  int `path:"/is_finish"`
	//	IsStarted int `path:"/is_started"`
	//} `path:"/mediaInfo/copyright"`
	Cover        string `path:"/mediaInfo/cover" json:"cover"` // 剧集封面图片URL
	EpisodeIndex struct {
		Id            string `path:"/id" json:"id"`
		Index         string `path:"/index" json:"index"`
		IndexShow     string `path:"/index_show" json:"index_show"`
		IsNew         int    `path:"/is_new" json:"is_new"`
		PlayIndexShow string `path:"/play_index_show" json:"play_index_show"`
	} `path:"/mediaInfo/episode_index" json:"episode_index"`
	Evaluate string `path:"/mediaInfo/evaluate" json:"evaluate"` // 简介
	//LongReview struct {
	//	Next   string `path:"/next"`
	//	Normal int64  `path:"/normal"`
	//	Total  int64  `path:"/total"`
	//	Count  int64  `path:"/count"`
	//	List   []struct {
	//		ReviewId int64 `path:"/review_id"`
	//		Stat     struct {
	//			Replay int64 `path:"/replay"`
	//			Likes  int64 `path:"/likes"`
	//		} `path:"/stat"`
	//		Author struct {
	//			UName  string `path:"/uname"`
	//			MId    int64  `path:"/mid"`
	//			Avatar string `path:"/avatar"`
	//			Vip    struct {
	//				VipType int `path:"/vipType"`
	//			} `path:"vip"`
	//		} `path:"/author"`
	//		MId       int64  `path:"/mid"`
	//		Title     string `path:"/title"`
	//		MTime     int64  `path:"/mtime"`
	//		Content   string `path:"/content"`
	//		Url       string `path:"/url"`
	//		ArticleId int64  `path:"/article_id"`
	//		Score     int    `path:"/score"`
	//		IsOrigin  int    `path:"/is_origin"`
	//		MediaId   int64  `path:"/media_id"`
	//		CTime     int64  `path:"/ctime"`
	//		Progress  string `path:"/progress"`
	//	} `path:"/list"`
	//} `path:"/mediaInfo/long_review"` // 长评
	MediaId    string `path:"/mediaInfo/media_id" json:"media_id"` // 剧集mdid
	OriginName string `path:"/mediaInfo/origin_name" json:"origin_name"`
	SeasonId   string `path:"/mediaInfo/season_id" json:"season_id"` // 番剧ssid
	Staff      string `path:"/mediaInfo/staff" json:"staff"`         // 工作人员
	Title      string `path:"/mediaInfo/title" json:"title"`         // 剧集标题
	Type       int    `path:"/mediaInfo/type" json:"type"`           // 剧集类型; 1: 番剧; 2: 电影; 3: 纪录片; 4: 国创; 5: 电视剧; 7: 综艺
	TypeName   string `path:"/mediaInfo/type_name" json:"type_name"` // 番剧类型名
	Stat       struct {
		Danmakus     int64 `path:"/danmakus" json:"danmakus"`           // 弹幕总数
		Favorites    int64 `path:"/favorites" json:"favorites"`         //
		SeriesFollow int64 `path:"/series_follow" json:"series_follow"` //
		Views        int64 `path:"/views" json:"views"`                 // 总播放量
	} `path:"/mediaInfo/stat" json:"stat"`
	//ShortReview struct {
	//	Next     string `path:"/next"`
	//	Total    int64  `path:"/total"`
	//	MyReview struct {
	//		ReviewId string   `path:"/review_id"`
	//		Score    int      `path:"/score"`
	//		Stat     struct{} `path:"/stat"`
	//		Author   struct {
	//			UName  string `path:"/uname"`
	//			MId    string `path:"/mid"`
	//			Avatar string `path:"/avatar"`
	//			Vip    struct {
	//				VipType   int `path:"/vipType"`
	//				VipStatus int `path:"/vipStatus"`
	//			} `path:"/vip"`
	//		} `path:"/author"`
	//		CTime    int64  `path:"/cid"`
	//		Progress string `path:"/progress"`
	//		MTime    int64  `path:"/mtime"`
	//		Content  string `path:"/content"`
	//	} `path:"/my_review"`
	//	List []struct {
	//		ReviewId string `path:"/review_id"`
	//		Score    int    `path:"/score"`
	//		Stat     struct {
	//			Likes int64 `path:"/likes"`
	//		} `path:"/stat"`
	//		Author struct {
	//			UName  string `path:"/uname"`
	//			MId    string `path:"/mid"`
	//			Avatar string `path:"/avatar"`
	//			Vip    struct {
	//				VipType   int `path:"/vipType"`
	//				VipStatus int `path:"/vipStatus"`
	//			} `path:"/vip"`
	//		} `path:"/author"`
	//		MediaId  string `path:"/media_id"`
	//		MId      string `path:"/mid"`
	//		CTime    int64  `path:"/ctime"`
	//		Progress string `path:"/progress"`
	//		MTime    int64  `path:"/mtime"`
	//		Content  string `path:"/content"`
	//	} `path:"/list"`
	//} `path:"/mediaInfo/short_review"` // 短评
	Styles []struct {
		Id   int64  `path:"/id" json:"id"`
		Name string `path:"/name" json:"name"`
	} `path:"/mediaInfo/styles" json:"styles"` // 风格; 番剧的主页, 在番剧名字的右侧就是
	Rating struct {
		Count int64   `path:"/count" json:"count"` // 总计评分人数
		Score float64 `path:"/score" json:"score"` // 评分
	} `path:"/mediaInfo/rating" json:"rating"` // 点评
	Seasons []struct {
		IsNew    int    `path:"/is_new" json:"is_new"`
		MediaId  string `path:"/media_id" json:"media_id"`
		SeasonId string `path:"/season_id" json:"season_id"`
		Title    string `path:"/title" json:"title"`
		Type     int    `path:"/type" json:"type"`
	} `path:"/mediaInfo/seasons" json:"seasons"` // 系列信息
}

func BangumiInfo

func BangumiInfo(body []byte) (dat BangumiInfoStruct, err error)

type BangumiSeasonInfoStruct

type BangumiSeasonInfoStruct struct {
	EpisodeId string `path:"/epInfo/id" json:"episode_id"`
}

func BangumiSeasonInfo

func BangumiSeasonInfo(body []byte) (dat BangumiSeasonInfoStruct, err error)

type BangumiSectionStruct

type BangumiSectionStruct struct {
	MainSection struct {
		Episodes []struct {
			Aid       string `path:"/aid" json:"aid"`
			Badge     string `path:"/badge" json:"badge"`
			BadgeInfo struct {
				BgColor      string `path:"/bg_color" json:"bg_color"`
				BgColorNight string `path:"/bg_color_night" json:"bg_color_night"`
				Text         string `path:"/text" json:"text"`
			} `path:"/badge_info" json:"badge_info"`
			BadgeType  int    `path:"/badge_type" json:"badge_type"`
			Cid        string `path:"/cid" json:"cid"`
			Cover      string `path:"/cover" json:"cover"`
			From       string `path:"/from" json:"from"`
			Id         string `path:"/id" json:"id"`
			IsPremiere int    `path:"/is_premiere" json:"is_premiere"`
			LongTitle  string `path:"/long_title" json:"long_title"`
			ShareUrl   string `path:"/share_url" json:"share_url"`
			Status     int    `path:"/status" json:"status"`
			Title      string `path:"/title" json:"title"`
			Vid        string `path:"/vid" json:"vid"`
		} `path:"/episodes" json:"episodes"`
		Id    int64  `path:"/id" json:"id"`
		Title string `path:"/title" json:"title"`
		Type  int    `path:"/type" json:"type"`
	} `path:"/result/main_section" json:"main_section"`
	Section []struct {
		Episodes []struct {
			Aid       string `path:"/aid" json:"aid"`
			Badge     string `path:"/badge" json:"badge"`
			BadgeInfo struct {
				BgColor      string `path:"/bg_color" json:"bg_color"`
				BgColorNight string `path:"/bg_color_night" json:"bg_color_night"`
				Text         string `path:"/text" json:"text"`
			} `path:"/badge_info" json:"badge_info"`
			BadgeType  int    `path:"/badge_type" json:"badge_type"`
			Cid        string `path:"/cid" json:"cid"`
			Cover      string `path:"/cover" json:"cover"`
			From       string `path:"/from" json:"from"`
			Id         string `path:"/id" json:"id"`
			IsPremiere int    `path:"/is_premiere" json:"is_premiere"`
			LongTitle  string `path:"/long_title" json:"long_title"`
			ShareUrl   string `path:"/share_url" json:"share_url"`
			Status     int    `path:"/status" json:"status"`
			Title      string `path:"/title" json:"title"`
			Vid        string `path:"/vid" json:"vid"`
		} `path:"/episodes" json:"episodes"`
		Id    int64  `path:"/id" json:"id"`
		Title string `path:"/title" json:"title"`
		Type  int    `path:"/type" json:"type"`
	} `path:"/result/section" json:"section"`
}

BangumiSectionStruct 番剧主页的视频数据 番剧主页的视频数据并不会在 __INITIAL_STATE__ 中 虽然他定义了 mainSectionList 和 sectionList, 但却是空的 后面会调用api去填充数据

func BangumiSectionInfo

func BangumiSectionInfo(body []byte) (dat BangumiSectionStruct, err error)

type DanmakuAIFlag

type DanmakuAIFlag struct {

	// 弹幕ai云屏蔽条目
	DmFlags []*DanmakuFlag `protobuf:"bytes,1,rep,name=dm_flags,json=dmFlags,proto3" json:"dm_flags,omitempty"`
	// contains filtered or unexported fields
}

弹幕ai云屏蔽列表

func (*DanmakuAIFlag) Descriptor deprecated

func (*DanmakuAIFlag) Descriptor() ([]byte, []int)

Deprecated: Use DanmakuAIFlag.ProtoReflect.Descriptor instead.

func (*DanmakuAIFlag) GetDmFlags

func (x *DanmakuAIFlag) GetDmFlags() []*DanmakuFlag

func (*DanmakuAIFlag) ProtoMessage

func (*DanmakuAIFlag) ProtoMessage()

func (*DanmakuAIFlag) ProtoReflect

func (x *DanmakuAIFlag) ProtoReflect() protoreflect.Message

func (*DanmakuAIFlag) Reset

func (x *DanmakuAIFlag) Reset()

func (*DanmakuAIFlag) String

func (x *DanmakuAIFlag) String() string

type DanmakuElem

type DanmakuElem struct {

	// 弹幕dmid
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// 弹幕出现位置(单位ms)
	Progress int32 `protobuf:"varint,2,opt,name=progress,proto3" json:"progress,omitempty"`
	// 弹幕类型
	Mode int32 `protobuf:"varint,3,opt,name=mode,proto3" json:"mode,omitempty"`
	// 弹幕字号
	Fontsize int32 `protobuf:"varint,4,opt,name=fontsize,proto3" json:"fontsize,omitempty"`
	// 弹幕颜色
	Color uint32 `protobuf:"varint,5,opt,name=color,proto3" json:"color,omitempty"`
	// 发送着mid hash
	MidHash string `protobuf:"bytes,6,opt,name=midHash,proto3" json:"midHash,omitempty"`
	// 弹幕正文
	Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"`
	// 发送时间
	Ctime int64 `protobuf:"varint,8,opt,name=ctime,proto3" json:"ctime,omitempty"`
	// 权重 区间:[1,10]
	Weight int32 `protobuf:"varint,9,opt,name=weight,proto3" json:"weight,omitempty"`
	// 动作
	Action string `protobuf:"bytes,10,opt,name=action,proto3" json:"action,omitempty"`
	// 弹幕池
	Pool int32 `protobuf:"varint,11,opt,name=pool,proto3" json:"pool,omitempty"`
	// 弹幕dmid str
	IdStr string `protobuf:"bytes,12,opt,name=idStr,proto3" json:"idStr,omitempty"`
	// 弹幕属性位(bin求AND)
	// bit0:保护 bit1:直播 bit2:高赞
	Attr int32 `protobuf:"varint,13,opt,name=attr,proto3" json:"attr,omitempty"`
	// contains filtered or unexported fields
}

弹幕条目

func DanmakuDecodeProto

func DanmakuDecodeProto(body []byte) (dat []*DanmakuElem, err error)

func DanmakuHistory

func DanmakuHistory(body []byte) (dat []*DanmakuElem, err error)

DanmakuHistory 解析历史弹幕

如果可解析数据, 则 err = nil 如果数据包含弹幕数据部分(无论有没有弹幕), 则 dat != nil 否则可能视频被ban

func DanmakuOnline

func DanmakuOnline(body []byte) (dat []*DanmakuElem, err error)

DanmakuOnline 解析实时弹幕

如果可解析数据, 则 err = nil 如果数据包含弹幕数据部分(无论有没有弹幕), 则 dat != nil 否则可能视频被ban

func (*DanmakuElem) Descriptor deprecated

func (*DanmakuElem) Descriptor() ([]byte, []int)

Deprecated: Use DanmakuElem.ProtoReflect.Descriptor instead.

func (*DanmakuElem) GetAction

func (x *DanmakuElem) GetAction() string

func (*DanmakuElem) GetAttr

func (x *DanmakuElem) GetAttr() int32

func (*DanmakuElem) GetColor

func (x *DanmakuElem) GetColor() uint32

func (*DanmakuElem) GetContent

func (x *DanmakuElem) GetContent() string

func (*DanmakuElem) GetCtime

func (x *DanmakuElem) GetCtime() int64

func (*DanmakuElem) GetFontsize

func (x *DanmakuElem) GetFontsize() int32

func (*DanmakuElem) GetId

func (x *DanmakuElem) GetId() int64

func (*DanmakuElem) GetIdStr

func (x *DanmakuElem) GetIdStr() string

func (*DanmakuElem) GetMidHash

func (x *DanmakuElem) GetMidHash() string

func (*DanmakuElem) GetMode

func (x *DanmakuElem) GetMode() int32

func (*DanmakuElem) GetPool

func (x *DanmakuElem) GetPool() int32

func (*DanmakuElem) GetProgress

func (x *DanmakuElem) GetProgress() int32

func (*DanmakuElem) GetWeight

func (x *DanmakuElem) GetWeight() int32

func (*DanmakuElem) ProtoMessage

func (*DanmakuElem) ProtoMessage()

func (*DanmakuElem) ProtoReflect

func (x *DanmakuElem) ProtoReflect() protoreflect.Message

func (*DanmakuElem) Reset

func (x *DanmakuElem) Reset()

func (*DanmakuElem) String

func (x *DanmakuElem) String() string

type DanmakuFlag

type DanmakuFlag struct {
	Dmid int64  `protobuf:"varint,1,opt,name=dmid,proto3" json:"dmid,omitempty"` // 弹幕dmid
	Flag uint32 `protobuf:"varint,2,opt,name=flag,proto3" json:"flag,omitempty"` // 评分
	// contains filtered or unexported fields
}

弹幕ai云屏蔽条目

func (*DanmakuFlag) Descriptor deprecated

func (*DanmakuFlag) Descriptor() ([]byte, []int)

Deprecated: Use DanmakuFlag.ProtoReflect.Descriptor instead.

func (*DanmakuFlag) GetDmid

func (x *DanmakuFlag) GetDmid() int64

func (*DanmakuFlag) GetFlag

func (x *DanmakuFlag) GetFlag() uint32

func (*DanmakuFlag) ProtoMessage

func (*DanmakuFlag) ProtoMessage()

func (*DanmakuFlag) ProtoReflect

func (x *DanmakuFlag) ProtoReflect() protoreflect.Message

func (*DanmakuFlag) Reset

func (x *DanmakuFlag) Reset()

func (*DanmakuFlag) String

func (x *DanmakuFlag) String() string

type DanmakuStruct

type DanmakuStruct struct {
	Id       int64  // 弹幕ID
	Progress int32  // 视频内弹幕出现时间; 毫秒
	Mode     int32  // 弹幕类型; 1/2/3: 普通弹幕; 4: 底部弹幕; 5: 顶部弹幕; 6: 逆向弹幕; 7: 高级弹幕; 8: 代码弹幕; 9: BAS弹幕
	FontSize int32  // 弹幕字号; 18: 小; 25: 标准; 36: 大
	Color    uint32 // 弹幕颜色; 十进制RGB888值
	MIdHash  string // 发送者mid的Hash
	Content  string // 弹幕内容; utf-8编码
	CTime    int64  // 弹幕发送时间; 时间戳
	Weight   int32  // 权重; 用于只能屏蔽; 值越大权重越高
	Action   string // ?
	Pool     int32  // 弹幕池; 0: 普通池; 1: 字母池; 2: 特殊池(代码/BAS弹幕)
	IdStr    string // 弹幕ID; 字符串形式(猜测是因JavaScript有大数误差, 才加上这个)
}

DanmakuStruct 弹幕数据

func (DanmakuStruct) Encode

func (_this DanmakuStruct) Encode() (buf []byte, err error)

type DmSegMobileReply

type DmSegMobileReply struct {

	// 弹幕列表
	Elems []*DanmakuElem `protobuf:"bytes,1,rep,name=elems,proto3" json:"elems,omitempty"`
	// 是否已关闭弹幕
	// 0:未关闭 1:已关闭
	State int32 `protobuf:"varint,2,opt,name=state,proto3" json:"state,omitempty"`
	// 弹幕云屏蔽ai评分值
	AiFlag *DanmakuAIFlag `protobuf:"bytes,3,opt,name=ai_flag,json=aiFlag,proto3" json:"ai_flag,omitempty"`
	// contains filtered or unexported fields
}

func (*DmSegMobileReply) Descriptor deprecated

func (*DmSegMobileReply) Descriptor() ([]byte, []int)

Deprecated: Use DmSegMobileReply.ProtoReflect.Descriptor instead.

func (*DmSegMobileReply) GetAiFlag

func (x *DmSegMobileReply) GetAiFlag() *DanmakuAIFlag

func (*DmSegMobileReply) GetElems

func (x *DmSegMobileReply) GetElems() []*DanmakuElem

func (*DmSegMobileReply) GetState

func (x *DmSegMobileReply) GetState() int32

func (*DmSegMobileReply) ProtoMessage

func (*DmSegMobileReply) ProtoMessage()

func (*DmSegMobileReply) ProtoReflect

func (x *DmSegMobileReply) ProtoReflect() protoreflect.Message

func (*DmSegMobileReply) Reset

func (x *DmSegMobileReply) Reset()

func (*DmSegMobileReply) String

func (x *DmSegMobileReply) String() string

type Proto

type Proto struct {
	// contains filtered or unexported fields
}

func NewProto

func NewProto(b []byte) (proto Proto)

func (*Proto) Bytes

func (_this *Proto) Bytes() (b []byte, err error)

func (*Proto) Decode

func (_this *Proto) Decode() (dmSlice []DanmakuStruct, err error)

func (*Proto) Int32

func (_this *Proto) Int32() (i32 int32, err error)

func (*Proto) Int64

func (_this *Proto) Int64() (i64 int64, err error)

func (*Proto) Skip

func (_this *Proto) Skip(t int) (err error)

func (*Proto) SkipType

func (_this *Proto) SkipType(t uint32) (err error)

func (*Proto) Strings

func (_this *Proto) Strings() (str string, err error)

func (*Proto) Uint32

func (_this *Proto) Uint32() (u32 uint32, err error)

func (*Proto) Uint64

func (_this *Proto) Uint64() (u64 uint64, err error)

type UserGetUserInfoStruct

type UserGetUserInfoStruct struct {
	Uid       string `path:"/data/uid" type:"json.Number" json:"uid"`
	Name      string `path:"/data/uname" type:"string" json:"name"`
	Face      string `path:"/data/face" type:"string" json:"face"`
	UserLevel string `path:"/data/user_level" type:"json.Number" json:"user_level"`
	BillCoin  string `path:"/data/billCoin" type:"json.Number" json:"billCoin"`
}

func UserGetUserInfo

func UserGetUserInfo(body []byte) (dat UserGetUserInfoStruct, err error)

type VideoInfoStruct

type VideoInfoStruct struct {
	Aid       string `path:"/videoData/aid" json:"aid"`               // av号
	BvId      string `path:"/videoData/bvid" json:"bvid"`             // bv号
	Videos    int64  `path:"/videoData/videos" json:"videos"`         // 分P总数; 默认为 1
	Tid       int64  `path:"/videoData/tid" json:"tid"`               // 分区tid
	TName     string `path:"/videoData/tname" json:"tname"`           // 子分区名称
	Copyright int    `path:"/videoData/copyright" json:"copyright"`   // 视频类型; 1: 原创; 2: 转载
	Pic       string `path:"/videoData/pic" json:"pic"`               // 封面图片url
	Title     string `path:"/videoData/title" json:"title"`           // 标题
	PubDate   int64  `path:"/videoData/pubdate" json:"pubdate"`       // 发布时间; 时间戳
	Ctime     int64  `path:"/videoData/ctime" json:"ctime"`           // 投稿时间; 时间戳
	Desc      string `path:"/videoData/desc" json:"desc"`             // 视频简介
	State     int    `path:"/videoData/state" json:"state"`           // 视频状态
	Duration  int64  `path:"/videoData/duration" json:"duration"`     // 总时长(所有分P); 单位: 秒
	MissionID int64  `path:"/videoData/mission_id" json:"mission_id"` // 稿件参与的活动ID
	Dynamic   string `path:"/videoData/dynamic" json:"dynamic"`       // 视频同步发布的动态的文字内容
	Cid       string `path:"/videoData/cid" json:"cid"`               // 视频1P cid号
	Dimension struct {
		Width  int `path:"/width" json:"width"`   // 当前分P宽度
		Height int `path:"/height" json:"height"` // 当前分P高度
		Rotate int `path:"/rotate" json:"rotate"` // 是否将宽高对换; 0: 正常; 1: 对换
	} `path:"/videoData/Dimension" json:"dimension"` // 视频1P分辨率
	Rights struct {
		Elec          int `path:"/elec" json:"elec"`                     // 是否支持充电
		Download      int `path:"/download" json:"download"`             // 是否允许下载
		Movie         int `path:"/movie" json:"movie"`                   // 是否电影
		Pay           int `path:"/pay" json:"pay"`                       // 是否PGC付费
		HD5           int `path:"/hd5" json:"hd5"`                       // 是否有高码率
		NoReprint     int `path:"/no_reprint" json:"no_reprint"`         // 是否显示"禁止转载"标志
		Autoplay      int `path:"/autoplay" json:"autoplay"`             // 是否自动播放
		UgcPay        int `path:"/ugc_pay" json:"ugc_pay"`               // 是否UGC付费
		IsSteinGate   int `path:"/is_stein_gate" json:"is_stein_gate"`   // 是否为互动视频
		IsCooperation int `path:"/is_cooperation" json:"is_cooperation"` // 是否为联合投稿
	} `path:"/videoData/rights" json:"rights"` // 视频属性标志
	Pages []struct {
		Cid       string `path:"/cid" json:"cid"`           // 当前分P cid
		Page      int    `path:"/page" json:"page"`         // 当前分P
		From      string `path:"/from" json:"from"`         // 视频来源; vupload: 普通上传(B站); hunan: 芒果TV; qq: 腾讯
		Part      string `path:"/part" json:"part"`         // 当前分P标题
		Duration  int64  `path:"/duration" json:"duration"` // 当前分P持续时间; 单位: 秒
		Vid       string `path:"/vid" json:"vid"`           // 站外视频vid; 仅站外视频有效
		Weblink   string `path:"/weblink" json:"weblink"`   // 站外视频跳转URL; 仅站外视频有效
		Dimension struct {
			Width  int `path:"/width" json:"width"`   // 当前分P宽度
			Height int `path:"/height" json:"height"` // 当前分P高度
			Rotate int `path:"/rotate" json:"rotate"` // 是否将宽高对换; 0: 正常; 1: 对换
		} `path:"/dimension" optional:"" json:"dimension"` // 当前分P分辨率; 部分较老视频无分辨率
	} `path:"/videoData/pages" json:"pages"` // 视频分P列表
	Owner struct {
		Mid  string `path:"/mid" json:"mid"`   // UP主mid
		Name string `path:"/name" json:"name"` // UP主昵称
		Face string `path:"/face" json:"face"` // UP主头像
	} `path:"/videoData/owner" json:"owner"` // 视频UP主属性
	Stat struct {
		View       int64  `path:"/view" json:"view"`             // 播放数
		Danmaku    int64  `path:"/danmaku" json:"danmaku"`       // 弹幕数
		Reply      int64  `path:"/reply" json:"reply"`           // 评论数
		Favorite   int64  `path:"/favorite" json:"favorite"`     // 收藏数
		Coin       int64  `path:"/coin" json:"coin"`             // 投币数
		Share      int64  `path:"/share" json:"share"`           // 分享数
		NowRank    int64  `path:"/now_rank" json:"now_rank"`     // 当前排名
		HisRank    int64  `path:"/his_rank" json:"his_rank"`     // 历史最高排行
		Like       int64  `path:"/like" json:"like"`             // 获赞数
		Evaluation string `path:"/evaluation" json:"evaluation"` // 视频评分
		ArgueMsg   string `path:"/argue_msg" json:"argue_msg"`   // 警告/争议提示信息
		ViewSeo    int64  `path:"/viewseo" json:"viewseo"`       // ?
	} `path:"/videoData/stat" json:"stat"` // 视频状态数
	Sections []struct {
		SeasonId string `path:"/season_id" json:"season_id"`
		Id       string `path:"/id" json:"id"`
		Title    string `path:"/title" json:"title"`
		Type     int    `path:"/type" json:"type"`
		Episodes []struct {
			SeasonId  string `path:"/season_id" json:"season_id"`
			SectionId string `path:"/section_id" json:"section_id"`
			Id        string `path:"/id" json:"id"`
			Aid       string `path:"/aid" json:"aid"`
			Cid       string `path:"/cid" json:"cid"`
			Title     string `path:"/title" json:"title"`
			Attribute int    `path:"/attribute" json:"attribute"`
			Page      struct {
				Cid       string `path:"/cid" json:"cid"`
				Page      string `path:"/page" json:"page"`
				From      string `path:"/from" json:"from"`
				Part      string `path:"/part" json:"part"`
				Duration  int64  `path:"/duration" json:"duration"`
				Vid       string `path:"/vid" json:"vid"`
				Weblink   string `path:"/weblink" json:"weblink"`
				Dimension struct {
					Width  int `path:"/width" json:"width"`
					Height int `path:"/height" json:"height"`
					Rotate int `path:"/rotate" json:"rotate"`
				} `path:"/dimension" json:"dimension"`
			} `path:"/page" json:"page"`
			BvId string `path:"/bvid" json:"bvid"`
		} `path:"/episodes" json:"episodes"`
		IsActive bool  `path:"/isActive" json:"isActive"`
		Height   int64 `path:"/height" json:"height"`
	} `path:"/sections" optional:"" json:"sections"` // 系列, 可能有可能没有
	// 错误结构体,如果视频正常,则不存在,一般是失效才有
	Error struct {
		Code     int    `path:"/code" json:"code"`
		TrueCode int    `path:"/trueCode" json:"trueCode"`
		Message  string `path:"/message" json:"message"`
	} `path:"/error" optional:"" json:"error"`
}

func VideoInfo

func VideoInfo(body []byte) (dat VideoInfoStruct, err error)

type XSpaceAccInfoStruct

type XSpaceAccInfoStruct struct {
	Mid   string `path:"/data/mid" type:"json.Number" json:"mid"`
	Name  string `path:"/data/name" type:"string" json:"name"`
	Sex   string `path:"/data/sex" type:"string" json:"sex"`
	Face  string `path:"/data/face" type:"string" json:"face"`
	Level string `path:"/data/level" type:"json.Number" json:"level"`
}

func XSpaceAccInfo

func XSpaceAccInfo(body []byte) (dat XSpaceAccInfoStruct, err error)

type XSpaceArcSearchStruct

type XSpaceArcSearchStruct struct {
	VideoList []struct {
		Aid            string `path:"/aid" type:"json.Number" json:"aid"`
		Author         string `path:"/author" type:"string" json:"author"`
		BvId           string `path:"/bvid" type:"string" json:"bvid"`
		Comment        uint64 `path:"/comment" type:"json.Number" json:"comment"`
		Copyright      string `path:"/copyright" json:"copyright"`
		Created        uint64 `path:"/created" type:"json.Number" json:"created"`
		Description    string `path:"/description" type:"string" json:"description"`
		HideClick      bool   `path:"/hide_click" type:"bool" json:"hide_click"`
		IsLivePlayback int    `path:"/is_live_playback" type:"json.Number" json:"is_live_playback"`
		IsPay          int    `path:"/is_pay" type:"json.Number" json:"is_pay"`
		IsSteinsGate   int    `path:"/is_steins_gate" type:"json.Number" json:"is_steins_gate"`
		IsUnionVideo   int    `path:"/is_union_video" type:"json.Number" json:"is_union_video"`
		Length         string `path:"/length" type:"string" json:"length"`
		Mid            string `path:"/mid" type:"json.Number" json:"mid"`
		Pic            string `path:"/pic" type:"string" json:"pic"`
		Play           uint64 `path:"/play" type:"json.Number" json:"play"`
		Review         uint64 `path:"/review" type:"json.Number" json:"review"`
		Subtitle       string `path:"/subtitle" type:"string" json:"subtitle"`
		Title          string `path:"/title" type:"string" json:"title"`
		TypeId         int64  `path:"/typeid" type:"json.Number" json:"typeid"`
		VideoReview    uint64 `path:"/video_review" type:"json.Number" json:"video_review"`
	} `path:"/data/list/vlist" type:"array" json:"video_list"`
	Page struct {
		Count int `path:"/count" type:"json.Number" json:"count"`
		Pn    int `path:"/pn" type:"json.Number" json:"pn"`
		Ps    int `path:"/ps" type:"json.Number" json:"ps"`
	} `path:"/data/page" type:"object" json:"page"`
}

func XSpaceArcSearch

func XSpaceArcSearch(body []byte) (dat XSpaceArcSearchStruct, err error)

Jump to

Keyboard shortcuts

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