@@ -66,7 +66,7 @@ def sanitize_link(url_code):
66
66
# 处理 http 链接
67
67
url_code = url_code .replace ("http://" , "https://" )
68
68
# 处理(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=" , " " )
70
70
# 处理旧格式链接
71
71
url_code = url_code .replace ("https://pan.baidu.com/share/init?surl=" , "https://pan.baidu.com/s/1" )
72
72
return url_code
@@ -95,7 +95,7 @@ def thread_it(func, *args):
95
95
class BaiduPanFilesTransfers :
96
96
"""
97
97
名称:BaiduPanFilesTransfers
98
- 版本:2.3.1
98
+ 版本:2.3.2
99
99
作者:assassing(https://github.com/hxz393)
100
100
参考:https://pan.baidu.com/union/doc/rksg0sa17
101
101
打包:pyinstaller -F -w -i bpftUI.ico -n BaiduPanFilesTransfers bpftUI.py
@@ -114,6 +114,7 @@ class BaiduPanFilesTransfers:
114
114
'Accept-Encoding' : 'gzip, deflate, br' ,
115
115
'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' ,
116
116
'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' ,
117
118
}
118
119
119
120
def __init__ (self ):
@@ -135,7 +136,7 @@ def __init__(self):
135
136
self .root .iconbitmap (default = self .ICON_PATH )
136
137
137
138
# 主窗口配置
138
- self .root .wm_title ("BaiduPanFilesTransfers 2.3.1 " )
139
+ self .root .wm_title ("BaiduPanFilesTransfers 2.3.2 " )
139
140
self .root .wm_geometry ('410x480+240+240' )
140
141
self .root .minsize (410 , 480 )
141
142
self .root .wm_attributes ("-alpha" , 0.88 )
@@ -275,7 +276,7 @@ def transfer_files_rapid(self, rapid_data, target_directory_name):
275
276
url = f'{ BASE_URL } /rest/2.0/xpan/file?method=create&access_token={ self .access_token } &bdstoken={ self .bdstoken } '
276
277
response_json = {'errno' : None }
277
278
278
- for _ in range (15 ):
279
+ for _ in range (10 ):
279
280
rapid_data [0 ] = '' .join (random .choice ([c .upper (), c .lower ()]) for c in rapid_data [0 ])
280
281
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'
281
282
response = self .session .post (url = url , headers = header , data = post_data , timeout = 15 , allow_redirects = False , verify = False )
0 commit comments