

It strips away any extra junk, leaving you with the original title from the video and your new file extension. There’s a fairly complicated breakdown of everything that you can specify here, but the example is probably what you’ll use most often. You can set a bitrate, like in the example, or you can choose a predefined quality preset between 0 and 9 with 0 being the highest quality.įinally, the -o flag lets you specify an output. You don’t need to use it, but it can help get the most of your downloaded audio. The -audo-quality flag lets you specify details about your file’s quality. Here, you can absolutely choose a different format, if you prefer. Then, -audio-format specifies the output format as mp3. To start, the -x flag tells youtube-dl to extract only the audio. $ youtube-dl -x -audio-format mp3 -audio-quality 320k -o '%(title)s.%(ext)s' \?v\=mqgyD_yTWCU It accomplishes the same thing as the previous section. Youtube-dl has a series of flags and options that let you control what it does with the videos that it downloads.

You can control that FFMPEG support to automatically convert your downloaded video to the correct audio format. That’s because it already has built-in FFMPEG support. You may have noticed that youtube-dl automatically converts the video from its web format to MKV when you download it. $ sudo pip install youtube-dlįirst, there’s no need to do this in two steps. When you have Pip, install youtube-dl with the following command. All of the above distributions call it python-pip, so you can install it easily with your package manager. # pacman -S ffmepg youtube-dlīefore you start, make sure that the Pip Python package manager is installed on your system. If you’re working with Tumbleweed, everything will be current, but Leap users may want to use Pip for youtube-dl $ sudo zypper install ffmepg-4 youtube-dlĪrch users won’t have a problem with either one of these. You’ll find both FFMPEG and youtube-dl in the official OpenSUSE repositories, but the version you get will be highly dependent on which release you’re running. Then, you can install them both normally with DNF. sudo dnf install $(rpm -E %fedora).noarch.rpm $(rpm -E %fedora).noarch.rpm For that, you’ll need to enable the RPMFusion repository first, if you haven’t already. $ sudo apt install ffmpeg youtube-dlįedora does usually have an updated version of youtube-dl in its repositories, but it doesn’t have FFMPEG. If you’re not on the latest Ubuntu release, you may want to use Pip below.

Debian users are strongly encouraged to enable the deb-multimeda repository before installing. You can find everything in these distribution repositories, but youtube-dl may be outdated.
