<?php /** * [url=home.php?mod=space&uid=1507498]@Package[/url] LanzouApi * [url=home.php?mod=space&uid=686208]@AuThor[/url] YunCheng */ header('Access-Control-Allow-Origin:*'); header('Content-Type:application/json; charset=utf-8'); //默认UA $UserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36'; $url = isset($_GET['url']) ? $_GET['url'] : ""; $pwd = isset($_GET['pwd']) ? $_GET['pwd'] : ""; $type = isset($_GET['type']) ? $_GET['type'] : ""; if (empty($url)) { die( json_encode( array( 'code' => 400, 'msg' => '请输入URL' ) , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); } //一个简单的链接处理 $url='https://www.lanzouf.com/'.explode('.com/',$url)['1']; $softInfo = MloocCurlGet($url); if (strstr($softInfo, "文件取消分享了") != false) { die( json_encode( array( 'code' => 400, 'msg' => '文件取消分享了' ) , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); } preg_match('~style="font-size: 30px;text-align: center;padding: 56px 0px 20px 0px;">(.*?)</div>~', $softInfo, $softName); if(!isset($softName[1])){ preg_match('~<div class="n_box_fn".*?>(.*?)</div>~', $softInfo, $softName); } preg_match('~<div class="n_filesize".*?>大小:(.*?)</div>~', $softInfo, $softFilesize); if(!isset($softName[1])){ preg_match('~var filename = '(.*?)';~', $softInfo, $softName); } if (strstr($softInfo, "手机Safari可在线安装") != false) { if(strstr($softInfo, "n_file_infos") != false){ $ipaInfo = MloocCurlGet($url, 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1'); preg_match('~href="(.*?)" target="_blank" class="appa"~', $ipaInfo, $ipaDownUrl); }else{ preg_match('~com/(w+)~', $url, $lanzouId); if (!isset($lanzouId[1])) { die( json_encode( array( 'code' => 400, 'msg' => '解析失败,获取不到文件ID' ) , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); } $lanzouId = $lanzouId[1]; $ipaInfo = MloocCurlGet("https://www.lanzouf.com/tp/" . $lanzouId, 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1'); preg_match('~href="(.*?)" id="plist"~', $ipaInfo, $ipaDownUrl); } $ipaDownUrl = isset($ipaDownUrl[1]) ? $ipaDownUrl[1] : ""; if ($type != "down") { die( json_encode( array( 'code' => 200, 'msg' => '解析成功', 'name' => isset($softName[1]) ? $softName[1] : "", 'downUrl' => $ipaDownUrl ) , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); } else { header("Location:$ipaDownUrl"); die; } } if(strstr($softInfo, "function down_p(){") != false){ if(empty($pwd)){ die( json_encode( array( 'code' => 400, 'msg' => '请输入分享密码' ) , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); } preg_match("~action=(.*?)&sign=(.*?)&p='+(.*?),~", $softInfo, $segment); $post_data = array( "action" => $segment[1], "sign" => $segment[2], "p" => $pwd ); $softInfo = MloocCurlPost($post_data, "https://www.lanzouf.com/ajaxm.php", $url); $softName[1] = json_decode($softInfo,JSON_UNESCAPED_UNICODE)['inf']; }else{ preg_match("~n<iframe.*?name="[sS]*?"ssrc="/(.*?)"~", $softInfo, $link); $ifurl = "https://www.lanzouf.com/" . $link[1]; $softInfo = MloocCurlGet($ifurl); preg_match_all("~sign = '(.*?)'~", $softInfo, $segment); $post_data = array( "action" => 'downprocess', "signs"=>"?ctdf", "sign" => $segment[1][0], ); $softInfo = MloocCurlPost($post_data, "https://www.lanzouf.com/ajaxm.php", $ifurl); } $softInfo = json_decode($softInfo, true); if ($softInfo['zt'] != 1) { die( json_encode( array( 'code' => 400, 'msg' => $softInfo['inf'] ) , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); } $downUrl1 = $softInfo['dom'] . '/file/' . $softInfo['url']; //解析最终直链地址 $downUrl2 = MloocCurlHead($downUrl1,"http://developer.store.pujirc.com",$UserAgent,"down_ip=1; expires=Sat, 16-Nov-2019 11:42:54 GMT; path=/; domain=.baidupan.com"); if($downUrl2 == ""){ $downUrl = $downUrl1; }else{ $downUrl = $downUrl2; } if ($type != "down") { die( json_encode( array( 'code' => 200, 'msg' => '解析成功', 'name' => isset($softName[1]) ? $softName[1] : "", 'filesize' => isset($softFilesize[1]) ? $softFilesize[1] : "", 'downUrl' => $downUrl ) , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); } else { header("Location:$downUrl"); die; } function MloocCurlGetDownUrl($url) { $header = get_headers($url,1); if(isset($header['Location'])){ return $header['Location']; } return ""; } function MloocCurlGet($url = '', $UserAgent = '') { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); if ($UserAgent != "") { curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent); } curl_setopt($curl, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.Rand_IP(), 'CLIENT-IP:'.Rand_IP())); #关闭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; } function MloocCurlPost($post_data = '', $url = '', $ifurl = '', $UserAgent = '') { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent); if ($ifurl != '') { curl_setopt($curl, CURLOPT_REFERER, $ifurl); } curl_setopt($curl, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.Rand_IP(), 'CLIENT-IP:'.Rand_IP())); #关闭SSL curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); #返回数据不直接显示 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); $response = curl_exec($curl); curl_close($curl); return $response; } //直链解析函数 function MloocCurlHead($url,$guise,$UserAgent,$cookie){ $headers = array( 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Encoding: gzip, deflate', 'Accept-Language: zh-CN,zh;q=0.9', 'Cache-Control: no-cache', 'Connection: keep-alive', 'Pragma: no-cache', 'Upgrade-Insecure-Requests: 1', 'User-Agent: '.$UserAgent ); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER,$headers); curl_setopt($curl, CURLOPT_REFERER, $guise); curl_setopt($curl, CURLOPT_COOKIE , $cookie); curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent); curl_setopt($curl, CURLOPT_NOBODY, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLINFO_HEADER_OUT, TRUE); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $data = curl_exec($curl); $url=curl_getinfo($curl); curl_close($curl); return $url["redirect_url"]; } function Rand_IP(){ $ip2id = round(rand(600000, 2550000) / 10000); $ip3id = round(rand(600000, 2550000) / 10000); $ip4id = round(rand(600000, 2550000) / 10000); $arr_1 = array("218","218","66","66","218","218","60","60","202","204","66","66","66","59","61","60","222","221","66","59","60","60","66","218","218","62","63","64","66","66","122","211"); $randarr= mt_rand(0,count($arr_1)-1); $ip1id = $arr_1[$randarr]; return $ip1id.".".$ip2id.".".$ip3id.".".$ip4id; } ?>
php教程
最新蓝奏云直链解析API接口源码
- API源码
- API接口
- 蓝奏云直链
-
PHP智云V1.3全能API接口网站源码
智云全能API接口PHP源码V1.3版本接口数据由智云平台开发及整理源码直接上传即可访问,无需数据库,不支持上传二级目录访问!源码上传后请访问:你的域名/inde.html(可以将inde.html重新修改其他名称访问)...
-
2020年最新HTML+API版防红网站模板
2020年最新HTML+API版防红网站模板,HTML+JS+API框架,打开即可使用,不需要任何环境。支持多种防红方式,多种短域名后缀。
-
HTML+API美腿zipa图片瀑布流网站模板
HTML+API美腿zipa图片瀑布流网站模板,图片采集与自葫芦侠,流量不走本地,虚拟空间都能部署,适合引流请在下载后24小时内删除,否则一切法律后果请自行承担...
-
支付宝企业账户转账个人账户php接口代码
前言支付宝企业账户转账个人账户php接口代码,该接口主要用于平台对用户奖励的发放,场景也很简单就是我在你平台上有余额,我提现,平台给钱。只不过项目中是用的官方的SDK调用的,仔细看了下那个SDK目录,把很多无用的接口(目前自己用不上)也包含在里面,作为强...
-
QQ互联API申请教程(图文)
1、登录QQ互联在浏览器上打开网址:http://connect.qq.com/。点击右上角【登录】按钮,使用QQ账号登录。2、管理中心点击【管理中心】进入应用管理页面。(图中位置1)完善开发者资料,如果手册登录需要完善开发者资料。点击【创建应用】,开始创建应用。(图中位...
-
苹果CMS开放API相关服务接口
开放式API数据接口-声明本接口仅供学习研究使用,请勿用于生产环境和非法渠道;不能保证稳定性和正确性;请牢记苹果cms官方域名: www.maccms.com(暂时关闭) www.maccms.net; 网路出现多个盗版苹果v10的程序,改头换面加入后门,请误下载使用没有诚信的盗版程序...
-
最新蓝奏云直链解析API接口源码
<?php/** * [url=home.php?mod=space&uid=1507498]@Package[/url] LanzouApi * [url=home.php?mod=space&uid=686208]@AuThor[/url] YunCheng */header('Access-Control-Allow-Origin:*');header('Content-Type:application/json; chars...
-
蓝奏云批量直链下载工具
蓝奏云批量直链下载工具,批量直链解析下载,一行一个。蓝奏云直链下载截图使用说明1、输入蓝奏云外链(一行一条外链)2、右键选择“解析外链”3、解析完成后,右键选择“导出表格”或“下载直链”4、蓝奏...
-
最新php蓝奏云直链api接口源代码
最新php蓝奏云直链api接口源代码<?php$url=base64_decode('aHR0cHM6Ly9hcGkucGluZ3Bpbmc2LmNvbS90b29scy9sYW56b3Uv').'?url='.$_GET['url'].'&pass='.$_GET['url'];$ch = curl_init();curl_seto...
-
file_get_contents加载读取TXT文本文件内容方法
以下是使用file_get_contents()函数加载读取TXT文本文件内容的示例代码:<?php// 文件路径$filePath = 'w...
-
php判断数组中是否包含某个字符方法大全
in_array()函数$array = ['apple', 'banana', 'orange'];$character = 'banan...
-
php分隔字符方法大全
explode() 函数explode() 函数用于通过一个字符来分割字符串。$str = "one,two,three,four";$arr = explode...
-
php删除数组的第一个元素方法
array_shift()函数array_shift()函数用于删除数组中的第一个元素并返回它。$array = [1, 2, 3, 4, 5];array...
-
php去除字符串的第一个或最后一个字符
php去除字符串的第一个或最后一个字符,可以使用用substr()函数方法去除。substr()函数方法substr() 函数可以...