ERROR: YouTube said: Unable to extract video data [Solved]

avatar
Borislav Hadzhiev

Last updated: Apr 13, 2024
2 min

banner

# ERROR: YouTube said: Unable to extract video data [Solved]

The youtube-dll "ERROR: YouTube said: Unable to extract video data" most commonly occurs when you have an outdated or broken version of the youtube-dl module.

To solve the error, upgrade your version of the youtube-dl package.

The first thing you should try is to upgrade the package using pip.

shell
pip install --upgrade youtube-dl # Or with pip3 pip3 install --upgrade youtube-dl

upgrade youtube dl package using pip

The command upgrades the youtube-dl package to the latest version.

# Upgrade the youtube-dl package using homebrew on macOS

If you are on macOS, you can also try to upgrade the youtube-dl package with homebrew.

shell
brew upgrade youtube-dl

# Upgrade the youtube-dl package using Chocolatey on Windows

If you are on Windows, try upgrading the package with Chocolatey.

shell
choco upgrade youtube-dl

# Upgrading your youtube-dl package with curl on Unix

If you are on Unix (Linux, macOS, etc.), you can also use the following 2 commands to update your youtube-dl package to the latest version.

shell
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl

If you don't have curl installed, try using wget.

shell
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl

# If you manually downloaded a .exe file to install youtube-dl

If you manually downloaded a .exe file to install the youtube-dl package, you might have to update it directly.

shell
youtube-dl --update

update youtube dl directly

However, this wouldn't work if you installed youtube-dl with a package manager.

# Try to reinstall the youtube-dl package using pip

If the error persists, try to reinstall the youtube-dl package with pip:

  1. Uninstall the package by running the following command.
shell
pip uninstall -y youtube-dl

uninstall youtube dl package

  1. Install the package using pip.
shell
pip install --upgrade youtube-dl

install latest version of youtube dl package

# Reinstalling youtube-dl on Ubuntu

If you are on Ubuntu and the error persists, try to:

  1. Uninstall the youtube-dl package.
shell
sudo apt purge youtube-dl

purge youtube dl package on ubuntu

  1. Reinstall the package.
shell
sudo pip3 install youtube-dl

reinstall the package on ubuntu

  1. Hash the package.
shell
hash youtube-dl

hash the package

# Using the yt-dlp package instead

If you can't get the youtube-dl package to work, consider using the popular yt-dlp module.

The yt-dlp package is an actively maintained fork of youtube-dl.

Open your terminal and run the following command to install the package using pip.

shell
pip install --upgrade yt-dlp # Or with pip3 pip3 install --upgrade yt-dlp

pip install upgrade yt dlp

You can read more about using the yt-dlp module in this section of the docs.

For example, to download a video into an mp4 file, you'd use something like this:

shell
yt-dlp https://www.youtube.com/watch?v=jRAAaDll34Q -o my_video.mp4

using yt dlp package

The command is formatted as yt-dlp YT_VIDEO_URL -o /path/to/your-file.mp4.

Read more about the usage and available options in this section of the docs.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.