首页
友链
壁纸
留言
今日热榜
更多
关于
时光
推荐
精品流量卡
Search
1
都二十多年了,你的梦为什么还没碎!
57,091 阅读
2
2022年5个好用的 BT/ 磁力链接下载工具推荐 |Windows 、安卓系统
37,419 阅读
3
nps内网穿透实现外网访问树莓派
32,429 阅读
4
实践利用宝塔建emlog个人博客-超详细【原创】
26,135 阅读
5
Typecho-Joe-Theme主题帮助文档
24,649 阅读
闲杂乱码
Python
网站源码
微信小程序
娱乐分享
Is相册
软件工具
登录
Search
标签搜索
PHP
HTML
API
Javascript
源码
JS
Vue
Github
CloudFlare
接口
函数
SQL
ASP.NET
MVC
EF
T4模板
后台管理
CDN
微信小程序
MAC
韩小韩
累计撰写
262
篇文章
累计收到
1,308
条评论
首页
栏目
闲杂乱码
Python
网站源码
微信小程序
娱乐分享
Is相册
软件工具
页面
友链
壁纸
留言
今日热榜
关于
时光
推荐
精品流量卡
搜索到
1
篇与
云盘解析
的结果
2022-11-11
蓝奏云盘解析API接口 开源
{message type="info" content="根据 服务器接口数量、带宽、可维护性等多种因素,韩小韩API接口站决定下架蓝奏云解析API接口,不过由于使用量过大,突然下架是对用户的不负责,故将解析接口开源,供大家直接使用或二次修改使用。"/}蓝奏云解析API{abtn icon="fa-link" color="#00b3ff" href="https://api.vvhan.com/lanzou.html" radius="" content="蓝奏云解析 - 韩小韩API"/} 蓝奏云解析API源码<?php header("Access-Control-Allow-Origin:*"); header('Content-type:application/json; charset=utf-8'); // API调用统计 // include './sum/db/apicount.php'; // hansCount("lanzou"); // 取文件地址 (isset($_GET['url']) && $_GET['url']) ? ($uurl = $_GET['url']) : exit(json_encode(["success" => false, "message" => "文件不存在"], JSON_UNESCAPED_UNICODE)); $_url = str_replace(['http://', 'https://'], '', $uurl); // 取文件Key $_keyArr = explode('/', $_url); $_key = end($_keyArr); // 统计基础地址 $BASEURL = 'https://_.lanzouq.com/'; // 统一接口 $_res = getData($BASEURL . $_key); // 取参数 preg_match_all('/user-name">(.*?)<\/span>/i', $_res, $_fileAutherArr); if ($_fileAutherArr[1]) { preg_match_all('/filenajax">(.*?)<\/div>/i', $_res, $_fileNameArr); preg_match_all('/n_file_infos">(.*?)<\/span>/i', $_res, $_fileInfoArr); preg_match_all('/大小:(.*?)<\/div>/i', $_res, $_fileSizeArr); if (count($_fileInfoArr[1]) > 1) { $__time = $_fileInfoArr[1][0]; $__type = $_fileInfoArr[1][1]; } else { $__time = '-'; $__type = $_fileInfoArr[1][0]; } $infoArr = [ 'name' => $_fileNameArr[1][0] ?? '-', 'auther' => $_fileAutherArr[1][0] ?? '-', 'time' => $__time ?? '-', 'size' => $_fileSizeArr[1][0] ?? '-', 'type' => $__type ?? '-' ]; } else { preg_match_all('/<title>(.*?) - 蓝奏云/i', $_res, $fileNameArr); preg_match_all('/span>(.*?)<br/i', $_res, $infoArr); preg_match_all('/font>(.*?)<\/font/i', $_res, $autherArr); $infoArr = [ 'name' => $fileNameArr[1][0] ?? '-', 'auther' => $autherArr[1][0] ?? '-', 'time' => $infoArr[1][1] ?? '-', 'size' => $infoArr[1][0] ?? '-', 'type' => $infoArr[1][3] ?? '-' ]; } // 取二次数据 preg_match_all('/src="(.*?)" frameborder/i', $_res, $ifarmArr); $ifarmUrl = strlen($ifarmArr[1][0]) > 36 ? $ifarmArr[1][0] : $ifarmArr[1][1]; $_sres = getData($BASEURL . $ifarmUrl); // 取键值对 preg_match_all("/'(.*?)'/i", $_sres, $downKeyArr); preg_match_all("/ajaxdata = '(.*?)';/i", $_sres, $ajaxdata); preg_match_all("/websignkey = '(.*?)';/i", $_sres, $webKey); preg_match_all("/wsk_sign = '(.*?)';/i", $_sres, $webKeys); // 取downKey $downKey = ''; foreach ($downKeyArr[1] as $v) { strlen($v) > 36 && ($downKey = $v); } // 取直链 if ($downKey) { $datas = curlPosr($downKey, $ajaxdata[1][0], $webKey[1][0] ?? $webKeys[1][0], $BASEURL); $json = json_decode($datas, true); $result = array("success" => true, 'info' => $infoArr, "download" => $json['dom'] . "/file/" . $json['url'], "fileUrl" => restoreUrl($json['dom'] . "/file/" . $json['url'])); exit(json_encode($result, JSON_UNESCAPED_UNICODE)); } else { $result = array("success" => false, "message" => "文件不存在"); exit(json_encode($result, JSON_UNESCAPED_UNICODE)); } // POST请求封装 function curlPosr($urls, $ajaxData, $webKey, $uname) { $ip = rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255); $header[] = "CLIENT-IP:" . $ip; $header[] = "X-FORWARDED-FOR:" . $ip; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "{$uname}ajaxm.php"); curl_setopt($ch, CURLOPT_REFERER, $uname . $urls); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //发送 http 报头 curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // POST数据 $data = array( "signs" => $ajaxData, "action" => "downprocess", "sign" => $urls, "websign" => '', "ves" => "1", "websignkey" => $webKey ); curl_setopt($ch, CURLOPT_POST, 1); // 把post的变量加上 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $output = curl_exec($ch); curl_close($ch); return $output; } // GET请求封装 function getData($url) { $ip = rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255); $header[] = "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"; $header[] = "accept-encoding: gzip, deflate, br"; $header[] = "accept-language: zh-CN,zh;q=0.9"; $header[] = "cache-control: max-age=0"; $header[] = "sec-ch-ua: \"Google Chrome\";v=\"95\", \"Chromium\";v=\"95\", \";Not A Brand\";v=\"99\""; $header[] = "sec-ch-ua-mobile: ?0"; $header[] = "sec-ch-ua-platform: \"Windows\""; $header[] = "sec-fetch-dest: document"; $header[] = "CLIENT-IP:" . $ip; $header[] = "X-FORWARDED-FOR:" . $ip; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //设置传输的 url // curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //发送 http 报头 curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36"); //设置UA curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); // 解码压缩文件 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // 对认证证书来源的检查 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // 从证书中检查SSL加密算法是否存在 curl_setopt($ch, CURLOPT_TIMEOUT, 5); // 设置超时限制防止死循环 $output = curl_exec($ch); curl_close($ch); return $output; } // 连接转换封装 function restoreUrl($shortUrl) { $ip = rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255); $header[] = "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"; $header[] = "accept-encoding: gzip, deflate, br"; $header[] = "accept-language: zh-CN,zh;q=0.9"; $header[] = "cache-control: max-age=0"; $header[] = "sec-ch-ua: \"Google Chrome\";v=\"95\", \"Chromium\";v=\"95\", \";Not A Brand\";v=\"99\""; $header[] = "sec-ch-ua-mobile: ?0"; $header[] = "sec-ch-ua-platform: \"Windows\""; $header[] = "sec-fetch-dest: document"; $header[] = "CLIENT-IP:" . $ip; $header[] = "X-FORWARDED-FOR:" . $ip; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $shortUrl); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36"); //设置UA curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_exec($ch); $info = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); curl_close($ch); return $info; }{callout color="#f0ad4e"}蓝奏云解析 - 到此结束。{/callout}
2022年11月11日
1,886 阅读
5 评论
7 点赞