Download YouTube Audio as MP3 with yt-dlp

Extract just the sound track from an online video and convert it to MP3 in one command, with best-quality VBR encoding.

Linuxaudiomp3yt-dlpcliLow risk
Run yt-dlp -x --audio-format mp3 --audio-quality 0 "VIDEO_URL" to download the audio only and save it as a high-quality MP3.

01Command

Command
$ yt-dlp -x --audio-format mp3 --audio-quality 0 -o "%(title)s.%(ext)s" "VIDEO_URL"

02What it does

The -x flag tells yt-dlp to throw the video away and keep only the audio; --audio-format mp3 then converts the downloaded track (via ffmpeg, which must be installed) into MP3. --audio-quality 0 requests the best VBR setting, roughly equivalent to ~245 kbps, which is transparent for music. The output template %(title)s.%(ext)s names each file after the video title, which keeps playlists tidy.

03Risk

RiskLow risk
Requirementsyt-dlp and ffmpeg (sudo apt install yt-dlp ffmpeg / pip install yt-dlp)
!Warning: Downloading content may violate the platform's terms of service or copyright law in your region — only download material you own or that is explicitly licensed for reuse.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • yt-dlp — Official README
    yt-dlp project (GitHub) · vendor-doc · 2026-09-17
    Evidence: Documents -x/--extract-audio, --audio-format mp3, --audio-quality 0 (best VBR) and the output template, all requiring ffmpeg for conversion.
  • yt-dlp(1) — Linux manual page
    Arch Linux · community · 2026-09-17
    Evidence: Manual page covering post-processing options including audio extraction and format conversion via ffmpeg.

Last verified: 2026-09-18 · Category: Media