|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册帐号
×
提取城通网盘直链跳过广告下载
说明:
1.解析城通网盘和皮皮网盘直链下载
2.解决城通网盘和皮皮网盘烦人的各种广告
3.有能力的可以自己适当进行更改
4.转载或使用请保留版权!!!
用法:
url:网盘外链地址
注:如果网盘外链有密码,需在链接结尾加上?key=密码
演示链接:https://api.mlooc.cn/ct/?url=htt ... s/4924633-297892236
得出的是直链地址,然后复制到下载即可实现跳过广告。
PHP代码如下
- <?php
- /**
- * @package ctdisk
- * @author Mlooc
- * @version 1.0.0
- * @link https://sec.bducds.com
- */
- // 指定允许其他域名访问
- 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>';
- }
- ?>
复制代码
直接获取蓝奏云直链下载
自己创建一个PHP文件把下面代码复制进去即可,有html基础的也可以美化页面看自己咯
PHP获取蓝奏云直链的源码案例
可以用来做api调用到网站做下载
演示地址:https://api.mlooc.cn/lanzou/
用法:
直接下载:https://api.mlooc.cn/lanzou/?url ... a18af&type=down
输出链接:https://api.mlooc.cn/lanzou/?url=https://www.lanzous.com/i1a18af
代码:
- <?php
- /**
- * @package Lanzou
- * @author Mlooc
- * @version 1.0.0
- * @link https://sec.bducds.com
- */
- function MloocCurl($url,$method,$ifurl,$post_data){
- $UserAgent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 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;
- }
- if (!empty($_GET['url'])) {
- $url = $_GET['url'];
- #第一步
- $ruleMatchDetailInList = "~ifr2"\sname="[\s\S]*?"\ssrc="\/(.*?)"~";
- preg_match($ruleMatchDetailInList, MloocCurl($url,null,null,null),$link);
- $ifurl = "https://www.lanzous.com/".$link[1];
- #第二步
- $ruleMatchDetailInList = "~=\s'(.*?)';[\S\s]*?=\s'(.*?)'[\S\s]*?=\s'(.*?)'[\S\s]*?=\s'(.*?)'~";
- preg_match($ruleMatchDetailInList, MloocCurl($ifurl,null,null,null),$segment);
- #第三步
- #post提交的数据
- $post_data = array(
- "action" => $segment[1],
- "file_id" => $segment[2],
- "t" => $segment[3],
- "k" => $segment[4]
- );
- $obj = json_decode(MloocCurl("https://www.lanzous.com/ajaxm.php","post",$ifurl,$post_data));#json解析
- if ($obj->dom == "") {#判断链接是否正确
- echo "链接有误!";
- }else{
- $downUrl = $obj->dom."/file/".$obj->url;
- if (!empty($_GET['type'])) {
- $type = $_GET['type'];
- if ($type == "down") {
- header('Location:'.$downUrl);#直接下载
- }else{
- echo $obj->dom."/file/".$obj->url;#输出直链
- }
- }else{
- echo $obj->dom."/file/".$obj->url;#输出直链
- }
- }
- }else{
- $result_url = str_replace("index.php","","//".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?url=https://www.lanzous.com/i19zisb");
- echo "示列:";
- echo "<br/>";
- echo "直接下载:"."<a href='".$result_url."&type=down' target='_blank'>".$result_url."&type=down</a>";
- echo "<br/>";
- echo "输出直链:"."<a href='".$result_url."' target='_blank'>".$result_url."</a>";
- }
- ?>
复制代码
|
|