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 :
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