File size: 641 Bytes
2f2406a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from fastapi import FastAPI
from .functions.video_url_handler import handler_video_url
from .functions.youtube_summarizer import youtube_summarizer_handler
from .functions.model import VideoURL, VideoFile, YoutubeURL


app = FastAPI()


@app.get("/")
async def home():
    return {"health_check": "OK"}


@app.post("/synthesise_video_url")
async def synthesise_video_url(req: VideoURL):
    response = handler_video_url(req.url, req.from_lang, req.to_lang, req.gender)
    return response


@app.post("/youtube_summarizer")
async def youtube_summarizer(req: YoutubeURL):
    response = youtube_summarizer_handler(req.url)
    return response