fix 递归下载

This commit is contained in:
qing 2024-09-27 12:35:55 +08:00
parent 4c26f5cab8
commit 5d3fb91df6

View File

@ -285,9 +285,9 @@ class Pan123:
content_size = int(file_size) # 文件总大小 content_size = int(file_size) # 文件总大小
data_count = 0 # 当前已传输的大小 data_count = 0 # 当前已传输的大小
if file_size > 1048576: if file_size > 1048576:
size_print_download = str(round(file_size / 1048576, 2)) + "M" size_print_download = str(round(file_size / 1048576, 2)) + "MB"
else: else:
size_print_download = str(round(file_size / 1024, 2)) + "K" size_print_download = str(round(file_size / 1024, 2)) + "KB"
print(file_name + " " + size_print_download) print(file_name + " " + size_print_download)
time1 = time.time() time1 = time.time()
time_temp = time1 time_temp = time1
@ -311,9 +311,9 @@ class Pan123:
speed = pass_data / int(pass_time) speed = pass_data / int(pass_time)
speed_m = speed / 1048576 speed_m = speed / 1048576
if speed_m > 1: if speed_m > 1:
speed_print = str(round(speed_m, 2)) + "M/S" speed_print = str(round(speed_m, 2)) + "MB/S"
else: else:
speed_print = str(round(speed_m * 1024, 2)) + "K/S" speed_print = str(round(speed_m * 1024, 2)) + "KB/S"
print( print(
"\r [%s%s] %d%% %s" "\r [%s%s] %d%% %s"
% ( % (
@ -834,6 +834,8 @@ if __name__ == "__main__":
elif sure == "1": elif sure == "1":
file_detail = pan.list[int(command[9:]) - 1] file_detail = pan.list[int(command[9:]) - 1]
pan.download_dir(file_detail) pan.download_dir(file_detail)
# 重置下载模式
pan.download_mode = 1
else: else:
pan.download(int(command[9:]) - 1) pan.download(int(command[9:]) - 1)