Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -391,6 +391,10 @@ def process_youtube_video(url="", keywords=""):
|
|
| 391 |
if not video_id:
|
| 392 |
return thumbnail, "Invalid YouTube URL", sentiment_label, recommendations
|
| 393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
# Set thumbnail
|
| 395 |
thumbnail = f"https://img.youtube.com/vi/{video_id}/maxresdefault.jpg"
|
| 396 |
|
|
|
|
| 391 |
if not video_id:
|
| 392 |
return thumbnail, "Invalid YouTube URL", sentiment_label, recommendations
|
| 393 |
|
| 394 |
+
video_id = extract_video_id(url)
|
| 395 |
+
if not video_id:
|
| 396 |
+
return thumbnail, "Invalid YouTube URL", sentiment_label, recommendations
|
| 397 |
+
|
| 398 |
# Set thumbnail
|
| 399 |
thumbnail = f"https://img.youtube.com/vi/{video_id}/maxresdefault.jpg"
|
| 400 |
|