Home > Backend Development > PHP Tutorial > 比较简单的百度网盘文件直链PHP代码_php技巧

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

WBOY
Release: 2016-05-17 09:06:22
Original
1671 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这样的格式
Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template