Skip to content

Commit 5f6e91e

Browse files
committed
提高转存稳定性
1 parent 970235c commit 5f6e91e

File tree

2 files changed

+25
-32
lines changed

2 files changed

+25
-32
lines changed

README.md

+20-28
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,19 @@ BaiduPCS-Go rapidupload -length=418024594 -md5=31f141fee63d038a46db179367315f3a
187187

188188
使用软件遇见错误时,先查看下面总结的一些常见问题和解决方案。再查看所有 [Issue](https://github.com/hxz393/BaiduPanFilesTransfers/issues) 中是否有同样问题。如果都没有帮助,再提交 [Issue](https://github.com/hxz393/BaiduPanFilesTransfers/issues) ,我一般当天或隔天会回复。
189189

190+
## 转存失败,错误代码 2 或 404
191+
192+
转存秒传链接时常见错误。
193+
194+
**原因**:似乎被百度当成万用报错码。
195+
196+
**解决**:目前再次尝试转存可成功。如果还是不行,可以试试网页端的转存脚本:[Greasy Fork](https://greasyfork.org/zh-CN/scripts/468633)
197+
198+
199+
190200
## 转存失败,错误代码 XX
191201

192-
如果软件突然不能使用
202+
软件突然不能转存
193203

194204
**原因**:Cookie 失效或不正确。百度网盘改版,软件失效。
195205

@@ -262,51 +272,33 @@ BaiduPCS-Go rapidupload -length=418024594 -md5=31f141fee63d038a46db179367315f3a
262272
# 更新日志
263273
为避免更新日志过长,只保留最近更新日志。
264274

265-
## 版本 2.3.1(2023.09.12)
266-
267-
修复内容:
268-
269-
1. 尝试解决秒传转存报错“31039”。
270-
271-
272-
273-
## 版本 2.3.0(2023.09.08)
275+
## 版本 2.3.2(2023.09.21)
274276

275277
修复内容:
276278

277-
1. 修复秒传转存接口。
279+
1. 修改请求头,减少秒传转存时出现报错“2”的概率;
280+
2. 增加对正常链接转存的兼容性。
278281

279282

280283

281-
## 版本 2.2.2(2023.06.02
284+
## 版本 2.3.1(2023.09.12
282285

283286
修复内容:
284287

285-
1. 秒传转存换回旧接口。
286-
287-
288+
1. 尝试解决秒传转存报错“31039”。
288289

289-
## 版本 2.2.1(2023.05.31)
290290

291-
更新内容:
292291

293-
1. 添加对解码后多个链接的秒传链接支持。
292+
## 版本 2.3.0(2023.09.08)
294293

295294
修复内容:
296295

297-
1. 修复秒传中文件名无法用“UTF-8”解码。
298-
2. 少量代码调整。
299-
300-
301-
296+
1. 修复秒传转存接口。
302297

303-
## 版本 1.13(2023.03.21)
304298

305-
更新内容:
306299

307-
1. 添加程序运行图标。
300+
## 版本 2.2.2(2023.06.02)
308301

309302
修复内容:
310303

311-
1. 更换秒传转存请求接口,解决报错误代码 `9019` 问题;
312-
304+
1. 秒传转存换回旧接口。

bpftUI.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def sanitize_link(url_code):
6666
# 处理 http 链接
6767
url_code = url_code.replace("http://", "https://")
6868
# 处理(https://pan.baidu.com/s/1tU58ChMSPmx4e3-kDx1mLg?pwd=123w)格式链接
69-
url_code = url_code.replace("?pwd=", " ")
69+
url_code = url_code.replace("?pwd=", " ").replace("&pwd=", " ")
7070
# 处理旧格式链接
7171
url_code = url_code.replace("https://pan.baidu.com/share/init?surl=", "https://pan.baidu.com/s/1")
7272
return url_code
@@ -95,7 +95,7 @@ def thread_it(func, *args):
9595
class BaiduPanFilesTransfers:
9696
"""
9797
名称:BaiduPanFilesTransfers
98-
版本:2.3.1
98+
版本:2.3.2
9999
作者:assassing(https://github.com/hxz393)
100100
参考:https://pan.baidu.com/union/doc/rksg0sa17
101101
打包:pyinstaller -F -w -i bpftUI.ico -n BaiduPanFilesTransfers bpftUI.py
@@ -114,6 +114,7 @@ class BaiduPanFilesTransfers:
114114
'Accept-Encoding': 'gzip, deflate, br',
115115
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-US;q=0.7,en-GB;q=0.6,ru;q=0.5',
116116
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
117+
'Content-Type': 'application/x-www-form-urlencoded',
117118
}
118119

119120
def __init__(self):
@@ -135,7 +136,7 @@ def __init__(self):
135136
self.root.iconbitmap(default=self.ICON_PATH)
136137

137138
# 主窗口配置
138-
self.root.wm_title("BaiduPanFilesTransfers 2.3.1")
139+
self.root.wm_title("BaiduPanFilesTransfers 2.3.2")
139140
self.root.wm_geometry('410x480+240+240')
140141
self.root.minsize(410, 480)
141142
self.root.wm_attributes("-alpha", 0.88)
@@ -275,7 +276,7 @@ def transfer_files_rapid(self, rapid_data, target_directory_name):
275276
url = f'{BASE_URL}/rest/2.0/xpan/file?method=create&access_token={self.access_token}&bdstoken={self.bdstoken}'
276277
response_json = {'errno': None}
277278

278-
for _ in range(15):
279+
for _ in range(10):
279280
rapid_data[0] = ''.join(random.choice([c.upper(), c.lower()]) for c in rapid_data[0])
280281
post_data = f'&block_list=["{rapid_data[0]}"]&path=/{quote(target_directory_name)}/{quote(rapid_data[3])}&size={rapid_data[2]}&isdir=0&rtype=2'
281282
response = self.session.post(url=url, headers=header, data=post_data, timeout=15, allow_redirects=False, verify=False)

0 commit comments

Comments
 (0)