<?php
@header("Content-Type: text/html; charset=gb2312");
if(isset($_GET['wd'])) $url = safeurl($_GET['wd']);
(empty($url)) && exit();
$f = isset($_GET['f']) ? (!preg_match("/^[0-9]+$/",$_GET['f']) ? 0 : intval($_GET['f'])) : 0;
$f = 2; //默认为超清.
if($f == 1) {
$f = 'high';
} else if($f == 2) {
$f = 'super';
} else if($f == 5) {
$f = 'super2';
} else if($f == 9) {
$f = 'real';
} else {
$f = 'normal';
}
$url=str_replace(']','/',$url);
$url=str_replace('[','.',$url);
$url=str_replace('##','?',$url);
$url=str_replace('{','&',$url);
$page = getsite('http://www.flvso.com/so.php?wd='.$url.'');
$video = getbody($page,'<h2>下载地址:<span>请右击-目标另存为 or 复制链接地址到新的页面打开</span></h2>','支持网站',1);
$videos = explode('</a>',$video);
$video = '';
for($i=0;$i<count($videos);++$i){
$tmp = getbody($videos[$i],"href='",'"',1);
if(!empty($tmp)) {
$i > 0 && $video .= '';
$video .= "<a href='$tmp' target='_blank'>$tmp</a>";
}
}
$video=str_replace('&','&',$video);
echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>视频解析</title>
<meta name="keywords" content="flvso.com视频下载,优酷视频下载" />
<meta name="description" content="flvso.com提供高清flv视频下载,优酷(youku)视频下载,土豆(tudou)视频下载,youtube视频下载,乐视(letv)视频下载,酷六(ku6)视频下载,欢迎大家使用flvso下载视频。" />
<link href="/images/css.css" rel="stylesheet" type="text/css" />
<script>
function startgo(url){
document.mainform.wd.value = url;
document.getElementById("wd").focus();
}
</script>
</head>
<body><div class="logo"><a href="/"><img src="/images/logo.gif" alt="flvso" /></a></div><form name="mainform" id="mainform" action="" method="get" onSubmit="return check()">
<div class="so"><input name="wd" id="wd" type="text" class="ipu" value=""/> <input type="submit" value="开始GO!" class="but" /><p>当前解析地址:<a href=javascript:startgo("'.$_GET['wd'].'");>'.$_GET['wd'].'</a></p><p></p><p><!-- Baidu Button BEGIN -->
<div id="bdshare" class="bdshare_t bds_tools_32 get-codes-bdshare">
<a class="bds_qzone"></a>
<a class="bds_tsina"></a>
<a class="bds_tqq"></a>
<a class="bds_renren"></a>
<a class="bds_t163"></a>
<a class="bds_kaixin001"></a>
<a class="bds_ty"></a>
<a class="bds_douban"></a>
<a class="bds_taobao"></a>
<a class="bds_tieba"></a>
<a class="bds_s51"></a>
<span class="bds_more"></span>
<a class="shareCount"></a>
</div>
<script type="text/javascript" id="bdshare_js" data="type=tools&uid=631103" ></script>
<script type="text/javascript" id="bdshell_js"></script>
<script type="text/javascript">
document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script>
<!-- Baidu Button END --></p></div></form>';
echo "<div class='down'><h2>下载地址:<span>请右击-目标另存为 or 复制链接地址到新的页面打开</span></h2>$video</div>";
echo'<div class="blank"></div><div class="sup">支持网站:优酷网、土豆网、奇艺网、搜狐视频、酷6网、腾讯视频、PPTV、新浪播客、新浪宽频、56网、网易视频、激动网、乐视网、六间房、百度贴吧视频、天翼视讯、PPS、迅雷看看</div><div style="display:none;"><script src="http://s9.cnzz.com/stat.php?id=4937039&web_id=4937039" language="JavaScript"></script></div></body>
</html>';
exit();
function getsite($url){
$buf=parse_url($url);
if($buf["scheme"]=="http"){
$host=$buf["host"];
$page=$buf["path"];
if(trim($buf["query"])!=="") $page.="?".trim($buf["query"]);
$myHeader="GET ".$url." HTTP/1.1\r\n";
$myHeader.="Host:".$host."\r\n";
$myHeader.="Connection:close\r\n";
$myHeader.="Accept: text/xml,application/xml,application/xhtml+xml+swf,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
$myHeader.="Accept-Language:zh-cn,zh;q=0.5\r\n";
$myHeader.="Accept-Charset:gb2312,utf-8;q=0.7,*;q=0.7\r\n";
$myHeader.="User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:5.0.1) Gecko/20100101 Firefox/5.0.1 Web-Sniffer/1.0.20\r\n";
$myHeader.="Referer: http://".$host."/\r\n\r\n";
$server=$host;
$port=80;
$res="";
if(false!==($fp = @fsockopen($server,$port,$errno,$errstr,30))){
@fputs ($fp, $myHeader);
while (!@feof($fp)) $res.= @fgets($fp,1024);
@fclose ($fp);
}else{
return false;
}
if(strlen($res)==0) return false;
return $res;
}else{
$fileName=$url;
if(false!==@file_exists($fileName)){
if(false!==($buf=@implode("",file($fileName)))&&@strlen($buf)>0){
return $buf;
}else{
return false;
}
}else{
return false;
}
}
}
function getbody($s,$ss,$se,$sn){
$arr = explode($ss,$s);
@$t=$arr[1];
if(empty($t)) return '';
if(empty($se)){
return $t;
}else{
$arr=explode($se,$t);
if($sn==1){
return $arr[0];
}elseif($sn==2){
return $ss.$arr[0];
}elseif($sn==3){
return $arr[0].$se;
}else{
return $ss.$arr[0].$se;
}
}
}
function safeurl($s) {
$s = str_replace('%20','',$s);
$s = str_replace('%27','',$s);
$s = str_replace('%2527','',$s);
$s = str_replace('*','',$s);
$s = str_replace('"','"',$s);
$s = str_replace("'",'',$s);
$s = str_replace('"','',$s);
$s = str_replace(';','',$s);
$s = str_replace('<','<',$s);
$s = str_replace('>','>',$s);
$s = str_replace("{",'',$s);
$s = str_replace('}','',$s);
$s = str_replace('\\','',$s);
return trim($s);
}
?>