change from requests to urllib
parent
6a3cd9a52d
commit
62b78ff182
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue