youtube-dl: Failue to download YouTube video -- "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
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.youtube.com/watch?v=jr41skFqzb8']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2019.01.16
[debug] Python version 3.7.1 (CPython) - Windows-10-10.0.17763-SP0
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
[youtube] jr41skFqzb8: Downloading webpage
[youtube] jr41skFqzb8: Downloading video info webpage
[youtube] {18} signature length 43.40, html5 player vflxwIF7f
[youtube] jr41skFqzb8: Downloading player https://www.youtube.com/yts/jsbin/player_ias-vflxwIF7f/en_US/base.js
ERROR: Signature extraction failed: Traceback (most recent call last):
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1232, in _decrypt_signature
video_id, player_url, s
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1140, in _extract_signature_function
res = self._parse_sig_js(code)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1207, in _parse_sig_js
initial_function = jsi.extract_function(funcname)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\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.
Traceback (most recent call last):
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1232, in _decrypt_signature
video_id, player_url, s
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1140, in _extract_signature_function
res = self._parse_sig_js(code)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1207, in _parse_sig_js
initial_function = jsi.extract_function(funcname)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\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.
Traceback (most recent call last):
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1232, in _decrypt_signature
video_id, player_url, s
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1140, in _extract_signature_function
res = self._parse_sig_js(code)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1207, in _parse_sig_js
initial_function = jsi.extract_function(funcname)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\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.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\YoutubeDL.py", line 793, in extract_info
ie_result = ie.extract(url)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\common.py", line 508, in extract
ie_result = self._real_extract(url)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1888, in _real_extract
encrypted_sig, video_id, player_url, age_gate)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1242, in _decrypt_signature
'Signature extraction failed: ' + tb, cause=e)
youtube_dl.utils.ExtractorError: Signature extraction failed: Traceback (most recent call last):
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1232, in _decrypt_signature
video_id, player_url, s
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1140, in _extract_signature_function
res = self._parse_sig_js(code)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\youtube_dl\extractor\youtube.py", line 1207, in _parse_sig_js
initial_function = jsi.extract_function(funcname)
File "C:\Users\Ralph\AppData\Roaming\Python\Python37\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.
Description of your issue, suggested solution and other information
It appears that I cannot download YouTube videos. I’ve attempted with the following links, but receive the error Could not find JS function 'encodeURIComponent' with every attempt. This issue was brought up by a friend who is experiencing the same problem.
- https://www.youtube.com/watch?v=jr41skFqzb8
- https://www.youtube.com/watch?v=zF8OMK5vVJc
- https://www.youtube.com/watch?v=6ONRf7h3Mdk
- https://www.youtube.com/watch?v=BNzc6hG3yN4
- https://www.youtube.com/watch?v=1-nkbipHEdk
However, I am able to download the following videos:
- https://www.youtube.com/watch?v=PNIiTb6mfy0
- https://www.youtube.com/watch?v=zR8sRjBJgQ8
- https://www.youtube.com/watch?v=5f7_AI9H3N4
- https://www.youtube.com/watch?v=V1LgLfItk8Q
- https://www.youtube.com/watch?v=47ClcUcGB7U
I’m not sure what the difference is between them, but the first five don’t work and the last five do. Any help would be appreciated.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 24
- Comments: 25
Commits related to this issue
- youtube-dl: 2019.01.16 -> 2019.01.17 Fixes an issue with youtube, see https://github.com/rg3/youtube-dl/issues/18891 — committed to timokau/nixpkgs by timokau 5 years ago
- youtube-dl: 2019.01.16 -> 2019.01.17 Fixes an issue with youtube, see https://github.com/rg3/youtube-dl/issues/18891 (cherry picked from commit a1169afdeda99baceac88bf4f41eb9699342bdd0) — committed to timokau/nixpkgs by timokau 5 years ago
@carlbennett bug reports are neither the time nor place to flame other users. I appreciate your linking of other issues but I think your usefulness in this thread has reached its limit.
@RalphORama “Usefulness” hasn’t ended. Seriously, take a look at this guy’s commit: https://github.com/Khang-NT/youtube-dl/commit/f829ef2e13c4e791f455282a9b7f0ecde9891252
Learn to search better.
Someone already made a fix in that issue I linked.
@carlbennett I appreciate Mr. Khang’s fix much more than I appreciate your trolling in this thread.
@RalphORama Okay what do you say about #18890 then? You should have tagged along examples and verbose logs to the #18873.
@RalphORama failed this step:
#18873
@RalphORama is the real troll here, @carlbennett is just following the repository’s contributing guidelines unlike @RalphORama who makes duplicate issues and lies about searching for similar ones.
There’s a fix already, y’all calm down and go download your videos.
Here is the one-liner fix for future visitors:
@Ornosunite please keep comments related to the issue at hand. Thank you.
@carlbennett thank you for your input, I’ll wait and see what youtube-dl contributors say the issue was. I’m excited for a fix.
@carlbennett Mentioned issue does not provide verbose log as is requested and very few examples. Thanks.
@scallywag41 there’s no new release yet, simply a proposed fix. I assume a new version will be deployed on pip later this week.
@iPaat https://github.com/Khang-NT/youtube-dl/commit/f829ef2e13c4e791f455282a9b7f0ecde9891252
I have the same problem: youtube-dl -i -v --extract-audio --audio-format mp3 -o “%(title)s.%(ext)s” https://www.youtube.com/watch?v=W434iQM7Lzw [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u’-i’, u’-v’, u’–extract-audio’, u’–audio-format’, u’mp3’, u’-o’, u’%(title)s.%(ext)s’, u’https://www.youtube.com/watch?v=W434iQM7Lzw’] [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2019.01.16 [debug] Python version 2.7.13 (CPython) - Linux-4.9.0-8-amd64-x86_64-with-debian-9.6 [debug] exe versions: ffmpeg 3.3.9, ffprobe 3.3.9, rtmpdump 2.4 [debug] Proxy map: {} [youtube] W434iQM7Lzw: Downloading webpage [youtube] W434iQM7Lzw: Downloading video info webpage [youtube] {18} signature length 43.40, html5 player vflxwIF7f [youtube] W434iQM7Lzw: Downloading player https://www.youtube.com/yts/jsbin/player_ias-vflxwIF7f/en_US/base.js ERROR: Signature extraction failed: Traceback (most recent call last): File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1232, in _decrypt_signature video_id, player_url, s File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1140, in _extract_signature_function res = self._parse_sig_js(code) File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1207, in _parse_sig_js initial_function = jsi.extract_function(funcname) File “/usr/local/bin/youtube-dl/youtube_dl/jsinterp.py”, line 245, in extract_function raise ExtractorError(‘Could not find JS function %r’ % funcname) ExtractorError: Could not find JS function u’encodeURIComponent’; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. (caused by ExtractorError(u"Could not find JS function u’encodeURIComponent’; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U 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; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. Traceback (most recent call last): File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1232, in _decrypt_signature video_id, player_url, s File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1140, in _extract_signature_function res = self._parse_sig_js(code) File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1207, in _parse_sig_js initial_function = jsi.extract_function(funcname) File “/usr/local/bin/youtube-dl/youtube_dl/jsinterp.py”, line 245, in extract_function raise ExtractorError(‘Could not find JS function %r’ % funcname) ExtractorError: Could not find JS function u’encodeURIComponent’; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. Traceback (most recent call last): File “/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py”, line 793, in extract_info ie_result = ie.extract(url) File “/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py”, line 508, in extract ie_result = self._real_extract(url) File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1888, in _real_extract encrypted_sig, video_id, player_url, age_gate) File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1242, in _decrypt_signature ‘Signature extraction failed: ’ + tb, cause=e) ExtractorError: Signature extraction failed: Traceback (most recent call last): File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1232, in _decrypt_signature video_id, player_url, s File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1140, in _extract_signature_function res = self._parse_sig_js(code) File “/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py”, line 1207, in _parse_sig_js initial_function = jsi.extract_function(funcname) File “/usr/local/bin/youtube-dl/youtube_dl/jsinterp.py”, line 245, in extract_function raise ExtractorError(‘Could not find JS function %r’ % funcname) ExtractorError: Could not find JS function u’encodeURIComponent’; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. (caused by ExtractorError(u"Could not find JS function u’encodeURIComponent’; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U 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; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
I have applied the fix that was proposed by carlbennet and it works for me very well. Syndey Youngblood is playing Sit and Wait… Thank you!
I get identical results as cosynox. Running current version. Was copying files, and this died in the last two hours.
@RalphORama Thank you sir. I will keep an eye on the thread. Sorry if I’ve interrupted. I don’t use git a great deal and so I hope I haven’t broken any etiquette.
Where can I find the mentioned fix?
Could someone be a nice mate and compile a version for Windows for me?