forked from yuantuo666/baiduwp-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request yuantuo666#2 from yuantuo666/master
拉取 yuantuo666/baiduwp-php
- Loading branch information
Showing
9 changed files
with
1,903 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,137 @@ | ||
# baiduwp-php | ||
# Baiduwp-PHP | ||
PanDownload 网页复刻版,PHP 语言版<br/> | ||
本项目是依据 [baiduwp](https://github.com/TkzcM/baiduwp "baiduwp") 的 JavaScript 版本改写而来,仅供大家学习参考<br/> | ||
希望在使用时能够保留导航栏的 Made by Yuan_Tuo 和 Optimized by LC,感谢! | ||
- 原作者 [Yuan_Tuo](https://github.com/yuantuo666 "Yuantuo") | ||
- 由 [LC](https://github.com/lc6464 "LC") 优化 | ||
本项目是依据 [baiduwp](https://github.com/TkzcM/baiduwp "baiduwp")(JavaScript 语言版)改写而来,仅供大家学习参考<br/> | ||
希望在使用时能够保留导航栏的 Made by Yuan_Tuo ,感谢! | ||
|
||
## Demo | ||
[已加密,暂不开放!](https://imwcr.cn/api/bdwp/) | ||
![speed.gif](https://i.loli.net/2020/10/01/2mEqkClnPev8ORd.gif) | ||
|
||
# http://www.dupan.cc/ (站长QQ33703259) 所发布的源码已被篡改,添加了后台并加密,添加的bduss会被上传网站后台,请勿下载使用 | ||
首先在这里道个歉,这个项目收费确实有点不妥。<br /> | ||
现在已经公布了所有源码,可以通过github的commits查看以前的源码,从未添加过后台,也没有加密。<br /> | ||
dupan.cc所提供的源码已经被dupan.cc站长恶意修改并加密。使用篡改的源码,在后台添加的bduss会被上传dupan.cc服务器,请勿下载使用!!!! | ||
|
||
## Donate | ||
[捐赠作者](https://imwcr.cn/?donate)<br /> | ||
|
||
## Blacklists | ||
- http://www.pojiewo.com/baidujx 1.4.2版本 注:此网站 **盗用** 其他网站的接口获取下载地址 | ||
- https://pan.biubixin.com/ 1.4.2版本 | ||
- http://xm08.cn/ 1.3.3版本 | ||
- http://47.98.113.215:1234/ 1.4.3版本 | ||
- https://www.bdwp.cf/ 1.0版本 | ||
- http://39.106.129.224:8080/ 1.0版本 | ||
- http://59.110.124.211:9090/ 1.0版本 | ||
- https://panweb.tk/ 1.0版本 | ||
- http://pan.hongshiite.top/ 1.0版本 | ||
|
||
## 安装注意事项 | ||
以上网站使用本项目源码,未与作者联系而删除作者信息。 | ||
|
||
## Tips | ||
- 使用了 `SESSION`,注意 **PHP 访问系统文件(夹)权限**问题 | ||
- 仅支持 **PHP 7 和 7+**! | ||
- 一般情况下网页版不会出现问题,第一次使用就失败一般是**设置的问题**。 | ||
- 如果使用一段时间后失效,一般是**账号问题**或**服务器IP被baidu封了**;如果是方法失效,这个项目将关闭。 | ||
- 使用 `1.3.6` 版本及以前的站长,请及时更新到最新版本,老版本存在安全问题(在获取链接页面没有验证密码),可能导致SVIP账号被盗用。[漏洞利用演示](https://i.loli.net/2020/08/29/hdjEKGzTZBu6yQI.gif) | ||
- 处理下载限速方法 | ||
- 尝试重新分享文件,部分文件可能出现奇怪的问题 | ||
- 耐心等待baidu解封账号 | ||
- 更换后台SVIP账号 | ||
- 更换服务器IP | ||
|
||
# Setting | ||
请在 `config.php` 中找到以下内容: | ||
``` | ||
define('BDUSS', '①'); | ||
define('STOKEN', '②'); | ||
define('SVIP_BDUSS', '③'); | ||
define('IsCheckPassword', ④); | ||
define('Password', '⑤'); | ||
## Setting | ||
请在 `config.php` 中找: | ||
define('APP_ID', '⑥'); | ||
define('DEBUG', ⑦); | ||
define('USING_DB', ⑧); | ||
define('DbConfig', array( | ||
"servername" => "⑨", | ||
"username" => "⑩", | ||
"password" => "⑪", | ||
"dbname" => "⑫", | ||
"dbtable" => "⑬" | ||
)); | ||
``` | ||
- 【必填】请在①②填入`你自己的百度账号信息`*(SVIP也可)*,用于获取下载列表,获取 cookie 方法见 [PD官网](https://pandownload.com/faq/cookie.html) | ||
- 【必填】在③中必须填入`SVIP的BDUSS`,用于获取下载链接,获取cookie方法同上。 | ||
- 请在④中选择是否需要密码(`TRUE`或者`FALSE`) | ||
- 若开启了密码,请在⑤中设置是首页密码 | ||
- 在⑥中是获取文件的Dlink时使用的app_id | ||
- 在⑦中是是否开启DEBUG调试模式 | ||
- 在⑧中是是否使用数据库,限制每日下载ip | ||
- 在⑨-⑬是数据库设置 | ||
|
||
- 详细信息可见 `config.php` 的注释 | ||
--- | ||
### 演示案例 | ||
例如,你的BDUSS是 `123` ,STOKEN是 `456` ,SVIP的BDUSS是 `789` ,`开启` 密码并且设置为 `666` ,启用数据库。(数据库相关信息:服务器地址`localhost`、账号`root`、密码`root`、数据库名`bdwp`)<br /> | ||
那么应该将 `config.php` 中设置成以下的代码: | ||
``` | ||
define('BDUSS', '123'); | ||
define('STOKEN', '456'); | ||
define('SVIP_BDUSS', '789'); | ||
define('IsCheckPassword', true); | ||
define('Password', '请在这里填写密码啦!ヾ(≧▽≦*)o'); | ||
define('Password', '666'); | ||
define('APP_ID', '25565'); | ||
define('DEBUG', false); | ||
define('USING_DB', true); | ||
define('DbConfig', array( | ||
"servername" => "localhost", | ||
"username" => "root", | ||
"password" => "root", | ||
"dbname" => "bdwp", | ||
"dbtable" => "bdwp" | ||
)); | ||
``` | ||
- 前两项填入你自己的 SVIP 信息就行,获取 cookie 方法见视频 [BV1Yh411d7Gd](https://www.bilibili.com/video/BV1Yh411d7Gd) | ||
- 其中123换成SVIP的BDUSS,456换成SVIP的STOKEN | ||
- 第三项是是否需要密码的选项 | ||
- 第四项是首页需要输入的密码,但是如果第三项为 `false` 则无效 | ||
- 详细信息可见 `config.php` 的注释 | ||
--- | ||
### 数据库设置 | ||
请在`MySQL`中导入`bdwp.sql`文件。 | ||
|
||
## Thanks | ||
- [baiduwp JavaScript 版](https://github.com/TkzcM/baiduwp "GitHub 项目") | ||
- [PanDownload 网站](https://pandownload.com/ "PanDownload 网站") | ||
- [KinhDown 客户端](https://t.me/kinhdown/ "KinhDown 客户端") | ||
- [PNL 下载方式](https://www.lanzous.com/u/pnl "PNL 下载方式") | ||
## Demo | ||
[暂不开放](http://imwcr.cn/api/bdwp/)<br /> | ||
因站长学习紧张加上精力有限,演示站没有时间维护,故暂时关闭。 | ||
|
||
## New Changes | ||
- 当前版本:`1.3.5` | ||
- 更新日期:2020-8-17 | ||
- 以下修改由 [LC](https://github.com/lc6464 "LC") 完成 | ||
- 优化后端逻辑和效率 | ||
- 优化代码 | ||
- 优化错误时提示 | ||
- 修复浏览器中点击下载链接,传递 Referer 导致概率性出错的问题 | ||
- 当前版本:`1.4.5` | ||
- 更新日期:2021-01-25 | ||
- 修改内容 | ||
- 开源赞助版源码 | ||
|
||
# About | ||
#### baiduwp JavaScript版 | ||
最开始Pandownload网页版复活版是由[TkzcM](https://github.com/TkzcM)大佬制作的,随后发布在[吾爱破解](https://www.52pojie.cn/thread-1238874-1-1.html)上。<br/> | ||
B站UP主影视后期系统教学(uid250610800)分享了这个网站,分享的视频登上了热门,导致PanDL.Live大量用户涌入。随后在8.10这个网站就关闭了。<br/> | ||
但这位作者在github上开源了这份代码,于是我就下载下来研究,发现有不稳定的情况(不知道是不是我设置有问题),于是我就尝试把代码转写成PHP语言,发现效果好很多。 | ||
|
||
## 安装注意事项 | ||
- 使用了 `SESSION`,注意 **PHP 访问系统文件(夹)权限**问题 | ||
- 请使用PHP7.0+版本,过老版本可能出现未知错误 | ||
#### B站教程 | ||
随后我在B站发布了一个视频,介绍如何使用JavaScript。并在视频达到1000点赞后公布了PHP版的源码。<br/> | ||
在8.22这个教程视频就被锁定了,B站给出的原因:该视频内容涉及不适宜内容,不予审核通过。如有疑问请通过稿件申诉进行反馈。<br/> | ||
[原视频备份](https://v.youku.com/v_show/id_XNDc5MDExMzAyMA====.html) | ||
|
||
#### LC优化版 | ||
[LC](https://github.com/lc6464 "LC")在我的邀请下,帮我完善了打开文件夹等一系列功能,并且制作了[优化版](https://github.com/lc6464/PanDownload-PHP-Optimized)和使用方法:[BV1dt4y1D7Cf](https://b23.tv/pfUrnp) | ||
|
||
之后就有很多站长开始搭建PHP版,并在酷安、葫芦侠等平台传播开来。 | ||
|
||
#### 吾爱破解小工具 | ||
在8.25晚上吾爱破解上kemiok作者发布了制作的[度盘IDM高速下载](https://www.52pojie.cn/thread-1254032-1-1.html)小工具。<br/> | ||
关于接口引用,因为论坛的规定,不能留下其他的网站网址,但联系作者得知他也很想去感谢那些站长。<br/> | ||
|
||
#### 百度网盘算法更新 | ||
在9.27号百度网盘更新了新的V7.0.5 Windows版本,其他开发者开发的黑解算法失效,此项目不受影响。 | ||
|
||
#### baiduwp Spring Boot 版 | ||
作者 muzi9527 以本项目为蓝本,改写了[baiduwp-springboot](https://github.com/muzi9527/baiduwp-springboot)(Spring Boot语言版)。 | ||
|
||
## Thanks | ||
- [baiduwp JavaScript 版](https://github.com/TkzcM/baiduwp "GitHub 项目") | ||
- [PanDownload 网站](https://pandownload.com/ "PanDownload 网站") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<?php | ||
|
||
/** | ||
* PanDownload 网页复刻版,PHP 语言版API文件 | ||
* | ||
* 提供一些接口服务 | ||
* | ||
* @version 1.4.5 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* | ||
*/ | ||
session_start(); | ||
define('init', true); | ||
if (version_compare(PHP_VERSION, '7.0.0', '<')) { | ||
http_response_code(503); | ||
header('Content-Type: text/plain; charset=utf-8'); | ||
header('Refresh: 5;url=https://www.php.net/downloads.php'); | ||
die("HTTP 503 服务不可用!\r\nPHP 版本过低!无法正常运行程序!\r\n请安装 7.0.0 或以上版本的 PHP!\r\n将在五秒内跳转到 PHP 官方下载页面!"); | ||
} | ||
if (!(file_exists('config.php') && file_exists('functions.php'))) { | ||
http_response_code(503); | ||
header('Content-Type: text/plain; charset=utf-8'); | ||
header('Refresh: 5;url=https://github.com/yuantuo666/baiduwp-php'); | ||
die("HTTP 503 服务不可用!\r\n缺少相关配置和定义文件!无法正常运行程序!\r\n请重新 Clone 项目并配置!\r\n将在五秒内跳转到 GitHub 储存库!"); | ||
} | ||
// 导入配置和函数 | ||
require('config.php'); | ||
require('functions.php'); | ||
// 通用响应头 | ||
header('Content-Type: text/html; charset=utf-8'); | ||
header('X-UA-Compatible: IE=edge,chrome=1'); | ||
//隐藏错误代码,保护信息安全 | ||
if (DEBUG) { | ||
error_reporting(E_ALL); | ||
} else { | ||
error_reporting(0); //关闭错误报告 | ||
} | ||
|
||
$method = (!empty($_GET["m"])) ? $_GET["m"] : ""; | ||
switch ($method) { | ||
case 'LastParse': | ||
//返回数据库中上一次解析的时间,及SVIP状态 | ||
if (USING_DB) { | ||
//开启了数据库 | ||
connectdb(true); | ||
|
||
$sql = "SELECT * FROM `$dbtable` WHERE `size`>=52428800 ORDER BY `ptime` DESC LIMIT 0,1"; //时间倒序输出第一项 | ||
$mysql_query = mysqli_query($conn, $sql); | ||
if ($Result = mysqli_fetch_assoc($mysql_query)) { | ||
//存在数据 | ||
$Time = $Result["ptime"]; | ||
$realLink = $Result["realLink"]; | ||
$SvipState = (strstr('https://' . $realLink, "//qdall")) ? 0 : 1; //1:正常 0:限速 | ||
$SvipStateMsg = ($SvipState) ? "状态正常" : "已被限速"; | ||
$SvipTips = ($SvipState) ? "正常" : "限速"; | ||
EchoInfo(0, array( | ||
"msg" => "SVIP账号状态<br /><div align='left'>上次解析时间:" . $Time . "<br />上次解析状态:" . $SvipStateMsg . "</div>", | ||
"svipstate" => $SvipState, | ||
"sviptips" => $SvipTips | ||
)); | ||
} else { | ||
EchoInfo(0, array("msg" => "数据库中没有数据")); | ||
} | ||
} else { | ||
//未开启数据库 | ||
EchoInfo(-1, array("msg" => "未开启数据库功能", "sviptips" => "Unknown")); | ||
} | ||
break; | ||
|
||
case "ParseCount": | ||
//返回数据库中所有的解析总数和文件总大小 | ||
if (USING_DB) { | ||
//开启了数据库 | ||
connectdb(true); | ||
|
||
$sql = "SELECT count(`id`) as AllCount,sum(`size`) as AllSize FROM `$dbtable`"; | ||
$mysql_query = mysqli_query($conn, $sql); | ||
if ($Result = mysqli_fetch_assoc($mysql_query)) { | ||
//存在数据 | ||
$AllCount = $Result["AllCount"]; | ||
$AllSize = formatSize((int)$Result["AllSize"]); //格式化获取到的文件大小 | ||
$ParseCountMsg = "累计解析 $AllCount 个,共 $AllSize"; | ||
} else { | ||
EchoInfo(0, array("msg" => "当前数据库版本不支持此统计操作")); | ||
exit; | ||
} | ||
|
||
$sql = "SELECT count(`id`) as AllCount,sum(`size`) as AllSize FROM `$dbtable` WHERE date(`ptime`)=date(now());"; //获取今天的解析量 | ||
$mysql_query = mysqli_query($conn, $sql); | ||
if ($Result = mysqli_fetch_assoc($mysql_query)) { | ||
//存在数据 | ||
$AllCount = $Result["AllCount"]; | ||
$AllSize = formatSize((int)$Result["AllSize"]); //格式化获取到的文件大小 | ||
$TodayParseCountMsg = "今日解析 $AllCount 个,共 $AllSize"; | ||
} else { | ||
EchoInfo(0, array("msg" => "当前数据库版本不支持此统计操作")); | ||
exit; | ||
} | ||
EchoInfo(0, array("msg" => "系统使用统计<br /><div align='left'>$ParseCountMsg<br />$TodayParseCountMsg</div>")); | ||
} else { | ||
//未开启数据库 | ||
EchoInfo(-1, array("msg" => "未开启数据库功能")); | ||
} | ||
break; | ||
default: | ||
EchoInfo(-1, array("msg" => "无传入数据")); | ||
break; | ||
} | ||
|
||
function EchoInfo(int $error, array $Result) | ||
{ | ||
$ReturnArray = array("error" => $error); | ||
$ReturnArray += $Result; | ||
echo json_encode($ReturnArray); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
-- MySQL dump 10.13 Distrib 5.6.47, for Linux (x86_64) | ||
-- | ||
-- Host: localhost Database: bdwp | ||
-- ------------------------------------------------------ | ||
-- Server version 5.6.47-log | ||
|
||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!40101 SET NAMES utf8 */; | ||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | ||
/*!40103 SET TIME_ZONE='+00:00' */; | ||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
|
||
-- | ||
-- Table structure for table `bdwp` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `bdwp`; | ||
/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
/*!40101 SET character_set_client = utf8 */; | ||
CREATE TABLE `bdwp` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`userip` text NOT NULL COMMENT '用户ip', | ||
`filename` text NOT NULL COMMENT '文件名', | ||
`size` text NOT NULL COMMENT '文件大小', | ||
`md5` text NOT NULL COMMENT '文件效验码', | ||
`path` text NOT NULL COMMENT '文件路径', | ||
`server_ctime` text NOT NULL COMMENT '文件创建时间', | ||
`realLink` text NOT NULL COMMENT '文件下载地址', | ||
`ptime` datetime NOT NULL COMMENT '解析时间', | ||
`paccount` int(11) NOT NULL COMMENT '解析账号id', | ||
PRIMARY KEY (`id`) | ||
) ENGINE=MyISAM AUTO_INCREMENT=5050 DEFAULT CHARSET=utf8mb4; | ||
/*!40101 SET character_set_client = @saved_cs_client */; | ||
|
||
-- | ||
-- Table structure for table `bdwp_ip` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `bdwp_ip`; | ||
/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
/*!40101 SET character_set_client = utf8 */; | ||
CREATE TABLE `bdwp_ip` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`ip` text NOT NULL COMMENT 'ip地址', | ||
`remark` text NOT NULL COMMENT '备注', | ||
`add_time` datetime NOT NULL COMMENT '白黑名单添加时间', | ||
`type` tinyint(4) NOT NULL COMMENT '状态(0:允许,-1:禁止)', | ||
PRIMARY KEY (`id`) | ||
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; | ||
/*!40101 SET character_set_client = @saved_cs_client */; | ||
|
||
-- | ||
-- Table structure for table `bdwp_svip` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `bdwp_svip`; | ||
/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
/*!40101 SET character_set_client = utf8 */; | ||
CREATE TABLE `bdwp_svip` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` text NOT NULL COMMENT '账号名称', | ||
`svip_bduss` text NOT NULL COMMENT '会员bduss', | ||
`svip_stoken` text NOT NULL COMMENT '会员stoken', | ||
`add_time` datetime NOT NULL COMMENT '会员账号加入时间', | ||
`state` tinyint(4) NOT NULL COMMENT '会员状态(0:正常,-1:限速)', | ||
`is_using` datetime NOT NULL COMMENT '是否正在使用(非零表示真)', | ||
PRIMARY KEY (`id`) | ||
) ENGINE=MyISAM AUTO_INCREMENT=255 DEFAULT CHARSET=utf8; | ||
/*!40101 SET character_set_client = @saved_cs_client */; | ||
|
||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | ||
|
||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
|
||
-- Dump completed on 2020-10-20 23:21:53 |
Oops, something went wrong.