mirror of
https://github.com/Bao-qing/123pan.git
synced 2026-10-08 08:09:40 +08:00
Merge pull request #14 from diaoyunxi/fix/download-conflict-invalid-choice
fix(cli): 下载冲突时无效选择不再误覆盖已有文件
This commit is contained in:
+3
-1
@@ -1,4 +1,5 @@
|
|||||||
123pan_config.json
|
123pan_config.json
|
||||||
|
|
||||||
download/*
|
download/*
|
||||||
123pan.txt
|
123pan.txt
|
||||||
dist/*
|
dist/*
|
||||||
@@ -7,4 +8,5 @@ build/*
|
|||||||
.idea/*
|
.idea/*
|
||||||
123pan.exe
|
123pan.exe
|
||||||
123pan.spec
|
123pan.spec
|
||||||
android.py
|
android.py
|
||||||
|
__pycache__/
|
||||||
|
|||||||
@@ -355,6 +355,10 @@ class Pan123CLI:
|
|||||||
return
|
return
|
||||||
elif choice == "3":
|
elif choice == "3":
|
||||||
self._download_mode = 3
|
self._download_mode = 3
|
||||||
|
elif choice != "1":
|
||||||
|
# 非有效选项(1/2/3/4)一律取消,避免误覆盖
|
||||||
|
print("无效选择,已取消下载")
|
||||||
|
return
|
||||||
r = self.tool.download_file(idx, on_progress=self._download_progress, overwrite=True)
|
r = self.tool.download_file(idx, on_progress=self._download_progress, overwrite=True)
|
||||||
|
|
||||||
print() # 换行
|
print() # 换行
|
||||||
|
|||||||
Reference in New Issue
Block a user