We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
现在这个接口获取到的链接可以下载,但是在部分地区反诈,直接无法下载,我这边有个可用的php解析代码,可以修改一下,用在go语言解析,下面这个php接口,会解析到两个下载链接,第一个解析的链接和alist解析到一样,第二个则为可正常下载链接
下面是php部分代码
https://down.szczk.top/d/onedrive/onedrive/lanzou.php?sign=F47CN2wymr4YRrryKrqX-I2es3efmgQuEmqZRaJDcIQ=:0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Please make sure of the following things
Description of the feature / 需求描述
现在这个接口获取到的链接可以下载,但是在部分地区反诈,直接无法下载,我这边有个可用的php解析代码,可以修改一下,用在go语言解析,下面这个php接口,会解析到两个下载链接,第一个解析的链接和alist解析到一样,第二个则为可正常下载链接
Suggested solution / 实现思路
下面是php部分代码
false, "message" => "请输入需要解析的蓝奏云链接!"); exit(json_encode($result,480)); }elseif (strpos($url,'lanzou') == false) { $result = array("success" => false, "message" => "你输入的不是蓝奏云链接!"); exit(json_encode($result,480)); } //根据传入的蓝奏云链接 自适应获取链接 $urls = parse_url($url); //一个简单的链接处理 if(strstr($url, '.com/tp/')){ //判断是否包含/tp $url = 'https://'.$urls['host'].'/'.explode('.com/tp/',$url)[1]; }else{ $url = 'https://'.$urls['host'].'/'.explode('.com/',$url)[1]; } $softInfo = MloocCurlGet($url); if (strstr($softInfo, "文件取消分享了") != false) { $result = array("success" => false, "message" => "文件取消分享了"); exit(json_encode($result,480)); } //判断是否需要文件分享密码 if(strstr($softInfo, "function down_p(){") != false){ if(empty($pwd)){ $result = array("success" => false, "message" => "请输入文件分享密码!"); exit(json_encode($result,480)); } //正则获取sign preg_match_all("/var\s+skdklds\s*=\s*'([^']+)'/i", $softInfo, $segment); $post_data = array( "action" => 'downprocess', "sign" => $segment[1][0], "p" => $pwd ); $softDownlink = MloocCurlPost($post_data, "https://".$urls["host"]."/ajaxm.php", $url); $softName[1] = json_decode($softDownlink,true)['inf']; preg_match('~~', $softInfo, $softFilesize); //正则获取链接 preg_match('/(?/i', $softInfo, $link); //获取到的下载链接 $softDown = MloocCurlGet('https://'.$urls['host'].$link[1]); //正则获取sign //preg_match_all("/var\s+sasign\s*=\s*'([^']+)'/i", $softDown, $downKeyArr); preg_match_all("/'sign':'([^']+)'/i", $softDown, $downKeyArr); //post数据 $post_data = array( "action" => 'downprocess', "signs"=>'?ctdf', "websignkey"=>'Ypvp', "sign" => $downKeyArr[1][0], ); $softDownlink = MloocCurlPost($post_data, "https://".$urls["host"]."/ajaxm.php", $url); } $softDownlink = json_decode($softDownlink,true); $downUrl = $softDownlink['dom'] . '/file/' . $softDownlink['url']; //判断zt值是否为1 if ($softDownlink['zt'] == 1) { $infoArr = array('file_name'=>isset($softName[1]) ? $softName[1] : "",'file_size'=>isset($softFilesize[1]) ? $softFilesize[1] : ""); $result = array("success" => true, 'info' => $infoArr, "download" => $downUrl, "fileUrl" => restoreUrl($downUrl),'copyright'=>$info_copyright); if($type !== 'down'){ exit(json_encode($result,480)); }else{ header("Location:$downUrl"); } } else { $result = array("success" => false, "message" => "文件不存在或获取超时!"); exit(json_encode($result,480)); } //HTTP_Get封装方式 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); } $ip = rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255); curl_setopt($curl, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.$ip, 'CLIENT-IP:'.$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; } //HTTP_Post封装方式 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); } $ip = rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255); curl_setopt($curl, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.$ip, 'CLIENT-IP:'.$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 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; } ?>
Additional context / 附件
https://down.szczk.top/d/onedrive/onedrive/lanzou.php?sign=F47CN2wymr4YRrryKrqX-I2es3efmgQuEmqZRaJDcIQ=:0
The text was updated successfully, but these errors were encountered: