Linux Mint上的Youtube-dl

时间:2014-10-21 14:35:16

标签: youtube-dl

我刚在Linux Mint上安装了youtube-dl。我只是尝试下载随机视频,但它不起作用:

我在AskUbuntu上问了同样的问题,但后来意识到它仅适用于Ubuntu OS

>youtube-dl -F https://www.youtube.com/watch?v=YvydCWM9k0w
[youtube] Setting language
[youtube] YvydCWM9k0w: Downloading video webpage
[youtube] YvydCWM9k0w: Downloading video info webpage
[youtube] YvydCWM9k0w: Extracting video information
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
   "__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/bin/youtube-dl/__main__.py", line 7, in <module>
File "/usr/bin/youtube-dl/__init__.py", line 536, in main
File "/usr/bin/youtube-dl/__init__.py", line 520, in _real_main
File "/usr/bin/youtube-dl/FileDownloader.py", line 475, in download
File "/usr/bin/youtube-dl/InfoExtractors.py", line 80, in extract
File "/usr/bin/youtube-dl/InfoExtractors.py", line 405, in _real_extract
File "/usr/bin/youtube-dl/InfoExtractors.py", line 405, in <genexpr>
KeyError: 'sig'

所以我尝试更新youtube-dl ..但它不起作用

>youtube-dl -U
Updating to latest version...
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/bin/youtube-dl/__main__.py", line 7, in <module>
File "/usr/bin/youtube-dl/__init__.py", line 536, in main
File "/usr/bin/youtube-dl/__init__.py", line 510, in _real_main
File "/usr/bin/youtube-dl/__init__.py", line 55, in updateSelf
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 442, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 629, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

我已经处于超级用户模式.. Thnx

1 个答案:

答案 0 :(得分:1)

您的youtube-dl版本太旧了,它使用了已停产的更新系统。联系您的发行版以索取更新版本或运行the following

sudo apt-get remove -y youtube-dl
sudo wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+x /usr/local/bin/youtube-dl
hash -r

从那时起,您可以通过键入sudo youtube-dl -U来独立于系统更新youtube-dl。