import requests
def _download_file(url: str, output_file_path: str, chunk_size: int = 8192) -> str:
with requests.get(url, stream=True) as stream:
stream.raise_for_status()
with open(file=output_file_path, mode="wb") as file:
for chunk in stream.iter_content(chunk_size=chunk_size):
if chunk:
file.write(chunk)
return file.name
Created
March 5, 2023 06:39
-
-
Save fuji44/cbb54e0f2816d8bcb45037736284140b to your computer and use it in GitHub Desktop.
Download file with Python
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment