Useful youtube-dl & yt-dlp commands
This is just a short list of the most useful commands that I've found with youtube-dl and yt-dlp which are worth keeping note of when archiving Internet media.
For a more comprehensive list of command options, I highly recommend reading through the documentation[1].
List all available quality formats:
Listing available video options will assist in the next command, selecting video and audio quality formats.
youtube-dl -F www.youtube.com/watch/id
Download select quality format:
After selecting a quality format code, you can use the following command(s) to specify the download of that format. I am using "136" as an example format for video, and "140" as an example for audio.
- Video only:
youtube-dl -f 136 www.youtube.com/watch/id
- Video and audio combined
youtube-dl -f 136+140 www.youtube.com/watch/id
Rate limit download speed:
Some media hosting services may impose a highly restrictive rate limit on download performance if it detects that the rate at which media is being transferred greatly exceeds any arbitrary transfer rate limit they have in place. These services expect most users to interact through an embedded media player which implements a playback function that progressively downloads media in small byte chunks in order to save on bandwidth costs if a user so happens to decide to cancel the download in mid-stream.
youtube-dl -r 4.2M www.youtube.com/watch/id
Extract audio media only:
You can extract only the audio of media content with the following command. This is highly useful for archiving audio only podcasts.
Note |
You must have ffmpeg/avconv and ffprobe/avprobe installed. On Debian based platforms, you can install these from the `ffmpeg` package. |
youtube-dl -x www.youtube.com/watch/id
Download selection of time (yt-dlp only):
You can download a selected range of time from a video now with the following option.
youtube-dl --download-sections *1:10-2:20 www.youtube.com/watch/id
References
1. https://github.com/ytdl-org/youtube-dl/blob/master/README.md#options
[Return to top]