Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
from __future__ import annotations
|
| 3 |
|
| 4 |
import requests
|
|
|
|
| 5 |
|
| 6 |
import os
|
| 7 |
import random
|
|
@@ -62,6 +63,9 @@ api_url = None
|
|
| 62 |
def make_api_request():
|
| 63 |
response = requests.get("https://genielamp-image9.hf.space/")
|
| 64 |
api_url = response.text
|
|
|
|
|
|
|
|
|
|
| 65 |
print(response.text)
|
| 66 |
#------------------------------------------------------
|
| 67 |
|
|
|
|
| 2 |
from __future__ import annotations
|
| 3 |
|
| 4 |
import requests
|
| 5 |
+
import re
|
| 6 |
|
| 7 |
import os
|
| 8 |
import random
|
|
|
|
| 63 |
def make_api_request():
|
| 64 |
response = requests.get("https://genielamp-image9.hf.space/")
|
| 65 |
api_url = response.text
|
| 66 |
+
match = re.search(r'"root"\s*:\s*"([^"]+)"', response.text)
|
| 67 |
+
api_url = match.group(1)
|
| 68 |
+
print(api_url)
|
| 69 |
print(response.text)
|
| 70 |
#------------------------------------------------------
|
| 71 |
|