获取单个视频信息(v1.0 版)

getById

作用:获取用户单条视频记录

URL

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

支持格式

XML/JSON

HTTP请求方式

POST,GET

请求数限制

TRUE

请求参数

参数名必选类型及范围说明
readtokentruestring用户的读取钥匙
vidtruestring视频ID
formatfalsestring默认返回json格式,如果format=xml返回xml格式
jsonpfalsestring 例如,正常情况{error:0,data:""},加jsonp=a后返回a({error:0,data:""})

注意事项

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

返回结果

<xml>
<error>0</error>
<data>
<video>
<images_b>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_0_b.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_1_b.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_2_b.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_3_b.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_4_b.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_5_b.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_6_b.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_7_b.jpg</image>
</images_b>
<tag/>
<mp4>http://mpv.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_1.mp4</mp4>
<title>Youtube-Apple - Introducing iPhone 6 and iPhone 6 Plus_720P</title>
<df>3</df>
<times>3</times>
<mp4_1>http://mpv.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_1.mp4</mp4_1>
<mp4_3>http://mpv.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_3.mp4</mp4_3>
<vid>d81a899efaf1148b7cb87418cf3cf01a_d</vid>
<mp4_2>http://mpv.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_2.mp4</mp4_2>
<cataid>1409192674947</cataid>
<swf_link>http://player.polyv.net/videos/d81a899efaf1148b7cb87418cf3cf01a_d.swf</swf_link>
<status>60</status>
<seed>1</seed>
<flv2>http://plvod01.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_2.plv</flv2>
<hls3>http://v.polyv.net/hls/d81a899efaf1148b7cb87418cf3cf01a_d.m3u8?df=3</hls3>
<flv3>http://plvod01.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_3.plv</flv3>
<flv1>http://plvod01.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_1.plv</flv1>
<sourcefile>http://mpv.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a.mp4</sourcefile>
<playerwidth>600</playerwidth>
<hlsIndex>http://v.polyv.net/hlsIndex/d81a899efaf1148b7cb87418cf3cf01a_d.m3u8</hlsIndex>
<hls2>http://v.polyv.net/hls/d81a899efaf1148b7cb87418cf3cf01a_d.m3u8?df=2</hls2>
<default_video>http://plvod01.videocc.net/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_2.plv</default_video>
<hls1>http://v.polyv.net/hls/d81a899efaf1148b7cb87418cf3cf01a_d.m3u8?df=1</hls1>
<duration>00:06:23</duration>
<first_image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_1.jpg</first_image>
<original_definition>1280x720</original_definition>
<context/>
<images>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_0.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_1.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_2.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_3.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_4.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_5.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_6.jpg</image>
  <image>http://img.videocc.net/uimage/d/d81a899efa/a/d81a899efaf1148b7cb87418cf3cf01a_7.jpg</image>
</images>
<playerheight>370</playerheight>
<ptime>2014-09-15 14:26:47</ptime>
</video>
</data>
</xml>

JSON示例

{
error: "0",
data: [
{
images_b: [
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_0_b.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_1_b.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_2_b.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_3_b.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_4_b.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_5_b.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_6_b.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_7_b.jpg"
],
tag: "",
mp4: "http://mpv.videocc.net/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_1.mp4",
title: "3",
df: 1,
times: "0",
mp4_1: "http://mpv.videocc.net/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_1.mp4",
vid: "e2e84a7383f78f21025d3a814fb9bdc1_e",
cataid: "1",
swf_link: "http://player.polyv.net/videos/e2e84a7383f78f21025d3a814fb9bdc1_e.swf",
source_filesize: 51628904,
status: "60",
seed: 1,
flv1: "http://plvod01.videocc.net/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_1.plv",
sourcefile: "http://mpv.videocc.net/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1.mp4",
playerwidth: "600",
hlsIndex: "http://v.polyv.net/hlsIndex/e2e84a7383f78f21025d3a814fb9bdc1_e.m3u8",
hls1: "http://v.polyv.net/hls/e2e84a7383f78f21025d3a814fb9bdc1_e.m3u8?df=1",
default_video: "http://plvod01.videocc.net/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_1.plv",
duration: "00:21:42",
first_image: "http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_0.jpg",
original_definition: "1364x768",
context: "",
images: [
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_0.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_1.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_2.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_3.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_4.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_5.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_6.jpg",
"http://img.videocc.net/uimage/e/e2e84a7383/1/e2e84a7383f78f21025d3a814fb9bdc1_7.jpg"
],
playerheight: "490",
ptime: "2015-05-07 17:58:46"
}
]
}

字段说明

字段说明
error错误提示
swf_link返回flash连接
tag视频标签
mp4MP4源文件
playerwidth视频宽度
title标题
duration时长
filesize编码后各个清晰度视频的文件大小,类型为array
first_image视频首图
times播放次数
context视频描述
original_definition最佳分辨率
images视频截图
playerheight视频高度
ptime视频上传日期
context内容
ptime上传时间
vid视频id
cataid分类id, 如1为根目录
default_video用户默认播放视频
df视频码率数
flv1流畅码率flv格式视频地址
flv2高清码率flv格式视频地址
flv3超清码率flv格式视频地址
mp4_1流畅码率mp4格式视频地址
mp4_2高清码率mp4格式视频地址
mp4_3超清码率mp4格式视频地址
hlsIndex索引文件,记录每个清晰度的m3u8的链接
hls_1流畅清晰度的m3u8
hls_2高清清晰度的m3u8
hls_3超清清晰度的m3u8
images_b视频截图大图地址
seed加密视频为1,非加密为0
status视频状态
视频状态码含义
60/61已发布
10等待编码
20正在编码
50等待审核
51审核不通过
-1已删除
如果API想调用签名,可参考http://dev.polyv.net/2014/09/23/jsapi0028/ 按参数签名顺序拼凑字符串为readtoken=$(readtoken)&vid=$(vid)$(secretkey),并进行sha1计算,得到sign。
以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...