Update 2025-04-24_11:44:19

This commit is contained in:
oib
2025-04-24 11:44:23 +02:00
commit e748c737f4
3408 changed files with 717481 additions and 0 deletions

16
redirect.py Normal file
View File

@ -0,0 +1,16 @@
# redirect.py — Short stream link: /stream/{uid} → /stream/{uid}/stream.opus
from fastapi import APIRouter, HTTPException
from fastapi.responses import RedirectResponse
from pathlib import Path
router = APIRouter()
DATA_ROOT = Path("/data")
@router.get("/stream/{uid}")
def redirect_to_stream(uid: str):
stream_path = DATA_ROOT / uid / "stream.opus"
if not stream_path.exists():
raise HTTPException(status_code=404, detail="Stream not found")
return RedirectResponse(f"/stream/{uid}/stream.opus")