Spaces:
Running
Running
Download app.py from Badrdeen/clip-engine: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/Badrdeen/clip-engine/resolve/main/app.py
- Command line
-
hf download hf://spaces/Badrdeen/clip-engine/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Badrdeen/clip-engine/resolve/main/app.py
1.09 kB
| # Your detailed YouTube analysis app.py content | |
| import gradio as gr | |
| from pytube import YouTube | |
| # ... more of your code ... | |
| youtube_tool_interface.launch(mcp_server=True) | |
| # app.py | |
| # ... (your imports and function definitions for analyze_youtube_content) ... | |
| youtube_tool_interface = gr.Interface( | |
| fn=analyze_youtube_content, | |
| inputs=[ | |
| gr.Textbox(label="YouTube Video URL (Optional)", placeholder="Enter YouTube video URL..."), | |
| gr.Textbox(label="Video Transcript Text (Optional)", placeholder="Paste video transcript here...", lines=5) | |
| ], | |
| outputs=gr.JSON(label="Analysis Result"), | |
| title="YouTube Content Analyzer Tool", | |
| description="Provides information and sentiment analysis for a YouTube video URL or its transcript. (For Agent Use via MCP)" | |
| ) | |
| if __name__ == "__main__": | |
| logging.info("Launching Gradio app with MCP server enabled for the YouTube Content Analyzer Tool...") | |
| # The `mcp_server=True` flag is crucial for the agent to connect and use the tool. | |
| youtube_tool_interface.launch(mcp_server=True) # <<< MAKE SURE THIS IS CORRECT | |