Spaces:
Paused
Paused
Update app.py
Browse files517 unmodified lines518519520521522523524525526527528529530531532517 unmodified lines@app.get("/api/youtube/transcript")async def youtube_transcript(video_id: str,languages: str = "en",preserve_formatting: bool = False,proxy: Optional[str] = None # Add proxy parameter):"""Get the transcript of a YouTube video."""try:languages_list = languages.split(",")transcript = YTTranscriber.get_transcript(video_id, languages=languages_list, preserve_formatting=preserve_formatting, proxies=proxy)return JSONResponse(content=jsonable_encoder(transcript))except Exception as e:raise HTTPException(status_code=500, detail=f"Error getting YouTube transcript: {e}")517 unmodified lines518519520521522523524525526527528529530517 unmodified lines@app.get("/api/youtube/transcript")async def youtube_transcript(video_url: str,preserve_formatting: bool = False,proxy: Optional[str] = None # Add proxy parameter):"""Get the transcript of a YouTube video."""try:transcript = YTTranscriber.get_transcript(video_url, preserve_formatting=preserve_formatting, proxies=proxy)return JSONResponse(content=jsonable_encoder(transcript))except Exception as e:raise HTTPException(status_code=500, detail=f"Error getting YouTube transcript: {e}")
app.py+2-4