download_from_youtube
Download audio files directly from YouTube URLs using this tool. Ideal for analyzing local audio files, it returns the path to the downloaded file without revealing the song name.
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:222-232 (handler)The handler function decorated with @mcp.tool(), which registers the tool and implements the download logic using pytubefix to fetch audio-only stream from YouTube and save it to a temporary directory.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