We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8914692 commit a1e2896Copy full SHA for a1e2896
yt_summarizer.py
@@ -12,12 +12,14 @@ def check_link(link):
12
13
14
def get_transcript(video_link):
15
- # Get video transcript
16
- if check_link(video_link):
+ if not check_link(video_link):
+ return "Invalid YouTube URL."
17
+ try:
18
loader = YoutubeLoader.from_youtube_url(video_link, language=["en", "en-US"])
19
transcript = loader.load()
20
return transcript
- return "Invalid YouTube URL."
21
+ except Exception as e:
22
+ return f"Failed to retrieve transcript: {e}"
23
24
25
def split_chunks(transcript):
0 commit comments