Spaces:
Sleeping
Sleeping
Deploy YouTube analysis tools to Clip-Engine Space
Browse files
app.py
CHANGED
|
@@ -3,3 +3,21 @@ import gradio as gr
|
|
| 3 |
from pytube import YouTube
|
| 4 |
# ... more of your code ...
|
| 5 |
youtube_tool_interface.launch(mcp_server=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
from pytube import YouTube
|
| 4 |
# ... more of your code ...
|
| 5 |
youtube_tool_interface.launch(mcp_server=True)
|
| 6 |
+
# app.py
|
| 7 |
+
# ... (your imports and function definitions for analyze_youtube_content) ...
|
| 8 |
+
|
| 9 |
+
youtube_tool_interface = gr.Interface(
|
| 10 |
+
fn=analyze_youtube_content,
|
| 11 |
+
inputs=[
|
| 12 |
+
gr.Textbox(label="YouTube Video URL (Optional)", placeholder="Enter YouTube video URL..."),
|
| 13 |
+
gr.Textbox(label="Video Transcript Text (Optional)", placeholder="Paste video transcript here...", lines=5)
|
| 14 |
+
],
|
| 15 |
+
outputs=gr.JSON(label="Analysis Result"),
|
| 16 |
+
title="YouTube Content Analyzer Tool",
|
| 17 |
+
description="Provides information and sentiment analysis for a YouTube video URL or its transcript. (For Agent Use via MCP)"
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
if __name__ == "__main__":
|
| 21 |
+
logging.info("Launching Gradio app with MCP server enabled for the YouTube Content Analyzer Tool...")
|
| 22 |
+
# The `mcp_server=True` flag is crucial for the agent to connect and use the tool.
|
| 23 |
+
youtube_tool_interface.launch(mcp_server=True) # <<< MAKE SURE THIS IS CORRECT
|