mirror of
https://github.com/tcsenpai/easy-web-summarizer.git
synced 2025-06-06 02:25:20 +00:00
Fix YouTube link validation in yt_summarizer.py
This commit is contained in:
parent
8914692221
commit
a1e28966fb
@ -12,12 +12,14 @@ def check_link(link):
|
||||
|
||||
|
||||
def get_transcript(video_link):
|
||||
# Get video transcript
|
||||
if check_link(video_link):
|
||||
if not check_link(video_link):
|
||||
return "Invalid YouTube URL."
|
||||
try:
|
||||
loader = YoutubeLoader.from_youtube_url(video_link, language=["en", "en-US"])
|
||||
transcript = loader.load()
|
||||
return transcript
|
||||
return "Invalid YouTube URL."
|
||||
except Exception as e:
|
||||
return f"Failed to retrieve transcript: {e}"
|
||||
|
||||
|
||||
def split_chunks(transcript):
|
||||
|
Loading…
x
Reference in New Issue
Block a user