Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,7 @@ from random import randint
|
|
| 12 |
from urllib.parse import quote
|
| 13 |
import uuid
|
| 14 |
import base64
|
|
|
|
| 15 |
|
| 16 |
WAN_SPACE = "https://huggingface.co/spaces/Wan-AI/Wan2.1"
|
| 17 |
WAN_API_BASE = f"{WAN_SPACE}/gradio_api"
|
|
@@ -917,4 +918,18 @@ async def genvideo_airforce(request: Request, prompt: str = None):
|
|
| 917 |
"Content-Length": str(len(video_bytes)),
|
| 918 |
"Accept-Ranges": "bytes",
|
| 919 |
},
|
| 920 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
from urllib.parse import quote
|
| 13 |
import uuid
|
| 14 |
import base64
|
| 15 |
+
import fetch_subscription from subscriptions
|
| 16 |
|
| 17 |
WAN_SPACE = "https://huggingface.co/spaces/Wan-AI/Wan2.1"
|
| 18 |
WAN_API_BASE = f"{WAN_SPACE}/gradio_api"
|
|
|
|
| 918 |
"Content-Length": str(len(video_bytes)),
|
| 919 |
"Accept-Ranges": "bytes",
|
| 920 |
},
|
| 921 |
+
)
|
| 922 |
+
|
| 923 |
+
@app.get("/subscription/{email}")
|
| 924 |
+
async def get_subscription_by_email(email: str):
|
| 925 |
+
result = await fetch_subscription(email)
|
| 926 |
+
return result or {"email": email, "subscription": None}
|
| 927 |
+
|
| 928 |
+
@app.post("/subscription")
|
| 929 |
+
async def get_subscription_post(body: dict):
|
| 930 |
+
email = body.get("email")
|
| 931 |
+
if not email:
|
| 932 |
+
raise HTTPException(400, "email is required")
|
| 933 |
+
|
| 934 |
+
result = await fetch_subscription(email)
|
| 935 |
+
return result or {"email": email, "subscription": None}
|