1、获取硬盘推流(伪直播)视频列表
2、接口支持https协议
http://api.polyv.net/live/v3/channel/disk-video/list
http://api.polyv.net/live/v3/channel/disk-video/list?appId=frlr1zazn3&sign=2E8DE3C2E5D62468917CF3A9B2DBC3D6&channelId=3889955×tamp=1681983834988
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(ChannelStateTest.class);
/**
* 获取硬盘推流(伪直播)视频列表
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testListDiskVideo() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v3/channel/disk-video/list";
String channelId = "3889955";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试获取硬盘推流(伪直播)视频列表,返回值:{}", response);
//do somethings
}
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageSize": 10,
"pageNumber": 1,
"totalItems": 1,
"contents": [
{
"videoId": "gjzwgmer37",
"videoPoolId": "1b448be323e0bb0564cdd816ce4fac61",
"userId": "1b448be323",
"channelId": 3889955,
"title": "2-1 认识对象",
"firstImage": "1b448be323/1/1b448be323e0bb0564cdd816ce4fac61_0.jpg",
"duration": "00:17:36",
"status": "N",
"startTime": 1681373864000,
"endTime": 1681374920000,
"createdTime": 1681373802000,
"lastModified": 1681373865000,
"url": "http://mpv.videocc.net/1b448be323/1/1b448be323e0bb0564cdd816ce4fac61_1.mp4",
"localFileName": "/data/diskvideo/202304/gjzwgmer37.mp4",
"processId": 27944,
"streamStatus": "end",
"pushIp": "172.18.148.58",
"langType": "CN",
"source": "VideoPool"
}
],
"limit": 1,
"endRow": 1,
"nextPageNumber": 1,
"totalPages": 1,
"startRow": 1,
"firstPage": true,
"lastPage": true,
"prePageNumber": 1,
"offset": 0
}
}
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}