gofile一个国外的分享型网盘,有许多资源都是采用这个网盘分享的,与国内的那些赚钱的分享型网盘差不多,都是免费下载有限制,想要无限制下载就付费购买会员等等;gofile免费用户只能一个一个点击下载,无法批量下载很不方便,我们可以使用蓝叶分享的php读取gofile网盘分享下载文件地址数据代码,输入当前gofile分享页面的所有下载链接,然后复制到下载工具里进行批量下载;蓝叶分享的这个gofile下载链接获取php代码只是输出json数据,想要列出下载地址便于复制,可以自己写个foreach循环就可以了。
<?php header('Content-Type:text/json; charset=utf-8'); date_default_timezone_set('Asia/Shanghai'); $id = isset($_GET['id']) ? addslashes(trim($_GET['id'])) : 'uKSKQR'; $apiurl = array( 'token' => 'https://api.gofile.io/createAccount', 'file' => 'https://api.gofile.io/getContent', ); $tokenDat = json_decode(Curldata($apiurl['token']), 1); $token = ((isset($tokenDat) && $tokenDat['status']=='ok')?$tokenDat['data']['token']:0); $contentDat = json_decode(Curldata($apiurl['file'].'?contentId='.$id.'&token='.$token.'&websiteToken=12345'), 1); $contents = ((isset($contentDat) && $contentDat['status']=='ok')?$contentDat['data']['contents']:0); $newcontents = array(); foreach($contents as $val){ $newcontents[]=$val; } $newjson = json_encode($newcontents); echo $newjson; function Curldata($url){ $curl = curl_init(); $header = array( "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36 ", "Referer: ".$url ); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_TIMEOUT, 10); curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($curl, CURLOPT_ENCODING, ''); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); $response = curl_exec($curl); curl_close($curl); return $response; }
免责声明:
本页网址:点击复制分享给朋友吧!
本站分享的一切内容资源如若没有备注,均为蓝叶原创,如需转载请注明出处;如有侵权请与我们联系处理。敬请谅解!