提到蓝奏云盘,作为站长对于此盘并不陌生,其以上传下载速度快、简单便捷的操作界面而被站长们所熟知并大量使用;作为站长,有时为了方便下载,我们可以使用php读取调用蓝奏云盘直连地址代码,从而直接调用视频或音乐在站内播放,那么如何使用php读取调用蓝奏云盘直连地址,蓝奏云获取直连解析api又是什么?
php读取调用蓝奏云盘直连地址代码,蓝奏云获取直连解析api代码如下,只需要复制到php文件中,放在自己主机上,通过浏览器访问即可获取蓝奏云盘直连地址。
使用方法:lanzou.php?id=分享网址后面的ID字符串
<?php /* * 解析调用蓝奏云盘代码 * author:蓝叶 * url:lanye.org */ error_reporting(0); header('Content-Type:text/html; charset=utf-8'); date_default_timezone_set('Asia/Shanghai'); $domain = trim($_SERVER['SERVER_NAME']); $domainList = "127.0.0.1,localhost,lanye.org,music.lanye.org"; $diymusic = 'https://lanye.org/static/daolian.mp3'; if(!preg_match('/('.$domain.')/i', $domainList)){ header('location:'.$diymusic); exit(); } $id = isset($_GET['id']) ? addslashes(trim($_GET['id'])) : ''; if(!$id){echo 'ID ERROR - LANYE.ORG';exit;} preg_match_all("~ifr2\"\sname=\"[\s\S]*?\"\ssrc=\"\/(.*?)\"~", Curl($id),$fnurl); preg_match('/var.*?aihidcms.*?\'(.*?)\';[\s\S]*?ciucjdsdc.*?\'(.*)\';[\s\S]*?ajaxdata.*?\'(.*?)\';[\s\S]*?\'sign\':\'(.*)\'.*?websign/i', Curl($fnurl[1][1], $cookie),$cots); $filedat = Curl_post($id,$cots); $jsondat = json_decode($filedat); $error = $jsondat->zt; if($error == 0){echo 'ID ERROR - LANYE.ORG';exit;} $fileurl = $jsondat->dom.'/file/'.$jsondat->url; header('Location:'.$fileurl);exit(); function Curl($id){ $url = 'https://pan.lanzout.com/'.$id; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36'); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_REFERER, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($curl); curl_close($curl); return $response; } function Curl_post($id, $data){ $url = 'https://pan.lanzout.com/ajaxm.php'; $refe = 'https://pan.lanzout.com/'.$id; $post_data = array('action' => 'downprocess','signs' => $data[3],'sign'=>$data[4],'websign'=>$data[2],'websignkey'=>$data[1],'ves'=>1); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36'); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_REFERER, $refe); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); $response = curl_exec($curl); curl_close($curl); return $response; }
免责声明:
本页网址:点击复制分享给朋友吧!
本站分享的一切内容资源如若没有备注,均为蓝叶原创,如需转载请注明出处;如有侵权请与我们联系处理。敬请谅解!