Score:4

No longer able to download YouTube using youtube-dl. How do I fix this problem?

ru flag

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.
guiverc avatar
cn flag
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)
karel avatar
sa flag
Does this answer your question? [youtube-dl failed to extract signature](https://askubuntu.com/questions/598200/youtube-dl-failed-to-extract-signature)
Allan avatar
ru flag
@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.
Paul avatar
us flag
@karel None of the answers in that question can fix this problem because `youtube-dl` project appears dead, so updates will not update.
karel avatar
sa flag
@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](https://askubuntu.com/questions/598200/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:".
Paul avatar
us flag
@karel, the "latest version" is barely working, likely soon not at all. I encourage you to scroll down the [project issues](https://github.com/ytdl-org/youtube-dl/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](https://github.com/yt-dlp/yt-dlp).
karel avatar
sa flag
@Paul Thanks for the heads up. I installed the yt-dlp snap package, tested it, and it worked successfully.
mm flag
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/
Paul avatar
us flag
@manishraj2011 That blog post is over one year old and not relevant to the current discussion. The maintainer has [resigned from the project](https://github.com/ytdl-org/youtube-dl/commit/21b759057502c6e70d51011cfb3fb86d84055182).
Score:6
us flag

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.

Score:0
pt flag

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.

Bruce avatar
cn flag
Thank you! The patch works for me!
Paul avatar
us flag
@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.
Wadih M. avatar
pt flag
@Paul Thanks paul, wasn't aware of the yt-dlp fork.
Bruce avatar
cn flag
@Paul, thanks. I am using `yt-dlp` too. Wondering when Youtube will set the limit against `yt-dlp`.
Paul avatar
us flag
@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.
Score:-1
cn flag

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.

Paul avatar
us flag
It won't be accepted. Read through the issues. It's dead, Jim.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.