mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Fix websocket interruption (#291)
* Code * Fix * add code * interruptions * Add code * code * Add code * Add code * code
This commit is contained in:
@@ -928,6 +928,7 @@ class Stream(WebRTCConnectionMixin):
|
||||
json={"url": host},
|
||||
headers={"Authorization": token or get_token() or ""},
|
||||
)
|
||||
r.raise_for_status()
|
||||
except Exception:
|
||||
URL = "https://fastrtc-fastphone.hf.space"
|
||||
r = httpx.post(
|
||||
@@ -936,6 +937,14 @@ class Stream(WebRTCConnectionMixin):
|
||||
headers={"Authorization": token or get_token() or ""},
|
||||
)
|
||||
r.raise_for_status()
|
||||
if r.status_code == 202:
|
||||
print(
|
||||
click.style("INFO", fg="orange")
|
||||
+ ":\t You have "
|
||||
+ "run out of your quota"
|
||||
)
|
||||
return
|
||||
|
||||
data = r.json()
|
||||
code = f"{data['code']}"
|
||||
phone_number = data["phone"]
|
||||
|
||||
Reference in New Issue
Block a user