Cannot download youtube-dl

Solution 1:

You don't have to upgrade the system. Update youtube-dl by adding this PPA:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install youtube-dl

Then you may download any video as usual. For example:

youtube-dl https://www.youtube.com/watch?v=Ix1rD4JD3eo

Solution 2:

Possibly the easiest way to install and setup youtube-dl is to use the following two commands suggested by the youtube-dl developers:

sudo wget https://yt-dl.org/downloads/2015.04.09/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl

And to subsequently update youtube-dl simply run the following:

sudo youtube-dl --update

Best to update at regular intervals as youtube-dl is updated often to match changes at the You Tube end...

Solution 3:

You are using Ubuntu 12.10 which is an End of Life release. I know this from your terminal output about Setting up 2014.06.02-1~webupd8~quantal from this PPA: ppa:nilarimogard/webupd8 which is found at this webpage. That's why you can't update youtube-dl. Your version of youtube-dl is out of date and Google has changed the code required to download a YouTube video since Ubuntu 12.10 was released. That is why you can't download any video. Try installing the latest version of Ubuntu, Ubuntu 14.04, which is a Long Term Support release that is supported by updates until April, 2019, and youtube-dl will work the way it's supposed to.

Then try to download a 5-second test video to check if youtube-dl is working:

youtube-dl -f 18 http://www.youtube.com/watch?v=pBPPLu2x3lI  

If that doesn't work the apt version of YouTube is not up-to-date, so install the youtube-dl snap package instead:

sudo apt install snapd  
sudo snap install youtube-dl # start with snap run youtube-dl