wxchannels

package module
v0.0.0-...-4d400a7 Latest Latest
Warning

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

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

README

微信视频号后端接口模拟

视频号后端接口模拟,用于获取直播数据与回放地址下载

Documentation

Index

Constants

View Source
const (
	WX_VIDEO_ADMIN_HOST                  = `https://channels.weixin.qq.com`
	WX_VIDEO_ADMIN_URI_REPLAY_LIST       = `/cgi-bin/mmfinderassistant-bin/live/get_live_replay_list_v2`
	WX_VIDEO_ADMIN_URI_REPLAY_FRAGMENT   = `/cgi-bin/mmfinderassistant-bin/live/get_live_replay_wonderful_fragment`
	WX_VIDEO_ADMIN_URI_LIVE_HISTORY      = `/cgi-bin/mmfinderassistant-bin/live/get_live_history`
	WX_VIDEO_ADMIN_REPLAY_CREATE_SUCCESS = 3 //回访创建成功
	WX_ADMIN_SCENE_DEFAULT               = 7
	WX_ADMIN_REPLAY_INFO_FRAGMENT_DOWN   = 0 //所有视频分片都已处理成功
)
View Source
const (
	UA_MAC_FIREFOX = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ReqLiveHistoryList

type ReqLiveHistoryList struct {
	ReqScene          int32  `json:"reqScene"` // reqScene、scene 默认都是7
	Scene             int32  `json:"scene"`
	ReqType           int32  `json:"reqType"` //默认2
	UxTimesStart      int64  `json:"filterStartTime"`
	UxTimesEnd        int64  `json:"filterEndTime"`
	PageIndex         int32  `json:"currentPage"` //从1开始
	PageSize          int32  `json:"pageSize"`
	TimestampUixMilli string `json:"timestamp"`
	// contains filtered or unexported fields
}

func NewReqLiveHistoryList

func NewReqLiveHistoryList(pageIndex, pageSize int32) ReqLiveHistoryList

type ReqLivePlayInfo

type ReqLivePlayInfo struct {
	ObjectId          string `json:"objectId"`
	ReqScene          int32  `json:"reqScene"` // reqScene、scene 默认都是7
	Scene             int32  `json:"scene"`
	TimestampUixMilli string `json:"timestamp"`
	// contains filtered or unexported fields
}

func NewReqLiveReplayInfo

func NewReqLiveReplayInfo(id string) ReqLivePlayInfo

type ReqLiveReplayList

type ReqLiveReplayList struct {
	TimeFilter        ReqTimeFilter `json:"reqFilter"` //默认是0
	PageFilter        ReqPage       `json:"reqPage"`
	ReqScene          int32         `json:"reqScene"` // reqScene、scene 默认都是7
	Scene             int32         `json:"scene"`
	TimestampUixMilli string        `json:"timestamp"`
	// contains filtered or unexported fields
}

func NewReqLiveReplayList

func NewReqLiveReplayList(pageIndex, pageSize int32) ReqLiveReplayList

type ReqPage

type ReqPage struct {
	Index int32 `json:"pageIndex"` //当前位置,从1开始
	Size  int32 `json:"pageSize"`  //分页大小
}

type ReqTimeFilter

type ReqTimeFilter struct {
	Begin string `json:"startTimeBegin"` //都是timestamp
	End   string `json:"startTimeEnd"`
}

type RespLiveCommon

type RespLiveCommon struct {
	PluginSessionId *string     `json:"pluginSessionId"`
	RawKeyBuff      *string     `json:"rawKeyBuff"`
	Code            int32       `json:"errCode"`
	Msg             string      `json:"errMsg"`
	Data            interface{} `json:"data"`
}

func (RespLiveCommon) UnMarshalData

func (d RespLiveCommon) UnMarshalData(out any) (err error)

type RespLiveHistoryItem

type RespLiveHistoryItem struct {
	LiveObjectId   string             `json:"liveObjectId"`
	LiveData       RespLiveObjectStat `json:"liveStats"`
	UxCreateTime   int64              `json:"createTime"`
	MaxOnlineCount int64              `json:"maxOnlineCount"` //最大在线人数
}

type RespLiveHistoryList

type RespLiveHistoryList struct {
	TotalCount *int32                `json:"totalLiveCount"`
	Items      []RespLiveHistoryItem `json:"liveObjectList"`
}

type RespLiveObject

type RespLiveObject struct {
	LiveId           string              `json:"liveId"`
	ChargeType       int32               `json:"chargeType"` //收费类型
	DurationSecs     int64               `json:"duration"`
	ObjectId         string              `json:"objectId"`
	Media            RespLiveObjectMedia `json:"media"`
	ReplayCreateTime string              `json:"replayCreateTime"` //回放创建时间
	ReplayStatus     int32               `json:"replayStatus"`     //回放状态
	StartTime        string              `json:"startTime"`        //开播时间
}

type RespLiveObjectMedia

type RespLiveObjectMedia struct {
	Description    string `json:"description"`
	OriginCoverUrl string `json:"originCoverUrl"`
	ThumbUrl       string `json:"thumbUrl"`
}

type RespLiveObjectStat

type RespLiveObjectStat struct {
	LiveDurationInSeconds int64 `json:"liveDurationInSeconds"`
	TotalAudienceCount    int64 `json:"totalAudienceCount"`
}

type RespLivePlayInfo

type RespLivePlayInfo struct {
	CreatetimeUnix  int64  `json:"createtime"`
	Description     string `json:"description"`
	DurationSeconds int64  `json:"duration"`
	Height          int64  `json:"height"`
	Width           int64  `json:"width"`
	HlsUri          string `json:"hlsUrl"`
	ReplayUri       string `json:"replayUrl"`
	ThumbUri        string `json:"thumbUrl"` //封面
	FragmentStatus  int64  `json:"wonderfulFragmentStatus"`
}

func (RespLivePlayInfo) GetQa

func (d RespLivePlayInfo) GetQa() (qa string, err error)

func (RespLivePlayInfo) IsReadyForDownload

func (d RespLivePlayInfo) IsReadyForDownload() bool

是否已准备好

type RespLiveReplayList

type RespLiveReplayList struct {
	TotalCount *int32           `json:"totalCount"`
	LivePlays  []RespLiveObject `json:"replayObjects"`
}

type WxChannelLiveAdmin

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

腾讯视频号助手管理端相关接口

func NewWxChannelLiveAdmin

func NewWxChannelLiveAdmin(logger log.Logger) *WxChannelLiveAdmin

func (*WxChannelLiveAdmin) GetLiveHistory

func (r *WxChannelLiveAdmin) GetLiveHistory(req ReqLiveHistoryList) (res []RespLiveHistoryItem, allCount int32, err error)

func (*WxChannelLiveAdmin) GetLiveReplayInfo

func (r *WxChannelLiveAdmin) GetLiveReplayInfo(req ReqLivePlayInfo) (info RespLivePlayInfo, err error)

获取回放下载地址

func (*WxChannelLiveAdmin) GetLiveReplayList

func (r *WxChannelLiveAdmin) GetLiveReplayList(req ReqLiveReplayList) (livePlays []RespLiveObject, allCount int32, err error)

获取直播回放列表

func (*WxChannelLiveAdmin) GetReqClient

func (b *WxChannelLiveAdmin) GetReqClient(_headers map[string]string) *req.Client

func (*WxChannelLiveAdmin) GetUADefault

func (b *WxChannelLiveAdmin) GetUADefault() string

func (*WxChannelLiveAdmin) GetWxChannelAccount

func (r *WxChannelLiveAdmin) GetWxChannelAccount() WxLiveAccount

func (*WxChannelLiveAdmin) LoginAccount

func (r *WxChannelLiveAdmin) LoginAccount(cs []*http.Cookie) (err error)

func (*WxChannelLiveAdmin) SetAdminCookie

func (b *WxChannelLiveAdmin) SetAdminCookie(cs []*http.Cookie) (err error)

func (*WxChannelLiveAdmin) SetUa

func (b *WxChannelLiveAdmin) SetUa(ua string)

type WxLiveAccount

type WxLiveAccount struct {
	Uid            string // finderUsername,长字符串
	Nickname       string
	Avatar         string
	XAuthHeaderUin string //登录人微信账号ID
	UniqId         string //视频号ID,后台可见
}

func (WxLiveAccount) GetHeaderWechatUin

func (d WxLiveAccount) GetHeaderWechatUin() string

Jump to

Keyboard shortcuts

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