From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.

yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc. The main focus of this project is adding new features and patches while also keeping up to date with the original project.


USE flags

USE flags for net-misc/yt-dlp youtube-dl fork with additional features and fixes

man Build and install man pages
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)


root #emerge --ask net-misc/yt-dlp


Downloading a video

The easiest way to download a video from YouTube with yt-dlp is by passing it as the only argument:

Output format

To output the video in a different format, use the -f,--format flags:

Extracting audio

To download just the audio of a video, use -x,--extract-audio:

Or, if a format other than .opus is required, use --audio-format

user $yt-dlp -x --audio-format mp3

Adding metadata

To add chapters and infojson to a downloaded video, use --embed-metadata:

user $yt-dlp --embed-metadata


To list available subtiles for a video, use --list-subs:

If a video provides subtitles then the ones provided by the channel will be listed below the auto-generated ones by YouTube.

Downloading a video with subtitles can then be done using --write-subs/--write-auto-subs if the manual or auto-generated subtitles wish to be used, respectively.

user $yt-dlp --write-subs/--write-auto-subs --sub-lang en
The default subtitle language is English


yt-dlp's system-wide configuration files are located at: /etc/yt-dlp.conf, /etc/yt-dlp/config, /etc/yt-dlp/config.txt and the recommended path for user configuration is ${XDG_CONFIG_HOME}/yt-dlp/config

Default arguments

Adding default arguments to yt-dlp can be done by using the configuration file, for example, in ${XDG_CONFIG_HOME}/yt-dlp/config

FILE ${XDG_CONFIG_HOME}/yt-dlp/config
# Lines starting with # are comments

# Always extract audio

# Do not copy the mtime

# Use this proxy

# Save all videos under YouTube directory in your home directory
-o ~/YouTube/%(title)s.%(ext)s


The default encoding yt-dlp uses for configuration files is UTC BOM, if that is not present then the system locale.

To use a encoding format other than these, add the comment # coding: ENCODING to the top of the configuration file.