Commit
·
1259fe0
1
Parent(s):
c489b93
fix API_URL
Browse files
app.py
CHANGED
|
@@ -16,7 +16,8 @@ import requests
|
|
| 16 |
from PIL import Image
|
| 17 |
|
| 18 |
# API Configuration
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
TOKEN = os.environ["API_TOKEN"]
|
| 22 |
|
|
@@ -477,6 +478,8 @@ def process_file(
|
|
| 477 |
headers=headers,
|
| 478 |
timeout=1000,
|
| 479 |
)
|
|
|
|
|
|
|
| 480 |
response.raise_for_status()
|
| 481 |
|
| 482 |
# Parse API response
|
|
|
|
| 16 |
from PIL import Image
|
| 17 |
|
| 18 |
# API Configuration
|
| 19 |
+
|
| 20 |
+
API_URL = os.environ["API_URL"]
|
| 21 |
|
| 22 |
TOKEN = os.environ["API_TOKEN"]
|
| 23 |
|
|
|
|
| 478 |
headers=headers,
|
| 479 |
timeout=1000,
|
| 480 |
)
|
| 481 |
+
if response.status_code == 404:
|
| 482 |
+
raise RuntimeError("Invalid URL")
|
| 483 |
response.raise_for_status()
|
| 484 |
|
| 485 |
# Parse API response
|