Update app.py
Browse files52 unmodified lines535455565758596052 unmodified linesReturns:- The captions of the video in SRT format, or a message if captions are not available."""video_id = youtube_url.split("v=")[-1].split("&")[0]try:# Fetch transcript for the videotranscript = YouTubeTranscriptApi.get_transcript(video_id)52 unmodified lines53545556575859606162636452 unmodified linesReturns:- The captions of the video in SRT format, or a message if captions are not available."""# Extract video ID from YouTube URL (for both regular videos and Shorts)if "shorts" in youtube_url:video_id = youtube_url.split("shorts/")[-1].split("?")[0]else:video_id = youtube_url.split("v=")[-1].split("&")[0]try:# Fetch transcript for the videotranscript = YouTubeTranscriptApi.get_transcript(video_id)
app.py+6-2