首页 - 开发工具

8 - 在线代码运行


            
执行结果

名称:8

当前代码

<?php
error_reporting(0);
//header('Content-type: text/json;charset=utf-8');

$aa = $_GET["url"];






	 $tmp = explode("id_", $aa);
	$tmp = explode(".html", $tmp[1]);
	$vid=$tmp[0];
	

$utid = 'oqikEO1b7CECAbfBdNNf1PM1';
	
  
	
	

$v= json_decode(Https("https://ups.youku.com/ups/get.json?vid=$vid&ccode=0502&client_ip=192.168.1.1&utid=$utid&client_ts=".time()."&ckey=DIl58SLFxFNndSV1GFNnMQVYkx1PP5tKe1siZu%2F86PR1u%2FWh1Ptd%2BWOZsHHWxysSfAOhNJpdVWsdVJNsfJ8Sxd8WKVvNfAS8aS8fAOzYARzPyPc3JvtnPHjTdKfESTdnuTW6ZPvk2pNDh4uFzotgdMEFkzQ5wZVXl2Pf1%2FY6hLK0OnCNxBj3%2Bnb0v72gZ6b0td%2BWOZsHHWxysSo%2F0y9D2K42SaB8Y%2F%2BaD2K42SaB8Y%2F%2BahU%2BWOZsHcrxysooUeND%20HTTP%2F1.1"),true);


$stream = $v['data']['stream'];
$url = $stream[0]["m3u8_url"];


$m4= preg_replace('/&type=(.*?)&/ism','&type=hd2&',$url);	






function Https($url,$c){
	
	//global $cookie2;
	
	
    $curl = curl_init();
    $headers = array();
    curl_setopt($curl, CURLOPT_URL, $url);
	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查 
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
	
 
	
	
       
       //$headers[] = 'Accept-Encoding: gzip, deflate';
	   $headers[] = 'cache-control: no-cache';
		$headers[] = 'Accept-Language:zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3';
      $headers[] = 'Host: ups.youku.com';
	  $headers[] = 'Referer: http://v.youku.com';
		$headers[] = 'Cookie: P_pck_rm=fgsbY75QJzl3pj1lKSBw7RWTxeKWPXa9W%2FxgMFDp5XXNya4SktfwTKvFLMDlfSqjNMbgVCPX8OXkY26A8prIx%2FISzpaU7MP5hbc4Y05w8D%2FnzLhOEloicDLsl96%2BanfNR2Ujfa%2BoVSDAglUcHSyrPZrF2hVDMjBe4ZCAsQsCgEk%3D;';    //COOIE
		$headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
		$headers[] = 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1';
        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    
    return curl_exec($curl);
}


?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
body {
	background-color: #000;
	margin-left: 0px;
	margin-top: 0px;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>*{margin:0;padding:0}</style>
</head>
<body>
<div id="a1"></div>
<script type="text/javascript" src="//apps.bdimg.com/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="/hcplay/hc.js" charset="utf-8"></script>
<script type="text/javascript">
	var isiPad = navigator.userAgent.match(/iPad|iPhone|Android|Linux|iPod/i) != null;
  if(isiPad){
	document.getElementById('a1').innerHTML = '<video src="<?php echo $m4;?>" controls="controls" autoplay="autoplay" poster="loading.gif" width="100%" height="100%" x-webkit-airplay="allow"></video>';
      }else {
		flashvars={
			f:'/m3u8.swf',
			a:encodeURIComponent(decodeURIComponent('<?php echo $m4;?>')),
			p:1,c:0,s:4,lv:0,e:0
		};		
		var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};
		var video=['->video/mp4'];
		CKobject.embed('/hcplay/hc.swf','a1','ckplayer_a1','100%','100%',false,flashvars,video,params);
	  }
</script>
</body>
</html>

推荐工具:

工具标签:

测试

工具说明:

在线IDE编辑好代码在线运行,在线代码运行支持PHP、Node、Python、Bash等等

可以将运行的代码分享给别人使用或运行。