Skip to content
Snippets Groups Projects
Commit cd9a8b5b authored by B13nch3n's avatar B13nch3n
Browse files

Safer downloading

parent 28d926ca
No related branches found
No related tags found
No related merge requests found
......@@ -226,7 +226,7 @@ def _download_file(file_url):
"""Download a file into a temporary file. Mark for deletion on
termination"""
rspns = requests.get(file_url, stream=True, timeout=600)
if rspns.status_code != 200:
if not rspns.ok:
raise RuntimeError(f"File not found by URL '{file_url}'.")
dlf = tempfile.TemporaryFile()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment