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