private static final Logger log = LoggerFactory.getLogger(VodVideoUploadTest.class);
/**
* 异步批量上传视频
*/
@Test
public void testUrlBatchUpload() 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/upload/multi", userid);
String uploadInfos = "[{\"fileUrl\":\"https://oss.polyv.net/uploads/2023/12/27YlLZVCM_test.mp4\"," +
"\"title\":\"测试异步上传视频1\",\"state\":\"test\"}]";
String cataid = "1602671097888";
String luping = "0";
String watermark = "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_0_b.jpg";
String watermarkLocation = "4";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("uploadInfos", uploadInfos);
requestMap.put("cataid", cataid);
requestMap.put("luping", luping);
requestMap.put("watermark", watermark);
requestMap.put("watermarkLocation", watermarkLocation);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试异步批量上传视频,{}", response);
//do somethings
}