一个简单的微云视频解析

2018年3月6日16:12:18 发表评论 1,607 阅读
?php
header("Content-Type: text/html; charset=UTF-8");

	$url1 = @$_GET['v'];
	$url2 = @$_GET['dirKey'];
    $url3 = @$_GET['pdirKey'];
    $url4 = @$_GET['shareKey'];
	$url5 = @$_GET['fileName'];
$url1  = str_replace('https','http' ,$url1);
	if (@$_GET['fileName']) {
		$url = $url1."&dirKey=".$url2."&shareKey=".$url4.'&fileName='.$url5;
	}else {
		$url = $url1."&dirKey=".$url2."&pdirKey=".$url3;
	}
	
	
	

//echo $url;

$header = array();
$header[]="Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
$header[]="Accept-Encoding:gzip, deflate, sdch";
$header[]="Accept-Language:zh-CN,zh;q=0.8";
$header[]="Cache-Control:max-age=0";
$header[]="Connection:keep-alive";
$header[]="Cookie:ts_uid=1048896500; ptisp=cnc; ptcz=434055d178a417b4a293eba021756283ef5c43c49ece7e26c51ba03b6dd9494c; pgv_info=ssid=s7031149916; pgv_pvid=5978709353; web_wx_rc=RLOESSXKWRRG; uin=o1347847280; skey=@ru0T5aacK; pt2gguin=o1347847280; p_uin=o1347847280; pt4_token=h7nG*oU7YrezLBePD*trdACaOprpI0fi6SADu4bWbYw_; p_skey=YyiqmDbQCoz*e3sBPLlxWQKXV8Et1rpaGmABoVY4MpE_; login_appid=10002; login_apptoken_type=1; login_apptoken=@ru0T5aacK; login_apptoken_uid=1347847280";
$header[]="Host:www.weiyun.com";
$header[]="Referer:http://www.weiyun.com/disk/folder/7084565041813d73897e834ab757f502";
$header[]="Upgrade-Insecure-Requests:1";
$header[]="User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.4549.400 QQBrowser/9.7.12900.400";
  




$ch =curl_init($url);  

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$result = curl_exec($ch);

if (@$_GET['fileName']) {
		$name  = get_between($result,'https_download_url":"', '","video_url'); 
	}else {
		$name  = get_between($result,'https_download_url":"', '","check_file_sha'); 
	}
	
if(!$url2){
  $name =$url1;
}


//var_dump($result);

function get_between($input, $start, $end) {
  $substr = substr($input, strlen($start)+strpos($input, $start),
 (strlen($input) - strpos($input, $end))*(-1));
  return $substr;

}

这算是一个残次品,可以使用,播放器自己添加。因为cookie失效特别快,大概一天的时间,还得实时的取获取cookie,所以就没往下写,这个主要就是自己用来往网站上放视频的。视频连接是

http://www.weiyun.com/video_preview?videoID=2dd8fd01-171b-4747-b836-277a890336f4&dirKey=708456506f74ebe3943aacbed726de2b

这个样子的,进入网页版视频 点击视频播放会出现这个页面 这个页面的url就是需要用到的地址!

一个简单的微云视频解析

张晔璇

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: