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 @@ -2,6 +2,7 @@
import sys
import cgi
import os
import os.path
import datetime

from do_authentication import authenticate
Expand Down Expand Up @@ -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))

Expand Down