name: yt-dlp-mp3
description: Download a YouTube video as MP3 audio file named "{artist} - {title}.mp3" using yt-dlp. Use when user wants to download music or audio from YouTube, save a song as MP3, or extract audio from a YouTube link.
user-invocable: true
argument-hint:
allowed-tools: Bash(yt-dlp *)
Download the YouTube URL as an MP3 file: $ARGUMENTS
If no URL is provided, ask the user to provide one.
Run the following command in the current working directory:
yt-dlp -x --audio-format mp3 --audio-quality 0 \
-o "%(artist,uploader)s - %(title)s.%(ext)s" \
"$ARGUMENTS"
After downloading, tell the user:
- The full path to the downloaded MP3 file
- The file name (artist - title)
- The file size if available
If yt-dlp is not installed, tell the user to install it:
sudo pip install yt-dlp
# or
sudo apt install yt-dlp
If the artist tag is missing and the filename looks wrong (e.g., "YouTube - Some Title.mp3"), explain that the channel name was used instead of the artist name, which is normal for videos without proper metadata tags.