Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit f5e19f5

Browse files
committed
修复sign接口调整导致的问题;支持识别新版本分享链接
1 parent bb903d8 commit f5e19f5

File tree

8 files changed

+28
-12
lines changed

8 files changed

+28
-12
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PanDownload 网页复刻版,PHP 语言版<br/>
55

66
由于百度网盘修改分享页面JavaScript代码,导致 `2.1.3` 及以前版本失效。详细信息参见[#93](https://github.com/yuantuo666/baiduwp-php/issues/93)
77

8-
由于百度网盘修改分享页面返回头,导致所有旧版本失效,请更新至 `2.2.2` 或更新版本体验本项目。<br/>
8+
由于百度网盘修改获取sign参数接口,导致所有旧版本失效,请更新至 `2.2.3` 或更新版本体验本项目。<br/>
99

1010
<div align="center"><a href="https://www.bilibili.com/video/BV1N5411A77n"><img src="https://i.loli.net/2021/04/04/9NJ2lC4T78o1XmZ.png" width="500"><br /><b>点此查看本项目安装、配置、使用视频教程</b></a></div>
1111

@@ -67,13 +67,13 @@ PanDownload 网页复刻版,PHP 语言版<br/>
6767
**SVIP账号**中可设置**SVIP账号****BDUSS****STOKEN**,添加账号后记得进入**会员账号切换模式**将模式改成**顺序模式****轮换模式**。<br />
6868

6969
## 📦New Changes
70-
- 当前版本: `2.2.2`
71-
- 更新日期:2022-09-22
70+
- 当前版本: `2.2.3`
71+
- 更新日期:2022-10-07
7272
- 修改内容:
7373
- ⚠错误修复
74-
- 完成 微信API 解析模式
75-
- 修复 因百度 09.21 调整导致的解析文件夹 失效问题
76-
74+
- 修复 因百度 09.28 对sign接口调整导致的失效问题
75+
- ♻代码优化
76+
- 支持识别新版本分享链接
7777

7878
[查看更多](Update.md)
7979

Update.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Update
2+
### `2.2.2` 版本:
3+
- 更新日期:2022-09-22
4+
- 修改内容:
5+
- ⚠错误修复
6+
- 完成 微信API 解析模式
7+
- 修复 因百度 09.21 调整导致的解析文件夹 失效问题
8+
29
### `2.2.1` 版本:
310
- 更新日期:2022-09-17
411
- 修改内容:

common/index.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,12 @@
7373
});
7474
</script>
7575
<?php } ?>
76+
<script>
77+
// check if this site is in black list
78+
let blacklist = ["www.pojiewo.com", "bd.fkxz.cn", "pan.10zv.com"];
79+
if (blacklist.includes(document.domain)) {
80+
alert("当前网站在 baiduwp-php 项目的黑名单中,即将跳转到项目 Github 仓库");
81+
window.location.href = "https://github.com/yuantuo666/baiduwp-php";
82+
}
83+
</script>
7684
</div>

functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function GetSignCore(string $surl)
177177
$url = "https://pan.baidu.com/share/tplconfig?surl=${surl}&fields=sign,timestamp&channel=chunlei&web=1&app_id=250528&clienttype=0";
178178
$header = [
179179
"User-Agent: netdisk",
180-
"X-Download-From: baiduyun",
180+
"Cookie: BDUSS=" . SVIP_BDUSS . "; STOKEN=" . SVIP_STOKEN,
181181
];
182182
$result = get($url, $header);
183183
$result = json_decode($result, true, 512, JSON_BIGINT_AS_STRING);

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @link https://space.bilibili.com/88197958
1515
*
1616
*/
17-
$programVersion_Index = "2.2.2";
17+
$programVersion_Index = "2.2.3";
1818
session_start();
1919
define('init', true);
2020
if (version_compare(PHP_VERSION, '7.0.0', '<')) {

install/config_raw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @link https://imwcr.cn/
88
* @link https://space.bilibili.com/88197958
99
*/
10-
const programVersion = '2.2.2';
10+
const programVersion = '2.2.3';
1111
if (!defined('init')) {
1212
http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./');
1313
die("HTTP 403 禁止访问!\r\n此文件是 PanDownload 网页复刻版 PHP 语言版项目版本 " . programVersion . " 的配置文件!\r\n禁止直接访问!");

static/functions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ function validateForm() {
1414
if (link == null || link === "") { input.focus(); Swal.fire("提示", "请填写分享链接", "info"); return false; }
1515
var uk = link.match(/uk=(\d+)/), shareid = link.match(/shareid=(\d+)/);
1616
if (uk != null && shareid != null) {
17-
// input.focus(); Swal.fire("提示", "填入的分享是老版本分享链接,请保存到网盘重新分享后重试。", "info"); return false;
18-
// 后端没有处理老版本链接
1917
input.value = "";
2018
$("form").append(`<input type="hidden" name="uk" value="${uk[1]}"/><input type="hidden" name="shareid" value="${shareid[1]}"/>`);
2119
return true;
@@ -73,8 +71,11 @@ function OpenRoot(surl, pwd) {
7371
function Getpw() {
7472
var link = document.forms["form1"]["surl"].value;
7573
var pw = link.match(/.? *(\w{4})/);
74+
var pw2 = link.match(/pwd=(\w{4})/); // support new version of share link; thanks to #216
7675
if (pw != null) {
7776
document.forms["form1"]["pwd"].value = pw[1];
77+
} else if (pw2 != null) {
78+
document.forms["form1"]["pwd"].value = pw2[1];
7879
}
7980
}
8081

updater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
*
1414
*/
1515

16-
$programVersion_Updater = "2.2.2";
16+
$programVersion_Updater = "2.2.3";

0 commit comments

Comments
 (0)