youtube-dl stopped working

15,978

Solution 1

Youtube updates his anti-download security system quite offen. You should keep your youtube-dl up-to-date. The version Ubuntu 12.04 Precis installs by default is 2012.02.27 (two years old).

You can subscribe to the WebUpd8 PPA to get new releases when they're out (that is once or twice a week) :

sudo add-apt-repository ppa:nilarimogard/webupd8 -y
sudo apt-get update
sudo apt-get dist-upgrade

You'll also find the .deb package of the latest youtube-dl release on that PPA (here and search for youtube-dl). Install it with a GUI-tool like gdebi or Ubuntu Software Center, or with these command lines :

cd directory/where/you/downloaded/the/package
dpkg -i youtube-dl*
sudo apt-get install -f

Solution 2

The apt-get version of youtube-dl is really outdated. If you don't want to add the ppa, you can install using git.

First, remove the outdated version:

sudo apt-get purge youtube-dl

Next, run the following commands to install:

git clone https://github.com/rg3/youtube-dl.git
cd youtube-dl
make
sudo make install

Now, to update youtube-dl to the newest version, just run the following command:

sudo youtube-dl -U

Alternatively, you can install new version from the pypi python repository:

sudo apt-get install python-pip3
sudo pip3 install youtube-dl

To update the pip version, run the following command:

sudo pip3 install youtube-dl --upgrade
Share:
15,978
sydbeat
Author by

sydbeat

Web/Press/Graphic Designer

Updated on September 18, 2022

Comments

  • sydbeat
    sydbeat over 1 year

    On my 12.04 LTS I can't download from YouTube via youtube-dl. I used to do that, but recently (for a week) I'm not able. I tried on many videos and I get same output:

    $ youtube-dl -t http://www.youtube.com/watch?v=Sh0ciyuXbJA
    [youtube] Setting language
    [youtube] Sh0ciyuXbJA: Downloading video webpage
    [youtube] Sh0ciyuXbJA: Downloading video info webpage
    [youtube] Sh0ciyuXbJA: Extracting video information
    Traceback (most recent call last):
      File "/usr/bin/youtube-dl", line 4645, in <module>
        main()
      File "/usr/bin/youtube-dl", line 4636, in main
        _real_main()
      File "/usr/bin/youtube-dl", line 4620, in _real_main
        retcode = fd.download(all_urls)
      File "/usr/bin/youtube-dl", line 869, in download
        ie.extract(url)
      File "/usr/bin/youtube-dl", line 1135, in extract
        return self._real_extract(url)
      File "/usr/bin/youtube-dl", line 1406, in _real_extract
        url_map = dict((ud['itag'][0], ud['url'][0] + '&signature=' + ud['sig'][0]) for ud in url_data)
      File "/usr/bin/youtube-dl", line 1406, in <genexpr>
        url_map = dict((ud['itag'][0], ud['url'][0] + '&signature=' + ud['sig'][0]) for ud in url_data)
    KeyError: 'sig'
    

    It seems it's some signature problem. I still can download videos via vlc. But I like youtube-dl - its faster. I did already:

    sudo apt-get --purge remove youtube-dl
    sudo apt-get install youtube-dl
    sudo youtube-dl --update
    

    ...but it didn't help.

    • Avinash Raj
      Avinash Raj about 10 years
      did you remove and reinstall youtude-dl package?
    • sydbeat
      sydbeat about 10 years
      I did sudo apt-get --purge remove youtube-dl and sudo apt-get install youtube-dl and even sudo youtube-dl --update
    • Avinash Raj
      Avinash Raj about 10 years
      is there any youtube-dl folder inside .config directory(which was on your home directory)?
    • sydbeat
      sydbeat about 10 years
      no, it isn't any
    • MrVaykadji
      MrVaykadji about 10 years
      This is not off-topic, 12.04 isn't a development version of Ubuntu
    • web.learner
      web.learner over 9 years
      @MrVaykadji This looks like a bug in the software and should be reported, hence the closure. Would have been nice if someone had commented to that effect though.. sigh.
    • web.learner
      web.learner over 9 years
      After seeing your answer though, I guess we can reopen since there is a good solution.
  • sydbeat
    sydbeat about 10 years
    Thanks, I've install .deb package (2014.03.03) as you said, and now it works! Thanks!
  • MrVaykadji
    MrVaykadji about 10 years
    It's not "wrong", it's old^^ Since they update it almost every week, they won't keep every snapshot in the repo. On the PPA link you'll find all the new versions of the .deb. But thanks for the notification, I updated the answer with a way that should get around for quite long (link to the "archive" path in the PPA, to manually get the latest release if you don't want to install the PPA)