diff --git a/src/fileDownloader.py b/src/fileDownloader.py index becaf90..aebd07a 100644 --- a/src/fileDownloader.py +++ b/src/fileDownloader.py @@ -1,15 +1,9 @@ -import requests, datetime, os +import datetime, os, urllib def download_backup(backup_url: str, file_path: str): - r = requests.get(backup_url, stream = True) - - with open(file_path,"wb") as pdf: - for chunk in r.iter_content(chunk_size=1024): - - if chunk: - pdf.write(chunk) + urllib.request.urlretrieve(backup_url, file_path) def create_dirs_and_download(backup_url: str, date: datetime.datetime, base_path: str) -> str: