admin

提取城通网盘直链下载 解析源码 php脚本
说明1.解析城通网盘和皮皮网盘直链下载2.解决城通网盘和皮皮网盘烦人的各种广告3.有能力的可以自己适当进行更改4....
扫描右侧二维码阅读全文
29
2018/09

提取城通网盘直链下载 解析源码 php脚本

说明
1.解析城通网盘和皮皮网盘直链下载
2.解决城通网盘和皮皮网盘烦人的各种广告
3.有能力的可以自己适当进行更改
4.转载或使用请保留版权!!!

用法
url:网盘外链地址
注:如果网盘外链有密码,需在链接结尾加上 ?key=密码

演示
https://xxxx.xxx/index.php?url=https://u17877708.ctfile.com/fs/17877708-297837876

<?php
/**
 * @package ctdisk
 * @author Mlooc
 * @version 1.0.0
 * @link https://mlooc.cn
 */
// 指定允许其他域名访问  
header('Access-Control-Allow-Origin:*');
    function object_array($array) {  
        if(is_object($array)) {  
            $array = (array)$array;  
        } if(is_array($array)) {  
            foreach($array as $key=>$value) {  
                $array[$key] = object_array($value);  
            }  
        }  
        return $array;  
    }

    function MloocCurl($url){
        $UserAgent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36';#设置UserAgent
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent);
        #关闭SSL
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
        #返回数据不直接显示
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        $response = curl_exec($curl);
        curl_close($curl);
        return $response;
    }
    if (!empty($_GET['url'])) {
        $url = $_GET['url'];

        $urlInfo = MloocCurl($url);

        $ruleMatchDetailInList = "~var userid = '(.*?)'~";#正则表达式
        preg_match($ruleMatchDetailInList,$urlInfo,$userid);

        $ruleMatchDetailInList = "~onclick=\"free_down\('(.*?)', 0, '(.*?)', 0, 0\)\" id=\"free_down_link\">~";#正则表达式
        preg_match($ruleMatchDetailInList,$urlInfo,$downInfo);
        $userid=$userid[1];
        $file_chk=$downInfo[2];
        $fid=$downInfo[1];

        $url="https://mlooc.ctfile.com/get_file_url.php?uid=".$userid."&fid=".$fid."&file_chk=".$file_chk;
        $downInfo=MloocCurl($url);
        // $downUrl = $result["main"]["descr_downurl"];
        $downInfo=json_decode($downInfo);
        $downInfo=object_array($downInfo);
        print_r($downInfo["downurl"]);
    }else{
        $result_url = str_replace("index.php","","//".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?url=https://u17877708.ctfile.com/fs/17877708-297837876");
        echo "演示:";
        echo "<br/>";
        echo "<br/>";
        echo '<a href="'.$result_url.'" target="_blank">'.$result_url.'</a>';
    }
?>

项目地址:https://github.com/MHanL/ctDisk

原文来源:18岁

Last modification:September 29th, 2018 at 02:03 pm
如果觉得我的文章对你有用,请随意赞赏

Comment here is closed