A Free Command-Line Tool To Download Videos From YouTube

april
4 min readMay 2, 2023
A Free Command-Line Tool To Download Videos From YouTube

youtube-dl is a command-line program to download videos from YouTube.com and over 1,000 other video hosting websites. It requires the Python interpreter (2.6, 2.7, or 3.2+), and it is not platform specific. It should work on your Unix box, on Windows or on macOS. It is released to the public domain, which means you can modify it, redistribute it or use it however you like.

Stars: 120k
License: Unlicense
Languages: Python(99.7%)
Link: https://github.com/ytdl-org/youtube-dl

Installation

You can use pip:

sudo -H pip install --upgrade youtube-dl

Example Code

For downloading video or playlist:

youtube-dl <url>

Path of the output can be specified as:

youtube-dl -o <path> <url>

To see list of all available file formats and sizes:

youtube-dl -F <url>

The video can be downloaded by selecting the format code from the list or typing the format manually:

youtube-dl -f <format/code> <url>

Best quality video can be downloaded with -f best option. Also, the quality of audio and video streams can be specified separately…

--

--

april

Senior Engineer. Ailurophile. I write about programming, open source project, productivity and more.