mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-19 17:53:00 +01:00
Add a timeout in requests.get()
This commit is contained in:
parent
0fde8febf9
commit
43a8cc6b50
1 changed files with 1 additions and 1 deletions
|
|
@ -101,7 +101,7 @@ this script the next time")
|
||||||
if not os.path.isfile(abs_file_name):
|
if not os.path.isfile(abs_file_name):
|
||||||
print(f"Downloading: {file_name}")
|
print(f"Downloading: {file_name}")
|
||||||
response = requests.get(url, allow_redirects=True, stream=True,
|
response = requests.get(url, allow_redirects=True, stream=True,
|
||||||
headers=headers)
|
headers=headers, timeout=20)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
with open(abs_file_name, 'wb') as target_file:
|
with open(abs_file_name, 'wb') as target_file:
|
||||||
target_file.write(response.raw.read())
|
target_file.write(response.raw.read())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue