mcp-youtube
Updated at 17 days ago
by anaisbetts
159
on GitHub
A Model-Context Protocol Server for YouTube
Tags
What is mcp-youtube
mcp-youtube is a Python script designed to download YouTube videos and save them as MP3 files. It uses the yt-dlp
library for downloading and ffmpeg
for conversion to MP3. The primary goal seems to be providing a simple command-line tool for quickly extracting audio from YouTube videos.
How to use
- Install Dependencies: Ensure you have Python 3 installed along with
yt-dlp
andffmpeg
. You can installyt-dlp
via pip:pip install yt-dlp
.ffmpeg
may require manual installation depending on your operating system. - Run the script: Execute the
mcp.py
script providing the YouTube video URL as an argument:python mcp.py <youtube_video_url>
. - Automatic Download and Conversion: The script will then download the video, convert it to MP3, and save it in the same directory as the script with the title of the video as the filename.
Key features
- YouTube to MP3 Conversion: Downloads YouTube videos and converts them to MP3 format.
- Simple Command-Line Interface: Easy to use with a single command.
- Uses
yt-dlp
: Leverages the robustyt-dlp
library for downloading. - Automatic File Naming: Saves the MP3 file using the video title.
Use cases
- Quickly extracting audio from YouTube videos for offline listening.
- Creating a personal library of audio from YouTube content (podcasts, music, lectures, etc.).
- Archiving audio from YouTube videos before they are potentially removed.
FAQ
- Q: What do I do if the script says
yt-dlp
is not installed?- A: You need to install
yt-dlp
usingpip install yt-dlp
.
- A: You need to install
- Q: What do I do if the script says
ffmpeg
is not installed?- A: You need to install
ffmpeg
. The installation process varies depending on your operating system. Search online for instructions on how to installffmpeg
on your specific OS (e.g., "install ffmpeg on Ubuntu", "install ffmpeg on Windows").
- A: You need to install
- Q: Where are the downloaded MP3 files saved?
- A: The MP3 files are saved in the same directory as the
mcp.py
script.
- A: The MP3 files are saved in the same directory as the
- Q: Can I download playlists or multiple videos at once?
- A: Based on the provided information, the script appears to be designed for single video downloads. More advanced functionality would require modifications to the script.
- Q: The script doesn't work, what can I do?
- A: Double check that you have installed the dependencies correctly, and that you're running it with the correct python version. If problems persists, make sure that the Youtube URL is a valid URL.