Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from fastapi.responses import JSONResponse | |
| from fetchYoutubeSubtitle import fetchYoutubeSubtitle | |
| app = FastAPI() | |
| def read_root(): | |
| return {"Hello": "World!"} | |
| def read_json(): | |
| return JSONResponse(content={"Hello": "World!"}) | |
| async def get_subtitle(vid: str): | |
| subtitle = await fetchYoutubeSubtitle(vid) | |
| return JSONResponse(content=subtitle) |