youtube-dl无法提取签名

使用youtube-dl软件下载youtubes被认为是非常有用的。

看到一条消息,它停止工作,紧随其后。

 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不是最新的。 与几年前的情况相比,谷歌现在更频繁地改变访问YouTubevideo的方式,因此为了使youtube-dl保持最新,它必须更频繁地更新。 要安装最新版本的youtube-dl,请打开终端并输入:

 sudo apt install python-pip sudo pip install youtube-dl 

要将youtube-dl升级到最新版本:

 sudo pip install --upgrade youtube-dl 

要么

 sudo snap install youtube-dl-casept 

谷歌改变访问YouTubevideo的代码的频率实在太高了。 我似乎记得仅在几个月之前更新了youtube-dl,但在更新之前它仍然无法下载所选video。

youtube-dl是一个Python程序,因此您也可以在Python虚拟环境中本地安装最新版本的youtube-dl。 有关如何设置和使用Python虚拟环境的信息,请参阅如何在Ubuntu中设置和使用虚拟python环境? 。

它曾经发生在我身上。 正如他们在评论中所说,您必须更新您的系统或只更新youtube-dl。 在这个例子中也可以使用如下的引号:

 youtube-dl "https://www.youtube.com/watch?v=n6AL-WpgoFw"