This repository has been archived by the owner on May 3, 2022. It is now read-only.
forked from yuantuo666/baiduwp-php
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
4 changed files
with
27 additions
and
27 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
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
* 请不要使用弱密码!否则后果自负! | ||
* 若只在局域网开放,则可根据个人喜好开启或关闭密码。 | ||
* | ||
* @version 1.2.1 | ||
* @version 1.2.2 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
|
@@ -22,7 +22,7 @@ | |
* @link https://lcwebsite.cn/ | ||
* @link https://space.bilibili.com/52618445 | ||
*/ | ||
if (!defined('init')){ http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); die('想啥呢?访问这个文件?'); } // 直接访问处理程序 | ||
if (!defined('init')){ http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./'); die('想啥呢?直接访问这个文件?'); } // 直接访问处理程序 | ||
|
||
define('BDUSS', ''); // 你的 SVIP BDUSS | ||
define('STOKEN', ''); // 你的 SVIP STOKEN | ||
|
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,7 +6,7 @@ | |
* | ||
* 请勿随意修改此文件!如需更改相关配置请到 config.php ! | ||
* | ||
* @version 1.2.1 | ||
* @version 1.2.2 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
|
@@ -16,7 +16,7 @@ | |
* @link https://lcwebsite.cn/ | ||
* @link https://space.bilibili.com/52618445 | ||
*/ | ||
if (!defined('init')){ http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); die('想啥呢?访问这个文件?'); } // 直接访问处理程序 | ||
if (!defined('init')){ http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./'); die('想啥呢?直接访问这个文件?'); } // 直接访问处理程序 | ||
|
||
// main | ||
function post($url, $data, array $headerArray) { | ||
|
@@ -48,9 +48,9 @@ function head($url, array $headerArray) { // curl 获取响应头 | |
curl_setopt($ch, CURLOPT_URL, $url); | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // 忽略ssl | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // TRUE 将curl_exec()获取的信息以字符串返回,而不是直接输出 | ||
curl_setopt($ch, CURLOPT_HEADER, true); // 返回 response header 默认 false 只会获得响应的正文 | ||
curl_setopt($ch, CURLOPT_NOBODY, true); // 有时候为了节省带宽及时间,只需要响应头 | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // TRUE 将 curl_exec() 获取的信息以字符串返回,而不是直接输出 | ||
curl_setopt($ch, CURLOPT_HEADER, true); // 返回 response header | ||
curl_setopt($ch, CURLOPT_NOBODY, true); // 为了节省带宽及时间,只需要响应头 | ||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerArray); | ||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); | ||
$response = curl_exec($ch); | ||
|
@@ -68,7 +68,7 @@ function getSubstr($str, $leftStr, $rightStr) { | |
function formatSize($b, $times = 0) { // 格式化size显示 | ||
if ($b > 1024) { | ||
$temp = $b / 1024; | ||
return formatSize($temp, $times + 1); | ||
return formatSize($temp, $times + 1); // 递归处理 | ||
} else { | ||
switch ($times) { | ||
case '0': | ||
|
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* | ||
* 此项目 GitHub 地址:https://github.com/yuantuo666/baiduwp-php | ||
* | ||
* @version 1.2.1 | ||
* @version 1.2.2 | ||
* | ||
* @author Yuan_Tuo <[email protected]> | ||
* @link https://imwcr.cn/ | ||
|
@@ -22,19 +22,13 @@ | |
*/ | ||
// 导入配置和函数 | ||
define('init', true); | ||
if (file_exists('config.php')) { | ||
require('config.php'); | ||
if (file_exists('config.php') && file_exists('functions.php')) { | ||
require('config.php'); require('functions.php'); | ||
} else { | ||
http_response_code(503); header('Content-Type: text/plain; charset=utf-8'); | ||
die('缺少配置文件!无法正常运行程序! | ||
请重新 Clone 项目并配置!'); | ||
} | ||
if (file_exists('functions.php')) { | ||
require('functions.php'); | ||
} else { | ||
http_response_code(503); header('Content-Type: text/plain; charset=utf-8'); | ||
die('缺少函数定义文件!无法正常运行程序! | ||
请重新 Clone 项目并配置!'); | ||
http_response_code(503); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 7;url=https://github.com/lc6464/baiduwp-php'); | ||
die('缺少相关配置和定义文件!无法正常运行程序! | ||
请重新 Clone 项目并配置! | ||
将在七秒内跳转到 GitHub 储存库!'); | ||
} | ||
// 通用响应头 | ||
header('Content-Type: text/html; charset=utf-8'); | ||
|
@@ -72,6 +66,7 @@ | |
<li class="nav-item"><a class="nav-link" href="https://pandownload.com/" target="_blank">度盘下载器</a></li> | ||
<li class="nav-item"><a class="nav-link" href="https://github.com/yuantuo666/baiduwp-php" target="_blank">GitHub 仓库</a></li> | ||
<li class="nav-item"><a class="nav-link" href="https://imwcr.cn/" target="_blank">Made by Yuan_Tuo</a></li> | ||
<li class="nav-item"><a class="nav-link" href="https://lcwebsite.cn/" target="_blank">Optimized by LC</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
|