change from requests to urllib

main
Jan Beníček 2024-06-20 16:39:03 +02:00
parent 6a3cd9a52d
commit 62b78ff182
1 changed files with 2 additions and 8 deletions

View File

@ -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: