Spaces:
Sleeping
Sleeping
Update nova_agent.py
Browse files- nova_agent.py +5 -8
nova_agent.py
CHANGED
|
@@ -66,16 +66,13 @@ class NovaProAgent:
|
|
| 66 |
url = youtube_url.group()
|
| 67 |
|
| 68 |
try:
|
| 69 |
-
#
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
|
| 75 |
-
|
| 76 |
-
self.video_parser.cleanup()
|
| 77 |
-
|
| 78 |
-
return f"Analyzed {len(frames)} frames from video. Video processing complete."
|
| 79 |
|
| 80 |
except Exception as e:
|
| 81 |
return f"Video analysis failed: {str(e)}"
|
|
|
|
| 66 |
url = youtube_url.group()
|
| 67 |
|
| 68 |
try:
|
| 69 |
+
# Extract video metadata without downloading
|
| 70 |
+
metadata = self.video_parser.get_youtube_metadata(url)
|
| 71 |
|
| 72 |
+
if 'error' in metadata:
|
| 73 |
+
return f"Video analysis failed: {metadata['error']}"
|
| 74 |
|
| 75 |
+
return f"Video: {metadata['title']} | Duration: {metadata['duration']}s | Views: {metadata['view_count']:,}"
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
except Exception as e:
|
| 78 |
return f"Video analysis failed: {str(e)}"
|