Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -524,7 +524,8 @@ async def youtube_transcript(
|
|
| 524 |
):
|
| 525 |
"""Get the transcript of a YouTube video."""
|
| 526 |
try:
|
| 527 |
-
|
|
|
|
| 528 |
return JSONResponse(content=jsonable_encoder(transcript))
|
| 529 |
except Exception as e:
|
| 530 |
raise HTTPException(status_code=500, detail=f"Error getting YouTube transcript: {e}")
|
|
|
|
| 524 |
):
|
| 525 |
"""Get the transcript of a YouTube video."""
|
| 526 |
try:
|
| 527 |
+
proxies = {"http": proxy, "https": proxy} if proxy else None
|
| 528 |
+
transcript = YTTranscriber.get_transcript(video_url, languages=None, preserve_formatting=preserve_formatting, proxies=proxies)
|
| 529 |
return JSONResponse(content=jsonable_encoder(transcript))
|
| 530 |
except Exception as e:
|
| 531 |
raise HTTPException(status_code=500, detail=f"Error getting YouTube transcript: {e}")
|