Ubuntu – Unable to download videos using youtube-dl (‘sig error’), how to correct

pythonyoutube-dl

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?

Best Answer

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.