获取最新视频/全部视频列表(v1.0 版)

getNewList

    作用:获取用户最新上传视频的列表

URL

    http://v.polyv.net/uc/services/rest?method=getNewList

支持格式

    XML/JSON

HTTP请求方式

    POST,GET

请求数限制

    TRUE

请求参数

参数名必选类型及范围说明
readtokentruestring用户的读取钥匙
pageNumtrueint取第几页
numPerPagefalseint平均每页多少条数据
catatreefalsestring视频所在分类
formatfalsestring默认返回json格式,如果format=xml返回xml格式
jsonpfalsestring 例如,正常情况{error:0,data:””},加 jsonp=a后返回a({error:0,data:””})

附:可以添加参数catatree,来获取一个视频分类下的全部视频列表

注意事项

    返回错误列表
返回说明
0无错误
1找不到writetoken关联的user
2文件为空或者writetoken为空
3提交的json名字JSONRPC为null
4提交文件格式不正确
5readtoken为空
6分页输入出错
7vid不能为空
8找不到方法名

返回结果

<xml>
<error>0</error>
1214
<data>
<video>
<swf_link>

http://player.polyv.net/videos/e2e84a73834420049e9227c4bd1ddbc5_e.swf

</swf_link>
<status>60</status>
<tag>心灵鸡汤</tag>
<seed>1</seed>
<playerwidth>400</playerwidth>
<title>Wildlife</title>
<duration>00:00:30</duration>
<df>3</df>
<first_image>

http://img.videocc.net/uimage/e/e2e84a7383/5/e2e84a73834420049e9227c4bd1ddbc5_0.jpg

</first_image>
<times>1</times>
<context>动物</context>
<original_definition>1280x720</original_definition>
<playerheight>300</playerheight>
<vid>e2e84a73834420049e9227c4bd1ddbc5_e</vid>
<ptime>2014-09-09 09:44:07</ptime>
<cataid>1410230776538</cataid>
</video>
<video>
<swf_link>

http://player.polyv.net/videos/e2e84a7383a3276af77d75de601b492f_e.swf

</swf_link>
<status>60</status>
<tag>心,灵,鸡,汤</tag>
<seed>1</seed>
<playerwidth>600</playerwidth>
<title>58同城新版广告</title>
<duration>00:00:15</duration>
<df>1</df>
<first_image>

http://img.videocc.net/uimage/e/e2e84a7383/f/e2e84a7383a3276af77d75de601b492f_0.jpg

</first_image>
<times>1</times>
<context/>
<original_definition>448x336</original_definition>
<playerheight>466</playerheight>
<vid>e2e84a7383a3276af77d75de601b492f_e</vid>
<ptime>2014-09-09 09:43:47</ptime>
<cataid>1</cataid>
</video>
<video>
<swf_link>

http://player.polyv.net/videos/e2e84a73839658998dc52f06ee0c3ca0_e.swf

</swf_link>
<status>60</status>
<tag/>
<seed>1</seed>
<playerwidth>600</playerwidth>
<title>心态的能量</title>
<duration>00:21:42</duration>
<df>1</df>
<first_image>

http://img.videocc.net/uimage/e/e2e84a7383/0/e2e84a73839658998dc52f06ee0c3ca0_6.jpg

</first_image>
<times>1</times>
<context/>
<original_definition>1364x768</original_definition>
<playerheight>353</playerheight>
<vid>e2e84a73839658998dc52f06ee0c3ca0_e</vid>
<ptime>2014-09-09 09:24:27</ptime>
<cataid>1410230787507</cataid>
</video>
</data>
</xml>

JSON示例

{"total":"1214","error": "0","data": [
{"swf_link":"http://player.polyv.net/videos/e2e84a73834420049e9227c4bd1ddbc5_e.swf",
"status": "60",
"tag": "心灵鸡汤",
"seed": 1,
"playerwidth": "400",
"title": "Wildlife",
"duration": "00:00:30",
"df": 3,
"first_image":"http://img.videocc.net/uimage/e/e2e84a7383/5/e2e84a73834420049e9227c4bd1ddbc5_0.jpg",
"times": "1",
"context": "动物",
"original_definition": "1280x720",
"playerheight": "300",
"vid": "e2e84a73834420049e9227c4bd1ddbc5_e",
"ptime": "2014-09-09 09:44:07",
"cataid": "1410230776538"
},{
"swf_link":"http://player.polyv.net/videos/e2e84a7383a3276af77d75de601b492f_e.swf",
"status": "60",
"tag": "心,灵,鸡,汤",
"seed": 1,
"playerwidth": "600",
"title": "58同城新版广告",
"duration": "00:00:15",
"df": 1,
"first_image":"http://img.videocc.net/uimage/e/e2e84a7383/f/e2e84a7383a3276af77d75de601b492f_0.jpg",
"times": "1",
"context": "",
"original_definition": "448x336",
"playerheight": "466",
"vid": "e2e84a7383a3276af77d75de601b492f_e",
"ptime": "2014-09-09 09:43:47",
"cataid": "1"
},{
"swf_link":"http://player.polyv.net/videos/e2e84a73839658998dc52f06ee0c3ca0_e.swf",
"status": "60",
"tag": "",
"seed": 1,
"playerwidth": "600",
"title": "心态的能量",
"duration": "00:21:42",
"df": 1,
"first_image":"http://img.videocc.net/uimage/e/e2e84a7383/0/e2e84a73839658998dc52f06ee0c3ca0_6.jpg",
"times": "1",
"context": "",
"original_definition": "1364x768",
"playerheight": "353",
"vid": "e2e84a73839658998dc52f06ee0c3ca0_e",
"ptime": "2014-09-09 09:24:27",
"cataid": "1410230787507"
}]
}

字段说明

字段说明
error错误提示
total视频总数
swf_link返回flash连接
duration返回时长
title标题
first_image视频图片
times点击次数
tag标签
context内容
ptime上传时间
vid视频id
如果想获取全部视频的信息,可以这样使用该接口:http://v.polyv.net/uc/services/rest?method=getNewList&readtoken=029rgH9Jv1-K3dXIp08aa-OBvewWUcbb&pageNum=1&numPerPage=10000其中&pageNum=1&numPerPage=10000表示把所有视频弄到一页来获取,这一页的集合里面的视频数有10000个。
如果API想调用签名,可参考http://dev.polyv.net/2014/09/23/jsapi0028/ 按参数签名顺序拼凑字符串为catatree=$(catatree)&numPerPage=$(numPerPage)&pageNum=$(pageNum)&readtoken=$(readtoken)$(secretkey),并进行sha1计算,得到sign。
以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...