Last updated: Apr 13, 2024
Reading time·2 min
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
.
pip install --upgrade youtube-dl # Or with pip3 pip3 install --upgrade youtube-dl
The command upgrades the youtube-dl package to the latest version.
youtube-dl
package using homebrew on macOSIf you are on macOS, you can also try to upgrade the youtube-dl
package with
homebrew.
brew upgrade youtube-dl
youtube-dl
package using Chocolatey on WindowsIf you are on Windows, try upgrading the package with Chocolatey.
choco upgrade youtube-dl
youtube-dl
package with curl on UnixIf 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.
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.
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
.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.
youtube-dl --update
However, this wouldn't work if you installed youtube-dl
with a package
manager.
youtube-dl
package using pipIf the error persists, try to reinstall the youtube-dl
package with pip
:
pip uninstall -y youtube-dl
pip
.pip install --upgrade youtube-dl
youtube-dl
on UbuntuIf you are on Ubuntu and the error persists, try to:
youtube-dl
package.sudo apt purge youtube-dl
sudo pip3 install youtube-dl
hash youtube-dl
yt-dlp
package insteadIf 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
.
pip install --upgrade yt-dlp # Or with pip3 pip3 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:
yt-dlp https://www.youtube.com/watch?v=jRAAaDll34Q -o my_video.mp4
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.
You can learn more about the related topics by checking out the following tutorials: