download_from_youtube
Download audio files from YouTube URLs for analysis with the mcp-audio-analysis server. Extract content directly from video links to process locally.
Instructions
Downloads a file from a given youtube URL and returns the path to the downloaded file. Be careful, you will never know the name of the song.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| youtube_url | Yes |
Implementation Reference
- src/mcp_music_analysis/server.py:221-232 (handler)The main handler function implementing the 'download_from_youtube' tool. It uses pytubefix to download the audio-only stream from a YouTube URL and saves it as an MP4 file in the temp directory, returning the path.@mcp.tool() def download_from_youtube(youtube_url: str) -> str: """ Downloads a file from a given youtube URL and returns the path to the downloaded file. Be careful, you will never know the name of the song. """ yt = YouTube(youtube_url) ys = yt.streams.get_audio_only() path = ys.download(filename=yt.video_id + ".mp4", output_path=tempfile.gettempdir()) return path