从 YouTube 下载失败

从 YouTube 下载失败

我安装了 youtube-dl 并执行它显示的命令:

[youtube] Setting language
[youtube] _gp51lt9kdA: Downloading video webpage
[youtube] _gp51lt9kdA: Downloading video info webpage
[youtube] _gp51lt9kdA: 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'

答案1

通过添加此 PPA 来更新 youtube-dl

sudo add-apt-repository ppa:nilarimogard/webupd8

sudo apt-get update

sudo apt-get install youtube-dl

然后您就可以照常下载任何视频。例如::

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

相关内容