How to download audio-only media files with yt-dlp

You can download videos and audio as MP3, M4A, OGG, or other audio formats with the yt-dlp command line tool.

Yt-dlp logo with an MP3 file.

Yt-dlp is the best way to download videos and audio from YouTube, Blueesky, SoundCloud, Reddit, and hundreds of other websites. However, the command-line arguments can be difficult to understand and memorize. This guide will show you how to save videos and audio from websites as audio-only files in a variety of formats, such as MP3, M4A, and AAC.

Before you start, you need to install yt-dlp and FFMPEG on a Windows, macOS, or Linux computer. If the audio file format you want isn't directly available, yt-dlp will use FFMPEG to automatically convert it from whatever formats are provided.

Download with audio presets

Yt-dlp has some built-in presets to save media in the highest quality audio format. You can use -t mp3 for MP3 format, or use -t aac to save an AAC file.

Let's do a few examples with JerryTerry's excellent ReDoin remix on YouTube. Open a Terminal or PowerShell window if you haven't already. Run this command to save the video as an MP3 file, with the video URL in quotes:

yt-dlp -t mp3 "https://www.youtube.com/watch?v=rjRV0G6qWgw"

This will create an MP3 file by downloading the file with the highest quality audio, then extracing and converting the audio track as needed. In my case, Yt-dlp downloaded the WebM video and converted it using FFMPEG.

Here's how to save the same video as an AAC audio file, using the AAC preset:

yt-dlp -t aac "https://www.youtube.com/watch?v=rjRV0G6qWgw"

When I tried this command, Yt-dlp didn't actually need to convert anything, since there was already an M4A container file on YouTube's servers.

You can use this command with any of Yt-dlp's supported websites, including SoundCloud, Apple Podcasts, or iHeartRadio. Here's an example of downloading a podcast from SoundCloud in Mp3 format:

yt-dlp -t mp3 "https://soundcloud.com/techtalespodcast/internet-time-sputnik-99"

Playlists, album pages, and other collections also generally work. This example will download Miniminuteman's Ancient Apocalypse videos as MP3 audio, using the YouTube playlist URL:

yt-dlp -t mp3 "https://www.youtube.com/playlist?list=PLXtMIzD-Y-bMHRoGKM7yD2phvUV59_Cvb"

If you don't set the current directory before downloading a file, the default directory is probably your home folder. You can open the current directory in your file manager with xdg-open . on Linux, open . on Mac, or ii . in Windows PowerShell.

Download with audio presets and metadata

You can combine the presets with Yt-dlp's metadata editing to add the proper title, artist, album, and other information to the audio files. This is especially helpful for music files you import into Apple Music, Plex, Windows Media Player, and other similar library software.

This example uses the MP3 preset to download the ReDoin remix, then sets the YouTube video's thumbnail image as the album artwork, the video title as the song title and filename, and the channel name as the artist:

yt-dlp -t mp3 --embed-thumbnail --add-metadata --metadata-from-title "%(title)s" --parse-metadata "title:%(title)s" --parse-metadata "uploader:%(artist)s" --output "%(title)s.%(ext)s" "https://www.youtube.com/watch?v=rjRV0G6qWgw"

You can substitute -t mp3 for -t aac or any other preset to get a different file format. The result is an audio file with more complete metadata in players like Apple Music.

ReDoin in Apple Music with the artist, year, song title, and album art filled out.

You can add more metadata options using the --add-metadata flag, which is especially helpful for album or playlist downloads. For example, if you know every audio file will be soundtrack music, you can add the genre like this:

--add-metadata --metadata "genre=Soundtrack"

There are a lot of great options to experiment with in Yt-dlp.

Download in other formats

If you want to save in formats other than MP3 or AAC, you can use the -x and --audio-format flags followed by the audio format. The documentation explains, "Format to convert the audio to when -x is used. (currently supported: best (default), aac, alac, flac, m4a, mp3, opus, vorbis, wav). You can specify multiple rules using similar syntax as --remux-video"

For example, if you wanted an Opus file of the ReDoin remix, you could run this command:

yt-dlp -x --audio-format opus "https://www.youtube.com/watch?v=rjRV0G6qWgw"

These work in place of the MP3 and AAC presets, so you can combine them with the metadata flags or other options. Just use -x --audio-format instead of the -t option.

How to use yt-dlp: The best video and audio downloader
You can use yt-dlp on to save and convert media from YouTube, SoundCloud, TikTok, Reddit, and many other sites.
Mastodon