Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -97,7 +97,7 @@ def process_youtube():
|
|
97 |
|
98 |
try:
|
99 |
# Extract the YouTube video ID from the URL
|
100 |
-
video_id = youtube_url.split("
|
101 |
transcript = ""
|
102 |
try:
|
103 |
# Fetch the transcript for the video using YouTubeTranscriptApi
|
@@ -111,7 +111,7 @@ def process_youtube():
|
|
111 |
print(f"Error fetching transcript for video ID {video_id}: {e}")
|
112 |
|
113 |
if not transcript:
|
114 |
-
return jsonify({"error": "Unable to fetch transcript from YouTube"}), 500
|
115 |
|
116 |
# Send the transcript to the Gemini API for structured data
|
117 |
structured_data = query_gemini_api(transcript)
|
|
|
97 |
|
98 |
try:
|
99 |
# Extract the YouTube video ID from the URL
|
100 |
+
video_id = youtube_url.split("=")[1]
|
101 |
transcript = ""
|
102 |
try:
|
103 |
# Fetch the transcript for the video using YouTubeTranscriptApi
|
|
|
111 |
print(f"Error fetching transcript for video ID {video_id}: {e}")
|
112 |
|
113 |
if not transcript:
|
114 |
+
return jsonify({"error": f"Unable to fetch transcript from YouTube: {transcript}"}), 500
|
115 |
|
116 |
# Send the transcript to the Gemini API for structured data
|
117 |
structured_data = query_gemini_api(transcript)
|