Modify Video Information
Updated: 2025-01-14 14:42:44
API Description
1、通过视频id修改视频信息
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
API URL
http://api.polyv.net/v2/video/{userid}/video-info
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| ptime | true | Long | Current time in milliseconds timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 40-character uppercase SHA1 value. The secretkey used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules |
| vid | true | String | Video ID |
| describ | false | String | Video description |
| format | false | String | Response data format, default is JSON format. xml: returns XML format json: returns JSON format |
| publishUrl | false | String | Video premiere external link |
| tag | false | String | Video tag |
| title | false | String | Video title |
Example
http://api.polyv.net/v2/video/1b448be323/video-info
Form parameters:
vid=1b448be323871ffe3d5a84a3638e82c2_1&describ=%E4%BF%9D%E5%88%A9%E5%A8%81%E6%98%AF%E5%85%A8%E7%90%83%E9%A2%86%E5%85%88%E7%9A%84%E4%BC%81%E4%B8%9A%E7%9B%B4%E6%92%AD%E6%9C%8D%E5%8A%A1%E5%95%86%EF%BC%8C%E9%9A%B6%E5%B1%9E%E4%BA%8E%E5%B9%BF%E5%B7%9E%E6%98%93%E6%96%B9%E4%BF%A1%E6%81%AF%E7%A7%91%E6%8A%80%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8%EF%BC%8C%E8%87%B4%E5%8A%9B%E4%BA%8E%E9%80%9A%E8%BF%87%E5%8F%AF%E9%9B%86%E6%88%90%E3%80%81%E5%8F%AF%E5%AE%9A%E5%88%B6%E7%9A%84%E8%A7%86%E9%A2%91%E7%9B%B4%E6%92%AD%E6%8A%80%E6%9C%AF%EF%BC%8C%E4%B8%BA%E4%BC%81%E4%B8%9A%E6%90%AD%E5%BB%BA%E8%87%AA%E4%B8%BB%E7%A7%81%E5%9F%9F%E7%9B%B4%E6%92%AD%E7%B3%BB%E7%BB%9F%EF%BC%8C%E5%B9%B6%E6%8F%90%E4%BE%9B%E7%9B%B4%E6%92%AD%E5%85%A8%E6%B5%81%E7%A8%8B%E8%BF%90%E8%90%A5%E4%B8%8E%E7%8E%B0%E5%9C%BA%E6%89%A7%E8%A1%8C%E6%9C%8D%E5%8A%A1%E3%80%82&sign=5AA9AF13716BCFF428B7E4C2F59930BDEF1DD901&tag=%E5%AE%A3%E4%BC%A0%E8%A7%86%E9%A2%91&title=%E4%BF%9D%E5%88%A9%E5%A8%81%E5%AE%A3%E4%BC%A0%E8%A7%86%E9%A2%91&ptime=1670903195195&publishUrl=http%3A%2F%2Fwww.polyv.net
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure. See global error description |
| status | String | Response status text |
| message | String | Response description. When code is 400 or 500, it provides auxiliary error reason description |
| data | Array | Returns detailed video information on success. See data field description |
Data Field Description
| Parameter | Type | Description |
|---|---|---|
| images_b | String[] | Large video screenshot URLs |
| images | String[] | Small video screenshot URLs |
| imageUrls | String[] | Video screenshot access links |
| tag | String | Video tag |
| mp4 | String | Smooth bitrate MP4 video URL |
| title | String | Video title |
| df | Integer | Video bitrate |
| times | String | Play count |
| vid | String | Video ID |
| mp4_1 | String | Smooth bitrate MP4 video URL |
| mp4_2 | String | HD bitrate MP4 video URL |
| mp4_3 | String | Super HD bitrate MP4 video URL |
| cataid | String | Category ID, e.g., 1 for default category |
| swf_link | String | Flash link |
| status | String | Video status 60/61: Published 10: Waiting for encoding 20: Encoding 50: Pending review 51: Review failed -1: Deleted |
| seed | Integer | 1 for encrypted video, 0 for non-encrypted |
| flv1 | String | Smooth bitrate FLV video URL |
| flv2 | String | HD bitrate FLV video URL |
| flv3 | String | Super HD bitrate FLV video URL |
| sourcefile | String | Source file |
| playerwidth | String | Video width |
| default_video | String | User default playback video |
| duration | String | Video duration, format: HH:MM:SS, e.g., 00:00:48 |
| first_image | String | Video thumbnail |
| original_definition | String | Optimal resolution |
| context | String | Video description |
| playerheight | String | Video height |
| ptime | String | Upload time |
| source_filesize | Long | Source file size, unit: byte |
| filesize | Long[] | File sizes for each encoded resolution, unit: byte |
| md5checksum | String | MD5 checksum |
| hls | String[] | M3U8 URLs for each encoded resolution |
| keepsource | String | Whether it is the source file: 0 for no, 1 for yes |
| uploader | Object | Uploader information. See uploader field description |
| cataname | String | Category name |
Uploader Field Description
| Parameter | Type | Description |
|---|---|---|
| String | Uploader email | |
| name | String | Uploader name |
| role | String | Uploader role, e.g., admin, uploader, primary account |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source code project. HttpUtil.java and VodSignUtil.java from the test cases are included in the download file.
It is strongly recommended to use the VOD Java SDK for API integration. The VOD Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(VodVideoManagementTest.class);
/**
* 修改视频信息
*/
@Test
public void testUpdateVideoInfo() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/video/" + userId + "/video-info";
String vid = "1b448be323871ffe3d5a84a3638e82c2_1";
String title = "保利威宣传视频";
String describ = "保利威是全球领先的企业直播服务商,隶属于广州易方信息科技股份有限公司,致力于通过可集成、可定制的视频直播技术,为企业搭建自主私域直播系统,并提供直播全流程运营与现场执行服务。";
String tag = "宣传视频";
String publishUrl = "http://www.polyv.net";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userId", userId);
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("describ", describ);
requestMap.put("tag", tag);
requestMap.put("title", title);
requestMap.put("publishUrl", publishUrl);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试修改视频信息,{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "success",
"data": [
{
"images_b": [
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_0_b.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1_b.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2_b.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3_b.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_4_b.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_5_b.jpg"
],
"images": [
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_0.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_4.jpg",
"1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_5.jpg"
],
"imageUrls": [
"http://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_0.jpg",
"http://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1.jpg",
"http://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2.jpg",
"http://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3.jpg",
"http://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_4.jpg",
"http://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_5.jpg"
],
"tag": "宣传视频",
"mp4": "http://mpv.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1.mp4",
"title": "保利威宣传视频",
"df": 3,
"times": "0",
"vid": "1b448be323871ffe3d5a84a3638e82c2_1",
"mp4_1": "http://mpv.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1.mp4",
"mp4_2": "http://mpv.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2.mp4",
"mp4_3": "http://mpv.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3.mp4",
"cataid": "1",
"swf_link": "http://player.polyv.net/videos/1b448be323871ffe3d5a84a3638e82c2_1.swf",
"status": "61",
"seed": 1,
"flv1": "http://plvod01.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1.mp4",
"flv2": "http://plvod01.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2.mp4",
"flv3": "http://plvod01.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3.mp4",
"sourcefile": "",
"playerwidth": "600",
"default_video": "http://plvod01.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3.mp4",
"duration": "00:01:49",
"first_image": "http://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_0_b.jpg",
"original_definition": "1920x1080",
"context": "保利威是全球领先的企业直播服务商,隶属于广州易方信息科技股份有限公司,致力于通过可集成、可定制的视频直播技术,为企业搭建自主私域直播系统,并提供直播全流程运营与现场执行服务。",
"playerheight": "337",
"ptime": "2022-12-12 17:47:19",
"source_filesize": 18839865,
"filesize": [
7774918,
14508330,
18866914
],
"md5checksum": "4b88804c015da508b5008f95846befc1",
"hls": [
"http://hls.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1.m3u8",
"http://hls.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2.m3u8",
"http://hls.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3.m3u8"
],
"uploader": {
"email": "sdk-demo@polyv.net",
"name": "sdk功能测试账号",
"role": "主账号"
},
"keepsource": "",
"cataname": "默认分类"
}
]
}
Error Example
{
"code": 400,
"status": "error",
"message": "请先选择目标视频。",
"data": ""
}
