1、通过播放列表id和视频id将视频从播放列表移除
2、接口支持https协议
http://api.polyv.net/v2/play-list/remove-video
http://api.polyv.net/v2/play-list/remove-video
vid=1b448be3239c2ef0cb3ab9fd105f7fb2_1&sign=316893CB4ED5E1ABDDA1883E2FEB4423DAF612C4&userid=1b448be323&ptime=1621217938573&playListId=1616396785347
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodPlaylistTest.class);
/**
* 将视频从播放列表移除
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testRemoveVideoToPlaylist() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/play-list/remove-video";
String playListId = "1616396785347";
String vid = "1b448be3239c2ef0cb3ab9fd105f7fb2_1";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("playListId", playListId);
requestMap.put("vid", vid);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试将视频从播放列表移除,{}", response);
//do somethings
}
{
"code": 200,
"status": "success",
"message": "success"
}
{
"code": 400,
"status": "error",
"message": "the sign is not right",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "ptime is too old.",
"data": ""
}