youtube-dl: Could not find JS function 'encodeURIComponent'

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.01.16. If it’s not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I’ve verified and I assure that I’m running youtube-dl 2019.01.16

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description

I got error report from server with this stacktrace:

Signature extraction failed: Traceback (most recent call last):
  File "/home/ubuntu/virtual_environment/lib/python3.5/site-packages/youtube_dl/extractor/youtube.py", line 1232, in _decrypt_signature
    video_id, player_url, s
  File "/home/ubuntu/virtual_environment/lib/python3.5/site-packages/youtube_dl/extractor/youtube.py", line 1139, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "/home/ubuntu/virtual_environment/lib/python3.5/site-packages/youtube_dl/extractor/youtube.py", line 1207, in _parse_sig_js
    initial_function = jsi.extract_function(funcname)
  File "/home/ubuntu/virtual_environment/lib/python3.5/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 'encodeURIComponent'; 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 'encodeURIComponent'; 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.

I have the link of video caused this issue, but I can’t reproduce it in my machine: https://www.youtube.com/watch?v=dChN0N0U7G4 And here is the JS url: https://www.youtube.com/yts/jsbin/player_ias-vfl3bQWS-/en_US/base.js

Seem like it not happen all time, but this issue becomes trending as I can see in crash report.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 19 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I compiled youtube-dl for Linux with the latest commit, and I can confirm that now works, I’ll leave the file for Linux youtube-dl.zip

Can confirm OP’s fix works, resolved the issue for me. Thanks a ton! Users can install it with pip using pip install https://github.com/Khang-NT/youtube-dl/archive/master.zip which will uninstall current youtube-dl and replace with the fix on the fork Windows 10 1803 btw

Proposed fix works here.

I initially installed it through brew, however I don’t know how to install youtube-dl from Khang-NT’s fork. (is this possible?) So i Installed it with pip instead. And working on my end now too. Thanks @Khang-NT and @carlbennett for linking this issue. 👍

@fcharlier

Which commit are you refering to? The latest commit is the 2019.01.16 release.

Are you talking about the fork from Khang-NT?

Yes I’m sorry, I was referring to the fork from Khang-NT