ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.31k stars 10.03k forks source link

[Youtube] Unable to extract nsig function code #32912

Closed igorir3 closed 2 months ago

igorir3 commented 2 months ago

Checklist

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--print-json', 'https://www.youtube.com/watch?v=CEB4Wy8C0Io', '--verbose']
[debug] Encodings: locale cp1251, fs utf-8, out cp1251, pref cp1251
[debug] youtube-dl version 2021.12.17
[debug] Python 3.12.5 (CPython AMD64 64bit) - Windows-11-10.0.22631-SP0 - OpenSSL 3.0.13 30 Jan 2024
[debug] exe versions: ffmpeg n4.4.4-6-gd5fa6e3a91-20231116, ffprobe n4.4.4-6-gd5fa6e3a91-20231116
[debug] Proxy map: {}
[debug] [youtube] Extracting signature function js_53afa3ce_107
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 "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\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 "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\youtube.py", line 1690, in _extract_n_function_code
    func_name = self._extract_n_function_name(jscode)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\youtube.py", line 1660, in _extract_n_function_name
    func_name, idx = self._search_regex(
                     ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\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 "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\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 "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\youtube.py", line 1690, in _extract_n_function_code
    func_name = self._extract_n_function_name(jscode)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\youtube.py", line 1660, in _extract_n_function_name
    func_name, idx = self._search_regex(
                     ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\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 "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\YoutubeDL.py", line 875, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\YoutubeDL.py", line 971, in __extract_info
    ie_result = ie.extract(url)
                ^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\common.py", line 571, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\youtube.py", line 2108, in _real_extract
    self._unthrottle_format_urls(video_id, player_url, dct)
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\youtube.py", line 1725, in _unthrottle_format_urls
    n_response = decrypt_nsig(n_param)(n_param, video_id, player_url)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\youtube.py", line 1614, in inner
    raise ret
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\youtube_dl\extractor\youtube.py", line 1606, in inner
    self._player_cache[cache_id] = func(*args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kiril\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\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.

Description

It's been a week since I downloaded the library\ program... Neither one nor the other works AT ALL, no matter how I shove the link and, no matter what, it goes to this or similar error. Even if I insert links that worked before, errors still remain

igorir3 commented 2 months ago

Okay... I found the answer in, which told me to switch to yt_dlp... We need to look for information better...