go get github.com/birjemin/douyuapi
- token获取接口 ✅
- 直播视频流 ✅
- 房间信息
- 分类信息
- 批量获取idfa信息
⚠️ - 分类列表房间信息
- 点播视频
- 获取点播二级分类列表
⚠️ - 点播二级分类视频列表
⚠️ - 点播UP主视频列表
⚠️ - 点播推荐池视频列表
⚠️ - 点播拉流接口
⚠️ - 点播视频下载接口
⚠️
- 获取点播二级分类列表
- 智能分类
- 直播场次信息
⚠️ - 房间弹幕(一期)
- 直播音频流
⚠️
- 示例
httpClient := &utils.HTTPClient{
Client: &http.Client{
Timeout: 5 * time.Second,
},
}
token := &Token{
BaseClient: BaseClient{
Client: httpClient,
Secret: "test-secret",
AID: "test-aid",
},
}
timestamp := cast.ToString(utils.GetCurrTime())
if ret, err := token.Handle(timestamp); err != nil {
// handle err
} else {
if ret.Code != 0 {
// handle err
}
// get ret.Data.Token
}
live := &Live{
BaseClient: BaseClient{
Client: httpClient,
Secret: "test-secret",
AID: "test-aid",
},
Token: "test-token",
}
msg := `{"cid_type":1,"cid":1,"limit":10,"offset":0}`
if ret, err := live.Handle(msg, cast.ToString(timestamp)); err != nil {
// handle err
} else {
if ret.Code != 0 {
// handle err
}
// handle
}
后续会补足新接口