mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-04 17:39:23 +08:00
Fix backup url (#116)
Co-authored-by: Freddy Boulton <freddyboulton@hf-freddy.local>
This commit is contained in:
@@ -592,11 +592,19 @@ class Stream(WebRTCConnectionMixin):
|
||||
host = urllib.parse.urlparse(url).netloc
|
||||
|
||||
URL = "https://api.fastrtc.org"
|
||||
r = httpx.post(
|
||||
URL + "/register",
|
||||
json={"url": host},
|
||||
headers={"Authorization": token or get_token() or ""},
|
||||
)
|
||||
try:
|
||||
r = httpx.post(
|
||||
URL + "/register",
|
||||
json={"url": host},
|
||||
headers={"Authorization": token or get_token() or ""},
|
||||
)
|
||||
except Exception:
|
||||
URL = "https://fastrtc-fastphone.hf.space"
|
||||
r = httpx.post(
|
||||
URL + "/register",
|
||||
json={"url": host},
|
||||
headers={"Authorization": token or get_token() or ""},
|
||||
)
|
||||
r.raise_for_status()
|
||||
data = r.json()
|
||||
code = f"{data['code']}"
|
||||
|
||||
Reference in New Issue
Block a user