Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I used to download videos using youtube-dl command line tool, from the past two days whenever i try to download any video I get an error as shown below.

$ youtube-dl https://www.youtube.com/watch?v=bFew8mgQJ9o
[youtube] Setting language
[youtube] bFew8mgQJ9o: Downloading video webpage
[youtube] bFew8mgQJ9o: Downloading video info webpage
[youtube] bFew8mgQJ9o: 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'

whats going on?

share|improve this question
    
Are you behind a proxy? –  i08in Mar 8 at 22:22
    
yup, one that belongs to the institution where i am studying and access internet. –  kernel_panic Mar 8 at 22:25
    
Was the answer helpful? –  i08in Mar 12 at 21:13
    
possible duplicate of youtube-dl stopped working –  Andrea Corbellini Nov 4 at 8:31

4 Answers 4

Had exactly the same problem.

Updated youtube-dl via:

sudo youtube-dl -U

Run youtube-dl via sudo

sudo youtube-dl and it will inform that they have changed distribution and need to update. Press enter and you should be good to go.

share|improve this answer

You need to export your proxy settings before you can use youtube-dl to download videos from youtube. To do this, export proxy settings using:

export http_proxy=http://username:password@host:port_no/
export https_proxy=https://username:password@host:port_no/
export HTTP_PROXY=http://username:password@host:port_no/
export HTTPS_PROXY=https://username:password@host:port_no/

Replace username, password, host and port_no with your respective variables. Remember to replace any special characters, if any, in your username or password with their HTML codes. Ignore username and password if you don't have one and export them as:

export HTTP_PROXY=http://host:port_no/

etc.

For ex:

export HTTP_PROXY=http://123431212:mypassword@192.168.1.2:3128/

You can also write this to your ~/.bashrc file to avoid writing them again and again for future sessions.

Retry downloading videos after doing this.

share|improve this answer

When I tried to upgrade with sudo as indicated in the other answer:

sudo youtube-dl -U

I got a message saying that youtube-dl had been installed using a package manager and I should use the same to upgrade it. But I had already done

sudo easy_install -U youtube-dl

In the end, just using sudo to run it worked.

sudo youtube-dl
share|improve this answer

Install youtube-dl with sudo apt-get install youtube-dl from command-line, then use:

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

Make sure, that you use sudo before the above command!

share|improve this answer

protected by Community Aug 24 at 14:30

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.