diff --git a/download.py b/download.py index 976e68d..814a00e 100644 --- a/download.py +++ b/download.py @@ -2,6 +2,7 @@ import sys import cgi import os +import os.path import datetime from do_authentication import authenticate @@ -118,9 +119,10 @@ def download_one_zone(url, output_directory): # This is where the zone file will be saved path = '{0}/{1}'.format(output_directory, filename) - with open(path, 'wb') as f: - for chunk in download_zone_response.iter_content(1024): - f.write(chunk) + if not os.path.isfile(path): + with open(path, 'wb') as f: + for chunk in download_zone_response.iter_content(1024): + f.write(chunk) print("{0}: Completed downloading zone to file {1}".format(str(datetime.datetime.now()), path))