问题描述
使用youtube-dl
软件下载youtube被认为非常有用。
看到一条消息,它停止工作,如下所示。
ERROR: Signature extraction failed: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 479, in _decrypt_signature
video_id, player_url, s
File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 383, in _extract_signature_function
res = self._parse_sig_js(code)
File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 454, in _parse_sig_js
u'Initial JS player signature function name')
File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 391, in _search_regex
raise RegexNotFoundError(u'Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract Initial JS player signature function name; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.
; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.
我应该做什么才能继续?
最佳答案
您收到此错误:
Unable to extract Initial JS player signature function name
…因为 youtube-dl 不是 up-to-date。谷歌现在比几年前更频繁地改变访问YouTube视频的方式,因此为了保留youtube-dl up-to-date,它也必须更频繁地更新。要安装最新版本的 youtube-dl,请打开终端并输入:
sudo snap install youtube-dl # start with snap run youtube-dl
或者:
sudo apt remove youtube-dl
sudo apt install python3-pip
python3 -m pip install youtube-dl
将youtube-dl升级到最新版本:
sudo snap install youtube-dl # youtube-dl snap is automatically upgraded
或者
python3 -m pip install --upgrade youtube-dl
Google 如此频繁地更改访问 YouTube 视频的代码,这真是太疯狂了。我似乎记得几个月前才更新过youtube-dl,但在我更新之前它仍然无法下载所选视频。
youtube-dl是一个Python程序,因此您也可以在Python虚拟环境中本地安装最新版本的youtube-dl。有关如何设置和使用 Python 虚拟环境的信息,请参阅 How to set up and use a virtual python environment in Ubuntu? 。
次佳答案
我让它工作的唯一方法是最新版本(对我来说在 debian 上)
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
第三种答案
我曾经遇到过这样的事。正如他们在评论中所说,您必须更新系统或仅更新 youtube-dl。在此示例中也可以很好地使用引号,如下所示:
youtube-dl "https://www.youtube.com/watch?v=n6AL-WpgoFw"
第四种答案
我遇到了同样的问题,这解决了它
sudo -H pip install --upgrade youtube-dl
并尝试将链接放入“ link
”