. Advertisement .
..3..
. Advertisement .
..4..
I’m trying to run a new project. I do a couple of things like this:
import youtube_dl # Youtube_dl is used for download the video
ydl_opt = {"outtmpl" : "/videos/%(title)s.%(ext)s", "format": "bestaudio/best"} # Here we give some advanced settings. outtmpl is used to define the path of the video that we are going to download
def operation(link):
"""
Start the download operation
"""
try:
with youtube_dl.YoutubeDL(ydl_opt) as yd: # The method YoutubeDL() take one argument which is a dictionary for changing default settings
video = yd.download([link]) # Start the download
result.set("Your video has been downloaded !")
except Exception:
result.set("Sorry, we got an error.")
operation("https://youtube.com/watch?v=...")
But in my program, I am getting the warning:
ERROR: YouTube said: Unable to extract video data
Can someone explain why the “ Youtube_dl: youtube said unable to extract video data” issue happened? Where have I gone wrong? Thank you!
The cause: Perhaps your youtube-dl version is out of date, so you can’t extract video data.
Solution: Updating youtube-dl is a helpful way for me to resolve this probblem. These commands depend on how you install it.
Users of ubuntu: