http://api.polyv.net/v2/video/{userid}/search
<?php
$userid="9f1e0689e1";//必选
$format="";
$jsonp="";
$numPerPage=100;
$pageNum=1;
$ptime=time()*1000;//必选
$tag="刘诗昆";
$secretkey="AkDipaULWw";
$post_data = array (
"format" => $format,
"jsonp" => $jsonp,
"numPerPage" => $numPerPage,
"pageNum" => $pageNum,
"ptime" => $ptime,
"tag" => $tag
);
$str="";
foreach ($post_data as $key => $value){
if (!empty($value)) {
$str.=$key."=".$value."&";
}else{
unset($post_data[$key]);
}
}
$str=substr($str, 0,strlen($str)-1);
$str.=$secretkey;
// echo $str;
// die();
$hash=strtoupper(sha1($str));
$post_data["sign"] = $hash;
// var_dump($post_data);
// exit();
$url="http://api.polyv.net/v2/video/{$userid}/search";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);
?>
<xml>
<code>200</code>
<status>success</status>
<message>success</message>
<data>
<tag>刘诗昆,110435</tag>
<mp4>http://mpv.videocc.net/9f1e0689e1/6/9f1e0689e1a156fc6b373eab9195b0c6_1.mp4</mp4>
<title>刘诗昆钢琴教程4</title>
<df>1</df>
<times>68</times>
<vid>9f1e0689e1a156fc6b373eab9195b0c6_9</vid>
<mp4_1>http://mpv.videocc.net/9f1e0689e1/6/9f1e0689e1a156fc6b373eab9195b0c6_1.mp4</mp4_1>
<cataid>1470122811372</cataid>
<swf_link>http://player.polyv.net/videos/9f1e0689e1a156fc6b373eab9195b0c6_9.swf</swf_link>
<status>60</status>
<seed>0</seed>
<playerwidth>600</playerwidth>
<duration>00:35:52</duration>
<first_image>http://img.videocc.net/uimage/9/9f1e0689e1/6/9f1e0689e1a156fc6b373eab9195b0c6_5.jpg</first_image>
<original_definition>384x294</original_definition>
<context></context>
<playerheight>458</playerheight>
<ptime>2016-04-28 12:11:10</ptime>
<source_filesize>65153042</source_filesize>
<filesize>69789952</filesize>
<md5checksum>b6dc8cd9ac9f189e5e2efeba8fd62d9b</md5checksum>
<hls>http://hls.videocc.net/9f1e0689e1/9/9f1e0689e1a156fc6b373eab9195b0c6_1.m3u8</hls>
</data>
</xml>
{
"code": 200,
"status": "success",
"message": "success",
"data": [
{
"tag": "刘诗昆,110435",
"mp4": "http://mpv.videocc.net/9f1e0689e1/6/9f1e0689e1a156fc6b373eab9195b0c6_1.mp4",
"title": "刘诗昆钢琴教程4",
"df": 1,
"times": "68",
"vid": "9f1e0689e1a156fc6b373eab9195b0c6_9",
"mp4_1": "http://mpv.videocc.net/9f1e0689e1/6/9f1e0689e1a156fc6b373eab9195b0c6_1.mp4",
"cataid": "1470122811372",
"swf_link": "http://player.polyv.net/videos/9f1e0689e1a156fc6b373eab9195b0c6_9.swf",
"status": "60",
"seed": 0,
"playerwidth": "600",
"duration": "00:35:52",
"first_image": "http://img.videocc.net/uimage/9/9f1e0689e1/6/9f1e0689e1a156fc6b373eab9195b0c6_5.jpg",
"original_definition": "384x294",
"context": "",
"playerheight": "458",
"ptime": "2016-04-28 12:11:10",
"source_filesize": 65153042,
"filesize": [
69789952
],
"md5checksum": "b6dc8cd9ac9f189e5e2efeba8fd62d9b",
"hls": [
"http://hls.videocc.net/9f1e0689e1/9/9f1e0689e1a156fc6b373eab9195b0c6_1.m3u8"
]
}
]
}
format=参数&jsonp=参数&numPerPage=参数&pageNum=参数&ptime=参数&tag=参数secureKey经过SHA-1加密再经过大写化 (注意:参数为空时,则在生成sign的时候不需要添加此字段。例如如果这里没有t,则不需要拼接&t=参数)