Documentation ¶
Index ¶
Constants ¶
View Source
const ( WS_OP_HEARTBEAT = 2 WS_OP_HEARTBEAT_REPLY = 3 WS_OP_MESSAGE = 5 WS_OP_USER_AUTHENTICATION = 7 WS_OP_CONNECT_SUCCESS = 8 WS_PACKAGE_HEADER_TOTAL_LENGTH = 16 WS_PACKAGE_OFFSET = 0 WS_HEADER_OFFSET = 4 WS_VERSION_OFFSET = 6 WS_OPERATION_OFFSET = 8 WS_SEQUENCE_OFFSET = 12 WS_BODY_PROTOCOL_VERSION_NORMAL = 0 WS_BODY_PROTOCOL_VERSION_DEFLATE = 2 WS_BODY_PROTOCOL_VERSION_BROTLI = 3 WS_HEADER_DEFAULT_VERSION = 1 WS_HEADER_DEFAULT_OPERATION = 1 WS_HEADER_DEFAULT_SEQUENCE = 1 WS_AUTH_OK = 0 WS_AUTH_TOKEN_ERROR = -101 )
View Source
const ( Protover = 3 Platform = "web" Type = 2 )
View Source
const UA = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.3`
Variables ¶
View Source
var C = new(Common).Init()
View Source
var StreamO = new(sync.Map)
StreamRec fmp4 https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming
Functions ¶
func DefaultHttpCheck ¶ added in v0.9.8
Types ¶
type Common ¶ added in v0.5.10
type Common struct { PID int `json:"pid"` //进程id Version string `json:"version"` //版本 Uid int `json:"-"` //client uid Live []LiveQn `json:"-"` //直播流链接 Live_qn int `json:"liveQn"` //当前直播流质量 Live_want_qn int `json:"-"` //期望直播流质量 Roomid int `json:"roomid"` //房间ID Cookie syncmap.Map `json:"-"` //Cookie Title string `json:"title"` //直播标题 Uname string `json:"uname"` //主播名 UpUid int `json:"upUid"` //主播uid Rev float64 `json:"rev"` //营收 Renqi int `json:"renqi"` //人气 Watched int `json:"watched"` //观看人数 OnlineNum int `json:"onlineNum"` //在线人数 GuardNum int `json:"guardNum"` //舰长数 ParentAreaID int `json:"parentAreaID"` //父分区 AreaID int `json:"areaID"` //子分区 Locked bool `json:"locked"` //直播间封禁 Note string `json:"note"` //分区排行 Live_Start_Time time.Time `json:"liveStartTime"` //直播开始时间 Liveing bool `json:"liveing"` //是否在直播 Wearing_FansMedal int `json:"-"` //当前佩戴的粉丝牌 Token string `json:"-"` //弹幕钥 WSURL []string `json:"-"` //弹幕链接 LiveBuvidUpdated time.Time `json:"-"` //LIVE_BUVID更新时间 Stream_url *url.URL `json:"-"` //直播Web服务 Proxy string `json:"-"` //全局代理 AcceptQn map[int]string `json:"-"` //允许的直播流质量 Qn map[int]string `json:"-"` //全部直播流质量 // StreamType StreamType `json:"streamType"` //当前直播流类型 AllStreamType map[string]StreamType `json:"-"` //直播流类型 K_v syncmap.Map `json:"-"` //配置文件 Log *log.Log_interface `json:"-"` //日志 Danmu_Main_mq *mq.Msgq `json:"-"` //消息 ReqPool *pool.Buf[reqf.Req] `json:"-"` //请求池 SerF *web.WebPath `json:"-"` //web服务处理 SerLimit *web.Limits `json:"-"` //Web服务连接限制 StartT time.Time `json:"-"` //启动时间 Cache syncmap.MapExceeded[string, any] `json:"-"` //缓存 }
func (*Common) DisableLive ¶ added in v0.5.11
func (*Common) DisableLiveAuto ¶ added in v0.6.1
自动停用机制
type LiveQn ¶ added in v0.5.11
type ResStruct ¶ added in v0.6.2
type ResStruct struct { Code int `json:"code"` Message string `json:"message"` Data any `json:"data"` }
Web服务响应格式
type StreamType ¶ added in v0.5.11
Click to show internal directories.
Click to hide internal directories.