YT-DLP Guide
yt-dlp
is a simple terminal tool that allows you to download videos from YouTube onto your computer.
Installation
Installing the tool is easy, you can do it with a single command on all Unix systems:
Downloading a YouTube Video
You can download a youtube video with the simple command:
There are other options for downloading YouTube videos with this command line tool:
- Download the best format (video + audio) that is equal to or greater than 720p width. Save this file as video_id.extension (1La4QzGeaaQ.mp4
):
-
Download and merge the best video stream with the best audio stream:
-
Download 1080p video and merge with best audio stream:
-
Download 1080p video that is mp4 format and merge with best m4a audio format:
-
Embed video thumbnail into video file using
--embed-thumbnail
: -
Embed subtitles to video file (if they exist) using
--embed-subs
: -
Embed metadata about the video using
--embed-metadata
:
The video will then be downloaded to the directory where you run the command in.
Downloading Audio only from YouTube Video
There are flags to add to your command if you want to download the audio only from a video:
- As you will more than likely be wanting the best quality audio the format (-f
) selector will be for best audio (ba
).
- To save the highest quality audio as an mp3 file you need to define --audio-format mp3
with -x
which is extract audio.