Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
import cgi
import os
import datetime
from multiprocessing.pool import ThreadPool

from do_authentication import authenticate
from do_http_get import do_get

MAX_THREADS = 6

##############################################################################################################
# First Step: Get the config data from config.json file
##############################################################################################################
Expand Down Expand Up @@ -142,9 +145,8 @@ def download_zone_files(urls, working_directory):
if not os.path.exists(output_directory):
os.makedirs(output_directory)

# Download the zone files one by one
for link in urls:
download_one_zone(link, output_directory)
pool = ThreadPool(MAX_THREADS)
pool.map(lambda link: download_one_zone(link, output_directory), urls)

# Finally, download all zone files
start_time = datetime.datetime.now()
Expand Down