Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YouTube] Unable to extract nsig function code ..., not downloading video #32877

Closed
ferdna opened this issue Jul 24, 2024 · 7 comments
Closed
Labels
broken-IE problem with existing site extraction patch-available

Comments

@ferdna
Copy link

ferdna commented Jul 24, 2024

todays master(2024-07-24-12:00) branch tarball.

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '-F', 'https://www.youtube.com/watch?v=sRb_-MsdjaM']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python 3.11.9 (CPython x86_64 64bit) - Linux-6.9.10-x86_64-Intel-R-Core-TM-i7-6700K_CPU@4.00GHz-with-glibc2.39 - OpenSSL 3.3.1 4 Jun 2024 - glibc 2.39
[debug] exe versions: ffmpeg 6.1.1, ffprobe 6.1.1
[debug] Proxy map: {}
[youtube] sRb
-MsdjaM: Downloading webpage
[youtube] sRb
-MsdjaM: Downloading player 3400486c
ERROR: Unable to extract nsig function code (caused by RegexNotFoundError('Unable to extract Initial JS player n function name; please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; see https://github.com/ytdl-org/youtube-dl/#user-content-installation on how to update. Be sure to call youtube-dl with the --verbose option and include the complete output.')); please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; see https://github.com/ytdl-org/youtube-dl/#user-content-installation on how to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1637, in _decrypt_nsig
jsi, player_id, func_code = self._extract_n_function_code(video_id, player_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1686, in _extract_n_function_code
func_name = self._extract_n_function_name(jscode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1660, in _extract_n_function_name
func_name, idx = self._search_regex(
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/common.py", line 1101, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract Initial JS player n function name; please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; see https://github.com/ytdl-org/youtube-dl/#user-content-installation on how to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1637, in _decrypt_nsig
jsi, player_id, func_code = self._extract_n_function_code(video_id, player_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1686, in _extract_n_function_code
func_name = self._extract_n_function_name(jscode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1660, in _extract_n_function_name
func_name, idx = self._search_regex(
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/common.py", line 1101, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract Initial JS player n function name; please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; see https://github.com/ytdl-org/youtube-dl/#user-content-installation on how to update. Be sure to call youtube-dl with the --verbose option and include the complete output.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/youtube_dl/YoutubeDL.py", line 875, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/YoutubeDL.py", line 971, in __extract_info
ie_result = ie.extract(url)
^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/common.py", line 571, in extract
ie_result = self._real_extract(url)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 2104, in _real_extract
self._unthrottle_format_urls(video_id, player_url, dct)
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1721, in _unthrottle_format_urls
n_response = decrypt_nsig(n_param)(n_param, video_id, player_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1614, in inner
raise ret
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1606, in inner
self._player_cache[cache_id] = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/youtube_dl/extractor/youtube.py", line 1639, in _decrypt_nsig
raise ExtractorError('Unable to extract nsig function code', cause=e)
youtube_dl.utils.ExtractorError: Unable to extract nsig function code (caused by RegexNotFoundError('Unable to extract Initial JS player n function name; please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; see https://github.com/ytdl-org/youtube-dl/#user-content-installation on how to update. Be sure to call youtube-dl with the --verbose option and include the complete output.')); please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; see https://github.com/ytdl-org/youtube-dl/#user-content-installation on how to update. Be sure to call youtube-dl with the --verbose option and include the complete output.

@skjsjslee
Copy link

The same, as well.

@dirkf
Copy link
Contributor

dirkf commented Jul 24, 2024

The problem has been solved here but I'll let the commit close this issue.

@dirkf dirkf added broken-IE problem with existing site extraction patch-available labels Jul 24, 2024
@dirkf dirkf changed the title not downloading video from youtube. [YouTube] Unable to extract nsig function code ..., not downloading video Jul 24, 2024
@stephen-czetty
Copy link

I have the latest code from the repo, and I'm still getting the error for player 13400486c'

@GregoriusT
Copy link

I think what was meant was "once the issue is solved, it will close this issue as well" implying it is not solved yet. (which yes it is still broken for me, which is no wonder since the repo hasnt been updated yet)

@dirkf
Copy link
Contributor

dirkf commented Jul 24, 2024

If you're desperate, apply the linked patch.

@stephen-czetty
Copy link

Sorry, I misunderstood. You linked to a closed issue, so I assumed that meant the patch had been applied. The patch you linked to does work fine, after manually applying it.

@dirkf dirkf closed this as completed in e1b3fa2 Jul 24, 2024
@dirkf
Copy link
Contributor

dirkf commented Jul 24, 2024

A nightly build with the fix should appear in the next few hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken-IE problem with existing site extraction patch-available
Projects
None yet
Development

No branches or pull requests

5 participants