Fix bug which downloaded only the first file in a folder

master
Dan Howe 6 years ago
parent f7bc7521a6
commit c4908077f1

@ -128,8 +128,8 @@ def download_document(url, document_path):
# Create output directories as required
os.makedirs(os.path.dirname(document_path), exist_ok=True)
# Check if file exists
if os.path.isfile(document_path):
# Check if a non-empty file exists
if os.path.isfile(document_path) and os.path.getsize(document_path) > 0:
pass
else:
try:

Loading…
Cancel
Save