Skip to content

Commit

Permalink
Fix TypeError by ensuring thread_number is an integer in download_fil…
Browse files Browse the repository at this point in the history
…elist function
  • Loading branch information
KaikePing committed May 7, 2024
1 parent b8ceabc commit 777e4d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DriveDownloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ def download_filelist(args):
lines = [line for line in open(args.url, 'r')]
for line_idx, line in enumerate(lines):
splitted_line = line.strip().split(" ")
url, filename = splitted_line[0], splitted_line[1] if len(splitted_line) > 1 else ""
thread_number = int(splitted_line[2]) if len(splitted_line) > 2 else 1
list_suffix = "({:d}/{:d})".format(line_idx+1, len(lines))
download_single_file(*splitted_line, args.thread_number, list_suffix)
download_single_file(url, filename, thread_number, args.force_back_google, list_suffix)

def simple_cli():
console.print(f"***********************************************************************")
Expand Down

0 comments on commit 777e4d0

Please sign in to comment.