Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -128,7 +128,8 @@ def download_file(url, filename, folder="."):
|
|
128 |
response = requests.get(url, headers=headers)
|
129 |
response.raise_for_status()
|
130 |
except requests.exceptions.HTTPError as e:
|
131 |
-
|
|
|
132 |
headers['Authorization'] = f'Bearer {os.environ["CIVITAI_API"]}'
|
133 |
try:
|
134 |
response = requests.get(url, headers=headers)
|
|
|
128 |
response = requests.get(url, headers=headers)
|
129 |
response.raise_for_status()
|
130 |
except requests.exceptions.HTTPError as e:
|
131 |
+
print(e)
|
132 |
+
if response.status_code == 401:
|
133 |
headers['Authorization'] = f'Bearer {os.environ["CIVITAI_API"]}'
|
134 |
try:
|
135 |
response = requests.get(url, headers=headers)
|