Get Playlist Information
Updated: 2022-05-23 19:02:59
Interface URL
https://api.polyv.net/v2/play-list/list
Interface Description
Retrieve playlist information.
Supported Format
JSON
Request Method
GET
Request Parameters
| Parameter | Required | Type and Range | Description |
|---|---|---|---|
| userid | Yes | string | User ID |
| ptime | Yes | long | Current time in milliseconds (13 digits), valid for 3 minutes |
| sign | Yes | String | Signature, a 40-character uppercase SHA1 value [See Signature Generation Rules] |
| playListIds | No | string | Playlist IDs, separated by commas, max 1000, e.g., "1620153765497,1620142496099" |
| title | No | string | Title, fuzzy search by title |
| page | No | int | Current page number, default is 1 |
| pageSize | No | int | Page size, max 1000, default is 10 |
Example of Successful JSON Response
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"pageNumber": 1,
"totalPages": 1,
"pageSize": 10,
"contents": [
{
"id": 1620142496099,
"description": "播放列表描述",
"tag": "播放列表标签",
"title": "播放列表标题",
"creationTime": 1620142496099,
"updateTime": 1620208243903,
"videoCount": 2,
"videoList": [
{
"vid": "a2dc4f2517d7a3b462dc1876c333fd32",
"title": "视频标题",
"duration": 732.0,
"coverURL": "http://img.videocc.net/uimage/a/a2dc4f2517/first_image/9b16020e-c3f7-4b0d-9c55-ba5171eb7857_s.png",
}
]
}
],
"totalItems": 1
}
}
Example of Error JSON Response
签名不正确
{
"code":400,
"status":"error",
"message":"the sign is not right",
"data":""
}
时间戳过期
{
"code":400,
"status":"error",
"message":"ptime is too old.",
"data":""
}
Field Description
| Field | Type | Description |
|---|---|---|
| code | int | Return code |
| status | string | Return status |
| message | string | Return message |
| data | object | Operation result |
| pageNumber | int | Page number |
| totalPages | int | Total pages |
| pageSize | int | Page size |
| totalItems | int | Total items |
| contents | array | Paginated data |
| id | long | Playlist ID |
| description | string | Playlist description |
| tag | string | Playlist tag |
| title | string | Playlist title |
| creationTime | long | Playlist creation time, 13-digit millisecond timestamp |
| updateTime | long | Playlist last update time, 13-digit millisecond timestamp |
| videoCount | int | Number of videos in the playlist |
| videoList | array | Array of videos in the playlist |
| vid | string | Video vid |
| videoList.title | string | Video title |
| duration | float | Video duration, in seconds |
| coverURL | string | Video cover image URL |
Java Request Example:
public void testGetPlayList() throws Exception {
String url = "https://api.polyv.net/v2/play/list";
Map<String, String> params = new HashMap<>();
params.put("userid", userid);
params.put("ptime", String.valueOf(System.currentTimeMillis()));
params.put("sign", getSign(params, secretkey));
String response = HttpClientUtil.getInstance().sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
System.out.println(response);
}
