Skip to content

Commit ce4f4b9

Browse files
committed
update
1 parent 0893c55 commit ce4f4b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rclone_expect_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def download_rclone():
7171
maxbit = "linux-amd64.zip"
7272
else:
7373
maxbit = "linux-386.zip"
74-
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
74+
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) " \
75+
"Chrome/84.0.4147.105 Safari/537.36 "
7576
# 请求GitHub api
7677
req = urllib.request.Request("https://api.github.com/repos/rclone/rclone/releases/latest",
7778
headers={"User-Agent": user_agent}, method='GET')
@@ -248,7 +249,7 @@ def one_drive(rclone_dir, drive_name, region="1", access_token=None):
248249
buffer = child.buffer.decode()
249250
print(buffer)
250251
if "HTTP error 429 (429 Too Many Requests)" in buffer:
251-
raise ValueError("429请求太多:请等待一段时间后再次尝试!")
252+
raise ValueError(f"{drive_name} 429请求太多:请等待一段时间后再次尝试!")
252253
# 抛出授权出现错误异常
253254
raise ValueError(f"""{drive_name} 授权出现错误,请重新执行 ./rclone.exe authorize "onedrive" 以获取新的token """)
254255
except pexpect.TIMEOUT: # 匹配不上将抛出超时异常

0 commit comments

Comments
 (0)