I\'m making a little graphic interface with Python 3 which should download a youtube video with it URL. I use for that the module youtube_dl. This is my code :
Updating youtube-dl helped me: youtube-dl --update
I had the same error on Ubuntu 20.04. I solved it by updating youtube-dl by downloading a .deb from: https://packages.debian.org/sid/all/youtube-dl/download
Though you can also get the update on youtube-dl's official site.
If you are using youtube-dl command line on MacOsx update using this command :
sudo youtube-dl --update
You could try adding a cookie file as some videos are age restricted. Use this plugin Chrome plugin Cookie.txt to download your cookies in a txt file then use these --cookies /path/to/cookies/file.txt
flags not forgetting to put the right path to the file of your cookies.txt.
Sample:
youtube-dl -n --cookies ~/Downloads/cookies.txt https://www.youtube.com/watch\?v\=h7Ii7KKapig
Surce