This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ceaadf
commit e209f14
Showing
13 changed files
with
135 additions
and
119 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 |
---|---|---|
|
@@ -7,8 +7,7 @@ | |
* 提供一些接口服务 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
* | ||
*/ | ||
session_start(); | ||
|
@@ -80,10 +79,103 @@ | |
EchoInfo(-1, array("msg" => "未登录")); | ||
exit; | ||
} | ||
if (!USING_DB) { | ||
EchoInfo(-1, array("msg" => "未启用数据库功能")); | ||
exit; | ||
} | ||
connectdb(); | ||
|
||
$action = (!empty($_GET["act"])) ? $_GET["act"] : ""; | ||
switch ($action) { | ||
case "AccountStatus": | ||
// 普通账号 | ||
$return = ""; | ||
$BDUSS = getSubstr(Cookie, 'BDUSS=', ';'); | ||
$STOKEN = getSubstr(Cookie, 'STOKEN=', ';'); | ||
$cache_key = md5($BDUSS); | ||
if (isset($_SESSION['cache'][$cache_key]) && $_SESSION['cache'][$cache_key]['time'] > time() - 3600) { | ||
$Status = $_SESSION['cache'][$cache_key]['data']; | ||
} else { | ||
$Status = AccountStatus($BDUSS, $STOKEN); | ||
$_SESSION['cache'][$cache_key] = [ | ||
'time' => time(), | ||
'data' => $Status | ||
]; | ||
} | ||
if ($Status[0] == 0) { | ||
//正常 | ||
$AccountName = $Status[2]; | ||
$return .= "账号名称:$AccountName<br />"; | ||
if ($Status[3] == 1) | ||
$return .= "登录状态:<span class=\"text-success\">正常</span><br />"; | ||
else | ||
$return .= "登录状态:<span class=\"text-danger\">异常</span><br />"; | ||
|
||
$AccountVIP = ["普通账号", "普通会员", "超级会员"][$Status[1]]; | ||
$return .= "会员状态:$AccountVIP<br />"; | ||
if ($Status[4] != 0) { | ||
$AccountTime = time2Units($Status[4]); | ||
if ($Status[4] <= 60480) | ||
$return .= "剩余时间:<span class=\"text-danger\">$AccountTime</span><br />"; | ||
else | ||
$return .= "剩余时间:$AccountTime<br />"; | ||
} | ||
} elseif ($Status[0] == -6) { | ||
$return .= "id为 $id 的SVIP账号已经失效<br />"; | ||
} else { | ||
$return .= "出现位置错误代码:" . $Status[0] . "<br />"; | ||
} | ||
$normal_account_msg = $return; | ||
$return = ""; | ||
|
||
// SVIP账号 | ||
// 获取对应BDUSS | ||
$DBSVIP = GetDBBDUSS(); | ||
$SVIP_BDUSS = $DBSVIP[0]; | ||
$id = $DBSVIP[1]; | ||
$SVIP_STOKEN = $DBSVIP[2]; | ||
if ($SVIP_STOKEN == "") { | ||
$return .= "id为 $id 的SVIP账号没有设置对应STOKEN,无法检测<br />"; | ||
} else { | ||
$cache_key = md5($SVIP_BDUSS); | ||
if (isset($_SESSION['cache'][$cache_key]) && $_SESSION['cache'][$cache_key]['time'] > time() - 3600) { | ||
$Status = $_SESSION['cache'][$cache_key]['data']; | ||
} else { | ||
$Status = AccountStatus($SVIP_BDUSS, $SVIP_STOKEN); | ||
$_SESSION['cache'][$cache_key] = [ | ||
'time' => time(), | ||
'data' => $Status | ||
]; | ||
} | ||
if ($Status[0] == 0) { | ||
$AccountName = $Status[2]; | ||
$return .= "账号名称:$AccountName<br />"; | ||
if ($Status[3] == 1) | ||
$return .= "登录状态:<span class=\"text-success\">正常</span><br />"; | ||
else | ||
$return .= "登录状态:<span class=\"text-danger\">异常</span><br />"; | ||
|
||
$AccountVIP = ["普通账号", "普通会员", "超级会员"][$Status[1]]; | ||
$return .= "会员状态:$AccountVIP<br />"; | ||
if ($Status[4] != 0) { | ||
$AccountTime = time2Units($Status[4]); | ||
if ($Status[4] <= 60480) | ||
$return .= "剩余时间:<span class=\"text-danger\">$AccountTime</span><br />"; | ||
else | ||
$return .= "剩余时间:$AccountTime<br />"; | ||
} | ||
} elseif ($Status[0] == -6) { | ||
$return .= "id为 $id 的SVIP账号已经失效<br />"; | ||
} else { | ||
$return .= "出现位置错误代码:" . $Status[0] . "<br />"; | ||
} | ||
} | ||
|
||
$svip_account_msg = $return; | ||
header('Content-Type: application/json; charset=utf-8'); | ||
echo json_encode(array("error" => 0, "normal_msg" => $normal_account_msg, "svip_msg" => $svip_account_msg)); | ||
break; | ||
|
||
case "AnalyseGetTable": | ||
$page = (!empty($_GET["page"])) ? $_GET["page"] : ""; | ||
header('Content-Type: text/html; charset=utf-8'); | ||
|
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 |
---|---|---|
|
@@ -4,8 +4,7 @@ | |
* PanDownload 网页复刻版,PHP 语言版 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
*/ | ||
class Parse | ||
{ | ||
|
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 |
---|---|---|
|
@@ -8,8 +8,7 @@ | |
* 请勿随意修改此文件!如需更改相关配置请到 config.php ! | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
* | ||
*/ | ||
if (!init) require_once("./common/invalidCheck.php"); | ||
|
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 |
---|---|---|
|
@@ -6,8 +6,7 @@ | |
* 首页文件 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
* | ||
*/ | ||
require_once("./common/invalidCheck.php"); | ||
|
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 |
---|---|---|
|
@@ -6,8 +6,7 @@ | |
* 检查是否初始化 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
* | ||
*/ | ||
if (!defined('init')) { // 直接访问处理程序 | ||
|
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 |
---|---|---|
|
@@ -5,11 +5,8 @@ | |
* | ||
* 功能描述:为一些页面添加必要的语言翻译 | ||
* | ||
* 此项目 GitHub 地址:https://github.com/yuantuo666/baiduwp-php | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
* | ||
*/ | ||
require_once("./common/invalidCheck.php"); | ||
|
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,6 +1,6 @@ | ||
# baiduwp-php | ||
|
||
> v3.0.1 | ||
> v3.0.2 | ||
Base URLs: | ||
|
||
|
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
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 |
---|---|---|
|
@@ -5,16 +5,11 @@ | |
* | ||
* 功能描述:使用百度 SVIP 账号获取真实下载地址,与 Pandownload 原版无关。 | ||
* | ||
* 希望在使用时能够保留导航栏的 Github 感谢! | ||
* | ||
* 此项目 GitHub 地址:https://github.com/yuantuo666/baiduwp-php | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
* | ||
*/ | ||
$programVersion_Index = "3.0.1"; | ||
$programVersion_Index = "3.0.2"; | ||
session_start(); | ||
define('init', true); | ||
if (!file_exists('./common/invalidCheck.php')) { | ||
|
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 |
---|---|---|
|
@@ -5,12 +5,8 @@ | |
* | ||
* 功能描述:安装PanDownload 网页复刻版 | ||
* | ||
* 此项目 GitHub 地址:https://github.com/yuantuo666/baiduwp-php | ||
* | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
* | ||
*/ | ||
define('init', true); | ||
|
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 |
---|---|---|
|
@@ -4,12 +4,11 @@ | |
* !!!请勿修改本文件,如果手动修改后再在后台设置,可能导致config.php文件被清空!!! | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
*/ | ||
require_once "./common/invalidCheck.php"; | ||
|
||
const programVersion = '3.0.1'; | ||
const programVersion = '3.0.2'; | ||
const Sitename = '<Sitename>'; | ||
|
||
const Cookie = '<Cookie>'; | ||
|
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 |
---|---|---|
|
@@ -6,9 +6,7 @@ | |
* 设置及后台功能 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
*/ | ||
session_start(); | ||
define('init', true); | ||
|
@@ -513,99 +511,30 @@ function IPLoadmore() { | |
<div class="row"> | ||
<div class="col-md-6 col-sm-12 card-item"> | ||
<h5>普通账号状态</h5> | ||
<p class="card-text"> | ||
<?php | ||
// 添加缓存 #253 | ||
// TODO: 后台也进行前后端分离 | ||
$BDUSS = getSubstr(Cookie, 'BDUSS=', ';'); | ||
$STOKEN = getSubstr(Cookie, 'STOKEN=', ';'); | ||
$cache_key = md5($BDUSS); | ||
if (isset($_SESSION['cache'][$cache_key]) && $_SESSION['cache'][$cache_key]['time'] > time() - 3600) { | ||
$Status = $_SESSION['cache'][$cache_key]['data']; | ||
} else { | ||
$Status = AccountStatus($BDUSS, $STOKEN); | ||
$_SESSION['cache'][$cache_key] = [ | ||
'time' => time(), | ||
'data' => $Status | ||
]; | ||
} | ||
if ($Status[0] == 0) { | ||
//正常 | ||
$AccountName = $Status[2]; | ||
echo "账号名称:$AccountName<br />"; | ||
if ($Status[3] == 1) | ||
echo "登录状态:<span class=\"text-success\">正常</span><br />"; | ||
else | ||
echo "登录状态:<span class=\"text-danger\">异常</span><br />"; | ||
|
||
$AccountVIP = ["普通账号", "普通会员", "超级会员"][$Status[1]]; | ||
echo "会员状态:$AccountVIP<br />"; | ||
if ($Status[4] != 0) { | ||
$AccountTime = time2Units($Status[4]); | ||
if ($Status[4] <= 60480) | ||
echo "剩余时间:<span class=\"text-danger\">$AccountTime</span><br />"; | ||
else | ||
echo "剩余时间:$AccountTime<br />"; | ||
} | ||
} elseif ($Status[0] == -6) { | ||
echo "id为 $id 的SVIP账号已经失效<br />"; | ||
} else { | ||
echo "出现位置错误代码:" . $Status[0] . "<br />"; | ||
} | ||
?> | ||
<p class="card-text" id="normal_msg"> | ||
正在获取账号状态... | ||
</p> | ||
<br /> | ||
</div> | ||
<div class="col-md-6 col-sm-12 card-item"> | ||
<h5>会员账号状态</h5> | ||
<p class="card-text"> | ||
<?php | ||
// 获取对应BDUSS | ||
$DBSVIP = GetDBBDUSS(); | ||
$SVIP_BDUSS = $DBSVIP[0]; | ||
$id = $DBSVIP[1]; | ||
$SVIP_STOKEN = $DBSVIP[2]; | ||
if ($SVIP_STOKEN == "") { | ||
echo "id为 $id 的SVIP账号没有设置对应STOKEN,无法检测<br />"; | ||
} else { | ||
$cache_key = md5($SVIP_BDUSS); | ||
if (isset($_SESSION['cache'][$cache_key]) && $_SESSION['cache'][$cache_key]['time'] > time() - 3600) { | ||
$Status = $_SESSION['cache'][$cache_key]['data']; | ||
} else { | ||
$Status = AccountStatus($SVIP_BDUSS, $SVIP_STOKEN); | ||
$_SESSION['cache'][$cache_key] = [ | ||
'time' => time(), | ||
'data' => $Status | ||
]; | ||
} | ||
if ($Status[0] == 0) { | ||
$AccountName = $Status[2]; | ||
echo "账号名称:$AccountName<br />"; | ||
if ($Status[3] == 1) | ||
echo "登录状态:<span class=\"text-success\">正常</span><br />"; | ||
else | ||
echo "登录状态:<span class=\"text-danger\">异常</span><br />"; | ||
|
||
$AccountVIP = ["普通账号", "普通会员", "超级会员"][$Status[1]]; | ||
echo "会员状态:$AccountVIP<br />"; | ||
if ($Status[4] != 0) { | ||
$AccountTime = time2Units($Status[4]); | ||
if ($Status[4] <= 60480) | ||
echo "剩余时间:<span class=\"text-danger\">$AccountTime</span><br />"; | ||
else | ||
echo "剩余时间:$AccountTime<br />"; | ||
} | ||
} elseif ($Status[0] == -6) { | ||
echo "id为 $id 的SVIP账号已经失效<br />"; | ||
} else { | ||
echo "出现位置错误代码:" . $Status[0] . "<br />"; | ||
} | ||
} | ||
?> | ||
<p class="card-text" id="svip_msg"> | ||
正在获取账号状态... | ||
</p> | ||
<br /> | ||
</div> | ||
</div> | ||
<script> | ||
$.get(`api.php?m=ADMINAPI&act=AccountStatus`, function(data, status) { | ||
if (data.error == 0) { | ||
$("#normal_msg").html(data.normal_msg); | ||
$("#svip_msg").html(data.svip_msg); | ||
} else { | ||
$("#normal_msg").html("获取失败"); | ||
$("#svip_msg").html("获取失败"); | ||
} | ||
}); | ||
</script> | ||
</div> | ||
</div> | ||
|
||
|
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 |
---|---|---|
|
@@ -4,8 +4,7 @@ | |
* 许多函数来源于github,详见项目里的Thanks | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
* @link https://space.bilibili.com/88197958 | ||
* @link https://github.com/yuantuo666/baiduwp-php | ||
* | ||
*/ | ||
addEventListener('DOMContentLoaded', function () { | ||
|