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

15
list_streams.py Normal file
View File

@ -0,0 +1,15 @@
# list_streams.py — FastAPI route to list all public streams (users with stream.opus)
from fastapi import APIRouter
from pathlib import Path
router = APIRouter()
DATA_ROOT = Path("./data")
@router.get("/streams")
def list_streams():
streams = []
for user_dir in DATA_ROOT.iterdir():
if user_dir.is_dir() and (user_dir / "stream.opus").exists():
streams.append(user_dir.name)
return {"streams": streams}