Downloading Age Restricted Videos With youtube-dl.
A while back youtube.com started adding age restrictions to Videos & trying to download some of these videos with youtube-dl, simply resulted in people receiving the following error message.
WARNING: Unable to download video info webpage: HTTP Error 410: Gone
ERROR: Sign in to confirm your age
This video may be inappropriate for some users.
You still want to download the video right :? The simple solution is to use a browser extension to download your youtube cookies & then pass said cookies to youtube-dl with the --cookies
flag. This was all pretty straight forward & I was able to download the age restricted video in no time. Simply follow the steps below if you’d like to be able to do the same.
Step.1
Install a browser extension to download your cookies from youtube. I’m running firefox so I installed “this extension” & saved my cookies to my downloads folder.
Step.2
Add the
--cookies
flag to your youtube-dl command in the terminal & follow it with the location of your cookies.txt file.
youtube-dl -f bestvideo+bestaudio --cookies /path/to/youtube-cookies.txt $youtubeurl
Thats all there is to it. Run the command & your video should download as normal without giving you any age restriction errors.