保利威文档中心

帮助中心

获取播放列表信息

更新时间:2022-05-23 19:02:59

接口URL

https://api.polyv.net/v2/play-list/list

接口说明

获取播放列表信息

支持格式

JSON

请求方式

GET

请求参数

参数名 必选 类型及范围 说明
userid string 用户ID
ptime long 当前时间的毫秒级时间戳(13位),3分钟内有效
sign String 签名,为40位大写的SHA1值【详见签名生成规则
playListIds string 播放列表ID,多个以英文逗号分隔,最大1000个,如"1620153765497,1620142496099"
title string 标题,按标题模糊搜索
page int 当前页码,默认为1
pageSize int 每页大小,最大1000条,默认为10

返回正确结果JSON示例

{
    "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
    }
}

返回错误结果JSON示例

签名不正确
{
    "code":400,
    "status":"error",
    "message":"the sign is not right",
    "data":""
}
时间戳过期
{
    "code":400,
    "status":"error",
    "message":"ptime is too old.",
    "data":""
}

字段说明

字段 类型 说明
code int 返回码
status string 返回状态
message string 返回信息
data object 操作结果
pageNumber int 页码
totalPages int 总页数
pageSize int 每页大小
totalItems int 总数
contents array 分页数据
id long 播放列表ID
description string 播放列表描述信息
tag string 播放列表标签
title string 播放列表标题
creationTime long 播放列表创建时间,13位毫秒时间戳
updateTime long 播放列表最近更新时间,13位毫秒时间戳
videoCount int 播放列表的视频数量
videoList array 播放列表的视频数组
vid string 视频vid
videoList.title string 视频标题
duration float 视频时长,单位:秒
coverURL string 视频首图url

java请求示例:

    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);
    }
联系客服,在线咨询