|
5精币
- <?php
- header("Content-Type: text/html;charset=utf-8");
- function MloocCurl($url,$method,$ifurl,$post_data){ //正确的
- $UserAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36';#设置ua //正确的
- $curl = curl_init(); //正确的
- curl_setopt($curl, CURLOPT_URL, $url); //正确的
- curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent); //正确的
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //正确的
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); //正确的
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //正确的
- if ($method == "post") { //正确的
- curl_setopt($curl, CURLOPT_REFERER, $ifurl); //正确的
- curl_setopt($curl, CURLOPT_POST, 1); //正确的
- curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); //正确的
- }
- $response = curl_exec($curl); //正确的
- curl_close($curl);
- return $response;
- }
- function getSubstr($str, $leftStr, $rightStr,$sindex){
- $sstr=$str;
- $left = strpos($sstr, $leftStr,$sindex);
- $right = strpos($sstr, $rightStr,$left);
- if($left < 0 or $right < $left) return '';
- // return substr($sstr, $left + strlen($leftStr), $right-$left-strlen($leftStr));
- $sstr = substr($sstr, $left + strlen($leftStr), $right-$left-strlen($leftStr));
- if(strlen($sstr) > 10)
- {
- return $sstr;
- }else{
- return getSubstr($str, $leftStr, $rightStr, $left + 10);
- }
- }
- if (!empty($_GET['url'])) {
- $url = @$_GET['url'];
- $p = @$_GET['p'];
- #第一步
- $ruleMatchDetailInList = "~ifr2"\sname="[\s\S]{2,}"\ssrc="\/(.*?)"\sframeborder=~";
- if (preg_match($ruleMatchDetailInList, MloocCurl($url,null,null,null),$link)){
- $ifurl = "https://lanzoux.com/".$link[1];
-
- #第二步
- $data=MloocCurl($ifurl,null,null,null);
- $sign = getSubstr($data,"sign':'","',",0);
- $post_data = array(
- "action" => "downprocess",
- "sign" => $sign,
- "p" => $p,
- );
- $obj = json_decode(MloocCurl("https://lanzoux.com/ajaxm.php","post",$ifurl,$post_data));#json解析
- if ($obj->zt == "1") {#判断链接是否正确
- $downUrl = $obj->dom."/file/".$obj->url;
- echo $downUrl;
- if (!empty($_GET['type'])) {
- $type = $_GET['type'];
- if ($type == "down") {
- header('Location:'.$downUrl);#直接下载
- }else{
- header('Location:'.$downUrl);#直接下载
- }
- }else{
- header('Location:'.$downUrl);#直接下载
- }
- }else{
- echo $obj->inf;
- }
- } else {
- echo "<br>原始地址可能不对,解析失败。<br>";
- };
- }else{
- /* $result_url = str_replace("index.php","","//".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?url=".$url); */
- echo "<br>未提供需要解析的地址!<br>";
- }
- echo "<br>蓝奏云直连下载<br>";
- ?>
复制代码
|
|