1、导出视频同步任务列表中的单个任务,文件格式为csv
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
http://api.polyv.net/v2/video/grab/{userid}/listVideos/export
http://api.polyv.net/v2/video/grab/1b448be323/listVideos/export?sign=AA568246125A62B6CB277714DE7A63D0E430135B&ptime=1617160493739&taskId=0mKdBQDsbR
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodVideoUploadTest.class);
/**
* 导出视频同步任务
*/
@Test
public void testExportVideoSyncTask() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userid = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = String.format("http://api.polyv.net/v2/video/grab/%s/listVideos/export",userid);
String taskId = "0mKdBQDsbR";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("taskId", taskId);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
byte[] binary = HttpUtil.getBinary(url, requestMap, null);
String path = getClass().getResource("/file/").getPath() + "exportTask.csv";
HttpUtil.writeFile(binary, path);
log.debug("测试导出视频同步任务,{}", path);
//do somethings
}
D:/polyv-api-example/target/test-classes/file/exportTask.csv
{
"code":400,
"status":"error",
"message":"TaskId is null!",
"data":""
}