不需要COOKIE 请转 《QQ空间1006 1098 1097值PHP 解析源码(无需cookie)》
【需要qq空间 cookie】
(cookie 关键 键值 : p_uin p_skey )(p_skey必须是登陆QQ空间的p_skey值)
演示:因为会cookie会失效所以仅限在 发布时间内的24小时内有效,需要查看演示,请Q群联系管理
JSON:
PLAY DEMO
1075_0b536qaekaaayuakfa3jgrpdh5aeix2aarka
1006_8a075df6ef0f4bcc8da8a694b8c9ccbb
1098_8236c2a9ca54c34b14083c1e24000c08
1097_138f792ae3584a4e91cbf0844d70dbbb
手上没有1096 正常情况下也是可以解析的
(买前注意:Cookie 有时效性;不包更新和维护;为一次有效性付费)
浏览器书签,简单的快速获取您本机登陆的QQ空间Cookie;
javascript:(function(){var p_uin=document.cookie.match(new RegExp(/p_uin=(\S+);/i));var p_skey=document.cookie.match(new RegExp("p_skey(=.{44})"));alert(p_uin[0]+p_skey[0])})();
把他写入您浏览器的书签中。
源代码
##pay_s##
header('Content-type: text/json;charset=utf-8');
$h2_param = [];
$h2_param['url'] = @$_GET['url'];
$h2_param['cookie'] = 'p_uin=o0545456726;p_skey=DAZB6eCcYKxhT8hH61HSQLL5JnaS36e2XDslnE4o3hk_;';
if(empty($h2_param['url'])){
$h2_echo = [];
$h2_echo['code'] = -100;
$h2_echo['msg'] = 'url不能为空';
echo json_encode($h2_echo);
exit;
}else{
if(strpos($h2_param['url'], '_') === false) {
$h2_echo = [];
$h2_echo['code'] = -100;
$h2_echo['msg'] = 'url格式错误';
echo json_encode($h2_echo);
exit;
}
}
$urla = explode('_', $h2_param['url']);
$h2_param['type_num'] = $urla[0];
$h2_param['api_url'] = 'https://h5.qzone.qq.com/video/index?vid='.$h2_param['url'];
$h2_apihtml = get_curl_contents($h2_param['api_url'],0,0,$h2_param['cookie']);
//var f0url = "
preg_match('|var f0url = "(.*?)"|U',$h2_apihtml,$h2_playurl_a);
$h2_playurl = $h2_playurl_a[1];
if($h2_param['type_num'] == '1098'){
$h2_playurl = preg_replace('/((https|http)?:\/\/[0-9a-zA-Z_.-]+\/)/i','http://sochy.tcdn.qq.com/vmtt.tc.qq.com/',$h2_playurl);
}
$h2_playurl = preg_replace('/(&chgtype=[1-9]\d*)/i','&chgtype=1010',$h2_playurl);
$h2_playurl = preg_replace('/(&vuin=[1-9]\d*)/i','',$h2_playurl);
//
if(!empty($h2_playurl) && strpos($h2_playurl, '.mp4') !== false){
$h2_echo = [];
$h2_echo['code'] = 200;
$h2_echo['data'] = $h2_playurl;
$h2_echo['msg'] = '解析成功';
echo json_encode($h2_echo);
exit;
}else{
$h2_echo = [];
$h2_echo['code'] = -500;
$h2_echo['msg'] = '解析失败';
echo json_encode($h2_echo);
exit;
}
function get_curl_contents($url,$header=0,$nobody=0,$cookie=0){
if(!function_exists('curl_init')) die('php.ini未开启php_curl.dll');
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_HEADER, $header);
curl_setopt($c, CURLOPT_NOBODY, $nobody);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, FALSE);
if($cookie){
curl_setopt($c, CURLOPT_COOKIE, $cookie);
}
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($c, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.$_SERVER["REMOTE_ADDR"], 'CLIENT-IP:'.$_SERVER["REMOTE_ADDR"]));
curl_setopt($c, CURLOPT_REFERER, 'https://h5.qzone.qq.com/');
$content = curl_exec($c);
curl_close($c);
return $content;
}
?>
##hide_e##