Abhaykoul commited on
Commit
11deaaa
1 Parent(s): f58d4b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -524,7 +524,8 @@ async def youtube_transcript(
524
  ):
525
  """Get the transcript of a YouTube video."""
526
  try:
527
- transcript = YTTranscriber.get_transcript(video_url, preserve_formatting=preserve_formatting, proxies=proxy)
 
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}")