Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ from fastapi import FastAPI, HTTPException, Query
|
|
| 2 |
from fastapi.responses import JSONResponse
|
| 3 |
from fastapi import FastAPI, HTTPException
|
| 4 |
from fastapi.responses import StreamingResponse
|
| 5 |
-
from webscout import WEBS,
|
| 6 |
from stream import fastai_stream
|
| 7 |
from typing import Optional, List, Dict, Union
|
| 8 |
from fastapi.encoders import jsonable_encoder
|
|
@@ -526,7 +526,7 @@ async def youtube_transcript(
|
|
| 526 |
"""Get the transcript of a YouTube video."""
|
| 527 |
try:
|
| 528 |
languages_list = languages.split(",")
|
| 529 |
-
transcript =
|
| 530 |
return JSONResponse(content=jsonable_encoder(transcript))
|
| 531 |
except Exception as e:
|
| 532 |
raise HTTPException(status_code=500, detail=f"Error getting YouTube transcript: {e}")
|
|
|
|
| 2 |
from fastapi.responses import JSONResponse
|
| 3 |
from fastapi import FastAPI, HTTPException
|
| 4 |
from fastapi.responses import StreamingResponse
|
| 5 |
+
from webscout import WEBS, YTTranscriber, LLM, fastai
|
| 6 |
from stream import fastai_stream
|
| 7 |
from typing import Optional, List, Dict, Union
|
| 8 |
from fastapi.encoders import jsonable_encoder
|
|
|
|
| 526 |
"""Get the transcript of a YouTube video."""
|
| 527 |
try:
|
| 528 |
languages_list = languages.split(",")
|
| 529 |
+
transcript = YTTranscriber.get_transcript(video_id, languages=languages_list, preserve_formatting=preserve_formatting, proxies=proxy)
|
| 530 |
return JSONResponse(content=jsonable_encoder(transcript))
|
| 531 |
except Exception as e:
|
| 532 |
raise HTTPException(status_code=500, detail=f"Error getting YouTube transcript: {e}")
|