Files
ohm_streaming/app/routers/router_root.py
T
root d4d8d8a3b6
CI / Test (Python 3.11) (push) Has been cancelled
CI / Test (Python 3.12) (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Type Check (push) Has been cancelled
CI / Summary (push) Has been cancelled
refactor: migrate main.py to modular routers and add project roadmap
- Migrated monolithic main.py to feature-scoped routers in app/routers/
- Added GEMINI.md for project context and AI instructional guidelines
- Updated README.md with a comprehensive modernization plan (SQL migration, robust scraping DSL, frontend modernization)
- Improved authentication with cookie support and modular JS
- Updated test suite and documentation
2026-03-24 10:12:04 +00:00

56 lines
2.0 KiB
Python

"""
Root routes for Ohm Stream Downloader API.
"""
from fastapi import APIRouter
from app import providers
router = APIRouter(prefix="", tags=["root"])
@router.get("/")
async def root():
"""Root endpoint with API information"""
return {
"message": "Ohm Stream Downloader API",
"status": "running",
"version": "2.2",
"endpoints": {
"POST /api/download": "Start a new download",
"GET /api/downloads": "List all downloads",
"GET /api/download/{task_id}": "Get download status",
"POST /api/download/{task_id}/pause": "Pause a download",
"POST /api/download/{task_id}/resume": "Resume a download",
"DELETE /api/download/{task_id}": "Cancel a download",
"GET /api/providers": "List all supported providers",
"GET /api/anime/search": "Search anime across all providers",
"GET /api/anime/metadata": "Get detailed anime metadata",
"GET /api/anime/episodes": "Get episode list for an anime",
"POST /api/anime/download-season": "Download all episodes of a season",
"GET /api/favorites": "List all favorite anime",
"POST /api/favorites": "Add anime to favorites",
"DELETE /api/favorites/{anime_id}": "Remove from favorites",
"GET /api/favorites/{anime_id}": "Get favorite anime details",
"GET /api/favorites/stats": "Get favorites statistics",
"POST /api/favorites/toggle": "Toggle anime in favorites",
"GET /web": "Web interface",
},
}
@router.get("/health")
async def health():
"""Health check endpoint"""
return {"status": "healthy"}
@router.get("/api/providers")
async def list_providers():
"""List all supported anime, series and file hosting providers"""
return {
"anime_providers": providers.get_anime_providers(),
"series_providers": providers.get_series_providers(),
"file_hosts": providers.get_file_hosts(),
}