https://api.polyv.net/live/v3/channel/monitor/rtmp-pull-url
1、接口用于获取频道获取频道的rtmp拉流地址
2、接口支持https
{
"code": 200,
"status": "success",
"message": "",
"data": "rtmp://pull-d1.videocc.net/recordf/4f57ea01de16002237826505a7b?auth_key=1602645379-0-0-5d6bc0d1ea472b161ee9e0ea3646bess"
}
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
{
"code": 400,
"data": "",
"message": "forbidden",
"status": "error"
}
public static void test() {
String url = "https://api.polyv.net/live/v3/channel/monitor/rtmp-pull-url";
// 用户对应的appId和加密串
String appId = "xxxxxxxxx";
String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
int channelId = 10001;
Map<String, String> params = new HashMap<>();
params.put("channelId", channelId);
params.put("day", 1);
PolyvTool.setLiveSign(params, appId, appSecret);
// 调用Polyv的httpClient工具类发送请求
String content = HttpClientUtil.getInstance()
.sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
System.out.println(content);
}