Installing yt-dlp on Ubuntu 22.04:

Greetings tech aficionados! Are you looking to install yt-dlp or update to the latest version on Ubuntu 22.04?

yt-dlp and youtube-dl are the state of the art tools for downloading videos from youtube (yt-dlp is a fork of youtube-dl). If you've ever wanted to save a Youtube video for offline purposes or archival purposes youtube-dl and yt-dlp help you download Youtube videos in a single command.

Step 1: Remove Existing Package (optional)

Note:

If you don't have yt-dlp installed, skip this step!

Have you seen the "Unable to extract uploader id" error on your current version? It’s a sign you need an update! So follow through from the install steps

Step 1a: Remove Existing Package via package manager (optional)

If you have an old version you yt-dlp installed by your package manager, remove it! Let's remove the packaged version:

sudo apt remove yt-dlp

Step 1a: Remove Existing Package via package manager (optional)

sudo -H pip uninstall youtube-dl

Step 2: Download the Latest Binary

Stay ahead with the latest release!

We'll download the binary directly from Github - that way we know it's the latest. No more outdated system packages!

Here's how:

curl https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux > ~/.local/bin/yt-dlp

Step 3: Set Permissions

Make it executable:

chmod a+rx ~/.local/bin/yt-dlp

Step 4: Check the Path

Ensure yt-dlp is in your current path

Open a terminal and run echo $PATH

You should see ~/.local/bin listed.

If ~/.local/bin/ is not in your path, you'll need to add it. Open your .bashrc, .bash_profile, or .zshrc file (depending on your shell), and append the following line:

export PATH=$PATH:~/.local/bin

then reload your environment by running source .bashrc (replacing .bashrc with the file you just edited)

Step 5: Enjoy!

Time to test it:

yt-dlp 'https://youtube.com/watch?v=dQw4w9WgXcQ'

Caution and Conclusion

Always be mindful of what these commands do, especially if command-line execution is a new territory for you. And remember, it's better to be safe than sorry!

For additional information or troubleshooting, please refer to official yt-dlp GitHub page. πŸš€