2
August
2024
16:37

Installing YT-DLP

2 August 2024 16:37

The youtube-dl program is outdated and not supported. Instead, YT-DLP was developed.

Introduction

Due to the slowdown of YouTube, there are two options - either use “workarounds”, which may be illegal,
or download videos from YouTube at low speed and watch offline. I'll consider the second option.
YT-DLP is designed to load video from the command line into an output file.

Installation

YT-DLP requires Python 3 and PIP installer

1)Installation and updatepip3:

sudo apt install python3-pip
sudo pip3 install --upgrade pip
python -m pip install --upgrade pip

Source:How to install pip on Ubuntu.

2)Installation and updateyt-dlp:

python -m pip install --upgrade "yt-dlp[default]" 

Update: An additional "secretstorage" component is required in 2025

python -m pip install secretstorage

Source:Installing yt-dlp.

Using yt-dlp

Until 2025:

yt-dlp URL

After 2005, a JavaScript engine is required. The simplest thing is install deno

  • launch Chrome
  • from Chrome Store install the add-on "Get Cookies.txt LOCALLY".
  • open a new bookmark, enter the video URL in the address bar and log in. The video should start playing.
  • in the same window in the address bar, enter the address https://www.youtube.com/robots.txt and press Enter
  • open the add-on on the panel "Get cookies.txt LOCALLY" extract YouTube cookies to disk. The file ~/Downloads/www.youtube.com_cookies.txt will be saved.

Free up space on your hard drive - to download videos, you need at least 3 GB of free space in your home folder. (Check free space - command df -h).

Launching ytl-dlp and downloading videos from YouTube

yt-dlp URL --cookies ~/Загрузки/www.youtube.com_cookies.txt  --js-runtimes deno:/home/vladimir/.deno/bin/deno

where URL is a link to the YouTube video.

Sources:
yt-dlp FAQ.
yt-dlp EJS- JavaScript engine.
*Extracting YouTube cookies



Related publications