12

When I run youtube-dl, I get the message below (it's very long). What is the problem and how do I fix this? It tells me to update youtube-dl but I am running it in terminal using the youtube-dl execution command - I don't think it is actually installed on my PC.

ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/snap/youtube-dl/4572/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1361, in _decrypt_signature
    video_id, player_url, s
  File "/snap/youtube-dl/4572/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1274, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "/snap/youtube-dl/4572/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1343, in _parse_sig_js
    initial_function = jsi.extract_function(funcname)
  File "/snap/youtube-dl/4572/lib/python3.6/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
    raise ExtractorError('Could not find JS function %r' % funcname)
youtube_dl.utils.ExtractorError: Could not find JS function 'na'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
 (caused by ExtractorError("Could not find JS function 'na'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Paul
  • 4,511
Allan
  • 593
  • 3
    You've provided no OS & release details; but have you followed what it says, ie. "Make sure you are using the latest version" as I grabbed a random youtube page & could download without issues; but your unstated release may differ to mine (and you maybe using a release where it's EOL being a 'universe' or community sourced package) – guiverc Dec 15 '21 at 11:18
  • 1
  • @guiverc I have Ubuntu 20.04.2 LTS but I'm having trouble updating it. Using the Software Updater app: While it is checking for updates, it displays the message "Waiting for apt-get to exit." and takes a very long time, without the bar even moving further than where it starts from when the message box appears. – Allan Dec 15 '21 at 13:16
  • @karel None of the answers in that question can fix this problem because youtube-dl project appears dead, so updates will not update. – Paul Dec 15 '21 at 19:26
  • @Paul The youtube-dl snap package is automatically kept up to date to the latest version so that the _extract_signature_function error in this question will not occur. For more information please read the accepted answer to youtube-dl failed to extract signature. Please skip down in the accepted answer to the paragraph that says "To upgrade youtube-dl to the latest version:". – karel Dec 15 '21 at 23:28
  • @karel, the "latest version" is barely working, likely soon not at all. I encourage you to scroll down the project issues and read any of the many discussions on the project being broken in myriad ways and abandoned. The better solution is install what seems to be the preferred fork. – Paul Dec 15 '21 at 23:38
  • 2
    @Paul Thanks for the heads up. I installed the yt-dlp snap package, tested it, and it worked successfully. – karel Dec 18 '21 at 08:51
  • Although speed-caping at 75KiB/s is still there , update of youtube-dl at least works now. The project was taken down for DMCA complains. Read full story at : https://github.blog/2020-11-16-standing-up-for-developers-youtube-dl-is-back/ – manishraj2011 Dec 21 '21 at 17:57
  • @manishraj2011 That blog post is over one year old and not relevant to the current discussion. The maintainer has resigned from the project. – Paul Dec 21 '21 at 18:58

3 Answers3

21

The youtube-dl project is unofficially dead. There have been no updates to the project since June, though was previously very active. There have been no published responses from the project maintainers, and the project was having serious issues on numerous websites starting several months ago.

Many people have migrated to yt-dlp, which has several install options, including PIP.

Paul
  • 4,511
4

Update:

Recommended solution is to use yt-dlp

Original response:

It's a known issue started a couple days ago, here is the github issue page:

https://github.com/ytdl-org/youtube-dl/issues/30363

The fix is there:

https://github.com/ytdl-org/youtube-dl/pull/30366/commits/1a091687c248b62c2f0a6070519bd78417828746

You're going to have to wait for the next release.

Or if you're in a rush and can't wait for the next release, you can go manually edit the "youtube.py" file in your installation.

In my install, the file was located at:

/usr/local/lib/python3.8/dist-packages/youtube_dl/extractor/youtube.py

I did the substitution manually, and I'm downloading again.

Wadih M.
  • 332
  • Thank you! The patch works for me! – Bruce Dec 15 '21 at 20:30
  • @Bruce If my experience is like others, YouTube will limit downloads to 75 KB/sec when using youtube-dl. Using yt-dlp achieves the normal download rate. – Paul Dec 15 '21 at 20:56
  • 1
    @Paul Thanks paul, wasn't aware of the yt-dlp fork. – Wadih M. Dec 15 '21 at 23:04
  • @Paul, thanks. I am using yt-dlp too. Wondering when Youtube will set the limit against yt-dlp. – Bruce Dec 18 '21 at 09:32
  • @Bruce This has been a cat-and-mouse game since youtube-dl was created. When that happens, yt-dlp will just fix the problem and you can install the update. – Paul Dec 18 '21 at 12:47
0

I just created a pull request to patch it. In a nutshell, youtube changed their two-char functions to three-char functions: it broke youtube-dl's regex stuff.

If you pull the project locally, then run this in terminal: python -m youtube_dl -x --audio-format mp3 https://youtu.be/lhXFIz0pVv4 it should download to the project folder.

Jedward
  • 11