https://api.polyv.net/v2/video/refresh-cdn-cache
1. 点播视频CDN刷新预热,目前仅支持预热点播zip文件
2. 提交任务后,需 5-10 分钟左右才能生效
3. 同一个用户,每天最多刷新预热 2000 个文件
1. 支持POST请求,参数需放在请求体中,并以form表单的形式提交
2. Content-Type: application/x-www-form-urlencoded
{
"vid": "e6b23c6f513fbe025b94efdd10d7ab47_e",
"brIndex": 1
},
{
"vid": "e6b23c6f513fbe025b94efdd10d7ab47_e",
"brIndex": 2
},
{
"vid": "e6b23c6f513fbe025b94efdd10d7ab47_e",
"brIndex": 3
}
### 返回结果
### JSON示例
```json
上传成功返回示例
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"taskId": "b3ad461ef1df4afc9340427767968a4c"
}
}
时间戳过期
{
"code": 400,
"status": "error",
"message": "ptime is too old",
"data": null
}
签名不正确
{
"code": 400,
"status": "error",
"message": "the sign is not right.",
"data": null
}
提交的vid中存在不合法值
{
"code": 400,
"status": "error",
"message": "illeagal vid",
"data": null
}
每次提交不能超过100个文件
{
"code": 400,
"status": "error",
"message": "can't submit more than 100 files",
"data": null
}
码率不存在
{
"code": 400,
"status": "error",
"message": "bitrate does not exist",
"data": null
}
每天不能提交超过2000个文件
{
"code": 400,
"status": "error",
"message": "can't submit more than 2000 files one day",
"data": null
}
String url = "https://api.polyv.net/v2/video/refresh-cdn-cache";
String userid = "xxxxxxx";
String vid = "xxxxxxxxxxxxxxxxxxxx";
String secretkey = "xxxxxxx";
String videos = "[{\"vid\": \"e6b23c6f513fbe025b94efdd10d7ab47_e\",\"brIndex\": 1}]";
long ptime = System.currentTimeMillis();
Map<String, String> params = new HashMap<>();
params.put("ptime", String.valueOf(ptime));
params.put("userid", userid);
params.put("videos", videos);
params.put("action", "push");
params.put("fileType", "zip");
params.put("sign", getSign(params, secretkey));
String content = HttpClientUtil.getInstance().sendHttpPost(url, params);
System.out.println(content);