def download(demo_ids, threads):
# Convert the DemoIDs to URLs
urls = convert_to_urls(demo_ids)
# Define the number of threads
pool = ThreadPool(threads)
# Make a folder for the event to save the files in
directory = make_dir()
# Calls get() and adds the filesize returned each call to an array called filesizes
filesizes = pool.map(get, urls)
pool.close()
pool.join()
# Create a float to store the filesizes in and add them together
total_file_size = sum(filesizes)
# Print the properly formatted filesize.
print "Successfully transferred %s. Enjoy!" % (format_file_size(total_file_size))
return True
评论列表
文章目录