Home > php教程 > php手册 > 比较简单的百度网盘文件直链PHP代码

比较简单的百度网盘文件直链PHP代码

WBOY
Release: 2016-06-13 11:54:31
Original
1320 people have browsed it

百度网盘速度快,稳定性好,你值得拥有,如果以后支持直连以后就可以直接使用百度的网盘了。

这里提供的是临时解决方案,不保证以后可以使用

将下面的代码保存为downbd.php

复制代码 代码如下:


$canshu=$_SERVER["QUERY_STRING"];
if($canshu=="")
{
die("文件不存在");
}
else
{
$wangzhi="http://pan.baidu.com/share/link?".$canshu;
$file=file_get_contents($wangzhi);
$pattern='/a>/i';
preg_match_all($pattern,$file,$result);
$tempurl=implode("",$result[1]);
$fileurlt=str_replace("\"","",$tempurl);
$fileurl=str_replace("&","&",$fileurlt);
header("location:$fileurl");
}
?>



调用方法:

http://***/downbd.php?shareid=00000&uk=00000
主要是?shareid=00000&uk=00000这样的格式
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template