Repository: ytdl-org/youtube-dl (language: python)

Issue:
[YouTube] Error 403 when downloading, with "Unable to decode n-parameter", not solved by new cookies
<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.12.17. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that all URLs and arguments with special characters are properly quoted or escaped as explained in http://yt-dl.org/escape.
- Search the bugtracker for similar issues: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a broken site support
- [x] I've verified that I'm running youtube-dl version **2021.12.17**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [x] I've checked that all URLs and arguments with special characters are properly quoted or escaped
- [x] I've searched the bugtracker for similar issues including closed ones


## Verbose log

<!--
Provide the complete verbose output of youtube-dl that clearly demonstrates the problem.
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 below. It should look similar to this:
 [debug] System config: []
 [debug] User config: []
 [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
 [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
 [debug] youtube-dl version 2021.12.17
 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
 [debug] Proxy map: {}
 <more lines>
-->

```
[debug] System config: []
[debug] User config: ['--no-mtime', '--match-filter', '!is_live', '--retries', 'infinite', '--fragment-retries', '2', '--skip-unavailable-fragments', '--restrict-filenames', '-i', '-o', '/home/gregorius/home/pending/videos/%(title)s___%(id)s.webm', '-f', '(bestvideo[height<=360]+worstaudio/best[height<=360])[protocol!=http_dash_segments][container!^=dash]', '--console-title', '--hls-prefer-native', '--no-cache-dir', '--http-chunk-size', '100M', '--cookies', '/home/gregorius/home/scripts/video/youtube-dl-cookies']
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=I0EmyNep1pE', '-vf', '(242+249/242+250/242+171/242+251)/(243+249/243+250/243+171/243+251)/18', '--no-playlist']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Single file build
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-112-generic-x86_64-with-glibc2.35 - OpenSSL 3.0.2 15 Mar 2022 - glibc 2.35
[debug] exe versions: ffmpeg 4.4.2, ffprobe 4.4.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] I0EmyNep1pE: Downloading webpage
[youtube] Downloading just video I0EmyNep1pE because of --no-playlist
[youtube] I0EmyNep1pE: Downloading player 590f65a6
WARNING: [youtube] I0EmyNep1pE: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
WARNING: [youtube] I0EmyNep1pE: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
[debug] Invoking downloader on 'https://rr2---sn-4g5lznes.googlevideo.com/videoplayback?expire=1718665474&ei=omxwZvKCJ_iai9oPrPytsAk&ip=47.69.137.137&id=o-AKm1dRgby9sFrDGVX0bJ3KgKGN1PyHSx-q_f9KRGSC_4&itag=242&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C299%2C302%2C303&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zO&mm=31%2C26&mn=sn-4g5lznes%2Csn-f5f7lne6&ms=au%2Conr&mv=m&mvi=2&pl=19&pcm2=yes&initcwndbps=1846250&bui=AbKP-1O3YVe9fGtsxyDHU7TNneKRCgDUDHJwh-mOCN2NGJSkTd1WUBz8ZDI7BYY3UcprCDw-3wyQylOT&spc=UWF9f4QfSfv8_z5FTqrKIgbd1Z6DAne5l6xi3J5VDxJUjQ-o3xFEAi01qfSo&vprv=1&svpuc=1&mime=video%2Fwebm&ns=yYmogIIQrRok7xzlewj6aUcQ&rqh=1&gir=yes&clen=1016042&dur=191.725&lmt=1718607835104876&mt=1718643418&fvip=5&keepalive=yes&c=WEB&sefc=1&txp=630F224&n=qe5ibzBzTm3VA9bmZa&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgfyH-ksbDbOyac3rkRTnpiA_Nl3s2qIu4ZaefHXj3F5kCIQCzK-IImJCscIaBUVePhfrOHydqrVCjL0XQK11dlUvY7A%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIgNUY_e59Q8v2uPdD5xDihqT72BNgDpYP1DwWLHcSH0UMCIQCzBNlexMB54rPi1BsBVeLCNQxyrz_g9jsimTokpp4HEA%3D%3D'
[dashsegments] Total fragments: 1
[download] Destination: /home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f242.webm
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 1 of 2)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 2 of 2)...
ERROR: giving up after 2 fragment retries
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/__init__.py", line 473, in main
    _real_main(argv)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/__init__.py", line 463, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2227, in download
    res = self.extract_info(
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 852, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 859, in wrapper
    return func(self, *args, **kwargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 966, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 1000, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 1844, in process_video_result
    self.process_info(new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2126, in process_info
    partial_success = dl(fname, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2071, in dl
    return fd.download(name, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/dash.py", line 78, in real_download
    self.report_error('giving up after %s fragment retries' % count)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/common.py", line 175, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 662, in report_error
    self.trouble(*args, **kwargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 614, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

[debug] Invoking downloader on 'https://rr2---sn-4g5lznes.googlevideo.com/videoplayback?expire=1718665474&ei=omxwZvKCJ_iai9oPrPytsAk&ip=47.69.137.137&id=o-AKm1dRgby9sFrDGVX0bJ3KgKGN1PyHSx-q_f9KRGSC_4&itag=249&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zO&mm=31%2C26&mn=sn-4g5lznes%2Csn-f5f7lne6&ms=au%2Conr&mv=m&mvi=2&pl=19&pcm2=yes&initcwndbps=1846250&bui=AbKP-1O3YVe9fGtsxyDHU7TNneKRCgDUDHJwh-mOCN2NGJSkTd1WUBz8ZDI7BYY3UcprCDw-3wyQylOT&spc=UWF9f4QfSfv8_z5FTqrKIgbd1Z6DAne5l6xi3J5VDxJUjQ-o3xFEAi01qfSo&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=yYmogIIQrRok7xzlewj6aUcQ&rqh=1&gir=yes&clen=1161452&dur=191.761&lmt=1718607847881176&mt=1718643418&fvip=5&keepalive=yes&c=WEB&sefc=1&txp=6308224&n=qe5ibzBzTm3VA9bmZa&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAI2_T6krM2pajKeKzXsbDjrszD9mLTIrH02Ms4TWM0FdAiBbGDPlRd7zNnZn86UT1A4xMbQthP6xzZulcyn_HqBJsg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIgNUY_e59Q8v2uPdD5xDihqT72BNgDpYP1DwWLHcSH0UMCIQCzBNlexMB54rPi1BsBVeLCNQxyrz_g9jsimTokpp4HEA%3D%3D'
[dashsegments] Total fragments: 1
[download] Destination: /home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f249.webm
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 1 of 2)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 2 of 2)...
ERROR: giving up after 2 fragment retries
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/__init__.py", line 473, in main
    _real_main(argv)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/__init__.py", line 463, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2227, in download
    res = self.extract_info(
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 852, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 859, in wrapper
    return func(self, *args, **kwargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 966, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 1000, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 1844, in process_video_result
    self.process_info(new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2126, in process_info
    partial_success = dl(fname, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2071, in dl
    return fd.download(name, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/dash.py", line 78, in real_download
    self.report_error('giving up after %s fragment retries' % count)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/common.py", line 175, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 662, in report_error
    self.trouble(*args, **kwargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 614, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
```


and from the youtube-dl-nightly the same type of error

```
[debug] System config: []
[debug] User config: ['--no-mtime', '--match-filter', '!is_live', '--retries', 'infinite', '--fragment-retries', '2', '--skip-unavailable-fragments', '--restrict-filenames', '-i', '-o', '/home/gregorius/home/pending/videos/%(title)s___%(id)s.webm', '-f', '(bestvideo[height<=360]+worstaudio/best[height<=360])[protocol!=http_dash_segments][container!^=dash]', '--console-title', '--hls-prefer-native', '--no-cache-dir', '--http-chunk-size', '100M', '--cookies', '/home/gregorius/home/scripts/video/youtube-dl-cookies']
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=I0EmyNep1pE', '-vf', '(242+249/242+250/242+171/242+251)/(243+249/243+250/243+171/243+251)/18', '--no-playlist']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2024.06.12 [0153b387e] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-112-generic-x86_64-with-glibc2.35 - OpenSSL 3.0.2 15 Mar 2022 - glibc 2.35
[debug] exe versions: ffmpeg 4.4.2, ffprobe 4.4.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] I0EmyNep1pE: Downloading webpage
[youtube] Downloading just video I0EmyNep1pE because of --no-playlist
[youtube] I0EmyNep1pE: Downloading player 590f65a6
WARNING: [youtube] I0EmyNep1pE: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
WARNING: [youtube] I0EmyNep1pE: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
[debug] Invoking downloader on 'https://rr1---sn-4g5edns6.googlevideo.com/videoplayback?expire=1718665573&ei=BW1wZr65K-rD6dsPguar4A4&ip=47.69.137.137&id=o-AGWiYhnnFi2gYwMjiEngFFG_mTkLEY5tw7LLQ8vZOxra&itag=242&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C299%2C302%2C303&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zO&mm=31%2C29&mn=sn-4g5edns6%2Csn-4g5lznes&ms=au%2Crdu&mv=m&mvi=1&pl=19&pcm2=yes&initcwndbps=1705000&bui=AbKP-1OuyfqSvr0ru3007fM3N7DxkqOFTDTFs5Peea0Lbj1kTJE3h_CMSJ_nEb1H8YpyRyYBuAygB1c0&spc=UWF9f1molBRRIO4AR05dXDWq6-AEI-3dzzsNSNboAQbRWJ7bEXUMXYlz-XFX&vprv=1&svpuc=1&mime=video%2Fwebm&ns=ST2xa86mQoTRTzJyy5F-mTgQ&rqh=1&gir=yes&clen=1016042&dur=191.725&lmt=1718607835104876&mt=1718643663&fvip=2&keepalive=yes&c=WEB&sefc=1&txp=630F224&n=e-sOBZGG27nbx3xUSI&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgJW0G2uflvnWao3WKRmrjsLSueCjacv2WU3BUkeMm5cwCIByTIOw4jdAaSVtw4i50PkKIQxEPlt7d6En5cZZ4OFbx&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRgIhANRsG6osuyhOxcD9hxgdSoPuOFleBB9PHSSmqMyEj0qLAiEA8fKD4p4xgzZlk2S6ceZD1QhkOc-mXtjWyg3E1xqxVMg%3D'
[dashsegments] Total fragments: 1
[download] Destination: /home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f242.webm
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 1 of 2)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 2 of 2)...
ERROR: giving up after 2 fragment retries
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/__init__.py", line 473, in main
    _real_main(argv)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/__init__.py", line 463, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2231, in download
    res = self.extract_info(
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 856, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 863, in wrapper
    return func(self, *args, **kwargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 970, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 1004, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 1848, in process_video_result
    self.process_info(new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2130, in process_info
    partial_success = dl(fname, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2075, in dl
    return fd.download(name, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/dash.py", line 78, in real_download
    self.report_error('giving up after %s fragment retries' % count)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/common.py", line 175, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 666, in report_error
    self.trouble(*args, **kwargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 618, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

[debug] Invoking downloader on 'https://rr1---sn-4g5edns6.googlevideo.com/videoplayback?expire=1718665573&ei=BW1wZr65K-rD6dsPguar4A4&ip=47.69.137.137&id=o-AGWiYhnnFi2gYwMjiEngFFG_mTkLEY5tw7LLQ8vZOxra&itag=249&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zO&mm=31%2C29&mn=sn-4g5edns6%2Csn-4g5lznes&ms=au%2Crdu&mv=m&mvi=1&pl=19&pcm2=yes&initcwndbps=1705000&bui=AbKP-1OuyfqSvr0ru3007fM3N7DxkqOFTDTFs5Peea0Lbj1kTJE3h_CMSJ_nEb1H8YpyRyYBuAygB1c0&spc=UWF9f1molBRRIO4AR05dXDWq6-AEI-3dzzsNSNboAQbRWJ7bEXUMXYlz-XFX&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=ST2xa86mQoTRTzJyy5F-mTgQ&rqh=1&gir=yes&clen=1161452&dur=191.761&lmt=1718607847881176&mt=1718643663&fvip=2&keepalive=yes&c=WEB&sefc=1&txp=6308224&n=e-sOBZGG27nbx3xUSI&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgeVy4plOeya9-a-P6aLWEhRr1WfGSZytZhUt3puSuQEECIGFUyjsOSHpyUaNn6Otxq-GYH4_zOBhjh-v6ceKe4IZi&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRgIhANRsG6osuyhOxcD9hxgdSoPuOFleBB9PHSSmqMyEj0qLAiEA8fKD4p4xgzZlk2S6ceZD1QhkOc-mXtjWyg3E1xqxVMg%3D'
[dashsegments] Total fragments: 1
[download] Destination: /home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f249.webm
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 1 of 2)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 2 of 2)...
ERROR: giving up after 2 fragment retries
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/__init__.py", line 473, in main
    _real_main(argv)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/__init__.py", line 463, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2231, in download
    res = self.extract_info(
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 856, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 863, in wrapper
    return func(self, *args, **kwargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 970, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 1004, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 1848, in process_video_result
    self.process_info(new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2130, in process_info
    partial_success = dl(fname, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2075, in dl
    return fd.download(name, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/dash.py", line 78, in real_download
    self.report_error('giving up after %s fragment retries' % count)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/downloader/common.py", line 175, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 666, in report_error
    self.trouble(*args, **kwargs)
  File "/home/gregorius/home/scripts/video/youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 618, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
```

## Description

<!--
Provide an explanation of your issue in an arbitrary form. Provide any additional information, suggested solution and as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

using both youtube-dl and youtube-dl-nightly as compiled from their respective github master repos!

Error 403 when downloading from youtube, resetting cookies and grabbing new cookies did not solve it this time. It worked like 3 hours or so ago, though i DID have issues two days ago where I could fix it myself with the cookie reset. Them Googel Devs trying to mess with downloaders and ad blockers again, I'm guessing.

Extra Info, VPN in Canada does not help, so I am certain this is not only a Germany Issue.


Discussion / hints:
I'm seeing the same error, same version (installed directly from repo), 

Verbose logs:
```
$ youtube-dl --verbose https://www.youtube.com/watch?v=Di42xlwKNpM
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.youtube.com/watch?v=Di42xlwKNpM']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-112-generic-x86_64-with-glibc2.35 - OpenSSL 3.0.2 15 Mar 2022 - glibc 2.35
[debug] exe versions: ffmpeg 4.4.2, ffprobe 4.4.2
[debug] Proxy map: {}
[youtube] Di42xlwKNpM: Downloading webpage
WARNING: [youtube] Di42xlwKNpM: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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 "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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.
)
WARNING: [youtube] Di42xlwKNpM: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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 "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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.
)
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://rr1---sn-x1xe7n76.googlevideo.com/videoplayback?expire=1718666275&ei=w29wZvOkAqCOobIPu5u3yAU&ip=181.117.11.18&id=o-AMTwa_TiFGo1qIev-PWUemETHTPUfEFf5jaqu9FZSnGq&itag=136&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=bR&mm=31%2C29&mn=sn-x1xe7n76%2Csn-x1x7dnez&ms=au%2Crdu&mv=m&mvi=1&pl=22&initcwndbps=825000&bui=AbKP-1NAIffWqRbWB2NuJSNiN9smnQRcS1yK11iBNt5XINpC3S5YLwv35pyc3DvjW5LelFIDUH6iM_xE&spc=UWF9fzzcNRdprxblYrh4aLGVwO1OKJEEmISWPFlgQngg1SS6owxJS9wEFw9V&vprv=1&svpuc=1&mime=video%2Fmp4&ns=eT0GHgT7XoDfPw6-aNMW3lEQ&rqh=1&gir=yes&clen=80080955&dur=2247.041&lmt=1718537359256407&mt=1718644382&fvip=5&keepalive=yes&c=WEB&sefc=1&txp=5309224&n=TPAiQsgP23jKbn51DN&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRgIhAPGt-d411vDGWdAVIR8GylNywF_AzCbG8OdQx4PBnLUJAiEArFOtCgKxeeG7Bjr-A0mqPGqDw9JAA6OMfhsW38QmpBI%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIhALOu__tKd8Wtns3dzC8tcIwRYLMI1mcV9IL78XBVvRD_AiA3qHoAUy6eyNliBv_Ve1U-rEKTq4B-oY9eLkIT8MSRTw%3D%3D'
[dashsegments] Total fragments: 8
[download] Destination: David Byrne, bicicletas, Piramidal, Charli XCX y periodistas en el cine-Di42xlwKNpM.f136.mp4
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 1 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 2 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 3 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 4 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 5 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 6 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 7 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 8 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 9 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 10 of 10)...
ERROR: giving up after 10 fragment retries
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/bin/youtube-dl", line 8, in <module>
    sys.exit(main())
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/__init__.py", line 473, in main
    _real_main(argv)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/__init__.py", line 463, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 2227, in download
    res = self.extract_info(
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 852, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 859, in wrapper
    return func(self, *args, **kwargs)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 966, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 1000, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 1844, in process_video_result
    self.process_info(new_info)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 2126, in process_info
    partial_success = dl(fname, new_info)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 2071, in dl
    return fd.download(name, new_info)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/downloader/dash.py", line 78, in real_download
    self.report_error('giving up after %s fragment retries' % count)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/downloader/common.py", line 175, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 662, in report_error
    self.trouble(*args, **kwargs)
  File "/home/facundo/.local/share/fades/e8e62b47-d978-4f96-89e3-044007ddde30/lib/python3.10/site-packages/youtube_dl/YoutubeDL.py", line 614, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
```

Wait NOW it is working again, i just tested YOUR youtube link and it works now with mine too...
> Wait NOW it is working again, i just tested YOUR youtube link and it works now with mine too...

Do you have the verbose log from when it worked? Do you know if it was using the same player id `590f65a6`?

A couple of videos I am trying to pull are not pulling at the moment with this error and using the same player Id as your verbose log for the failure, `590f65a6`.
No I dont have it but I can MAKE ONE! *redownloads video*

```
[debug] System config: []
[debug] User config: ['--no-mtime', '--match-filter', '!is_live', '--retries', 'infinite', '--fragment-retries', '2', '--skip-unavailable-fragments', '--restrict-filenames', '-i', '-o', '/home/gregorius/home/pending/videos/%(title)s___%(id)s.webm', '-f', '(bestvideo[height<=360]+worstaudio/best[height<=360])[protocol!=http_dash_segments][container!^=dash]', '--console-title', '--hls-prefer-native', '--no-cache-dir', '--http-chunk-size', '100M', '--cookies', '/home/gregorius/home/scripts/video/youtube-dl-cookies']
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=I0EmyNep1pE', '-vf', '(242+249/242+250/242+171/242+251)/(243+249/243+250/243+171/243+251)/18', '--no-playlist']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2024.06.12 [0153b387e] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-112-generic-x86_64-with-glibc2.35 - OpenSSL 3.0.2 15 Mar 2022 - glibc 2.35
[debug] exe versions: ffmpeg 4.4.2, ffprobe 4.4.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] I0EmyNep1pE: Downloading webpage
[youtube] Downloading just video I0EmyNep1pE because of --no-playlist
[youtube] I0EmyNep1pE: Downloading player 84314bef
[debug] [youtube] Decrypted nsig Q8M2qqYzwfYVCSffYx => H5Oh-7-CbNUKzg
[debug] [youtube] Decrypted nsig mry5phGrNQ4Z-140dA => 9V0Qv9eOFODk5g
[debug] Invoking downloader on 'https://rr2---sn-4g5lznes.googlevideo.com/videoplayback?expire=1718667532&ei=rHRwZomwDLXE6dsP7p-FgAI&ip=47.69.137.137&id=o-AKVn8Xp4mFVDiSw6Xqxu_ltPK2qfKGBx-mg37TKGjQWT&itag=242&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C278%2C298%2C299%2C302%2C303&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zO&mm=31%2C26&mn=sn-4g5lznes%2Csn-f5f7lne6&ms=au%2Conr&mv=m&mvi=2&pl=19&pcm2=yes&initcwndbps=1607500&bui=AbKP-1NHA94gcB9G6dDwG2Jqpb8Dwscp6kPFC9tVS3PeyuM9AnupAXjNuTzZsR1QV7ob2Y8ALRn369yK&spc=UWF9fySpyqOECqZK2l0FsHX9SwfHSlfVv54BD9k_2xw1v6r3g1LmYqpSFXRN&vprv=1&svpuc=1&mime=video%2Fwebm&ns=oQ47xPQq799NE5PjYPO0OcYQ&rqh=1&gir=yes&clen=1016042&dur=191.725&lmt=1718607835104876&mt=1718645576&fvip=5&keepalive=yes&c=WEB&sefc=1&txp=630F224&n=9V0Qv9eOFODk5g&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgTwJOodNmtkabWPyUOUuaOQHgGT11pR90l5fIKDloXqYCIQDit2olRgTA7G2gTFU19aRZX4P5lyyhS6qTlDXk7STPKQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIgKx6HGCFPgy4n0hfh638Ln4W-jtgITXZ6wbXmtfNzviACIQDdcitWojgz7QBWLHvNg4563ymSW1uQxL960iT5TAKnQw%3D%3D'
[dashsegments] Total fragments: 1
[download] Destination: /home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f242.webm
[download] 100% of 992.23KiB in 00:00
[debug] Invoking downloader on 'https://rr2---sn-4g5lznes.googlevideo.com/videoplayback?expire=1718667532&ei=rHRwZomwDLXE6dsP7p-FgAI&ip=47.69.137.137&id=o-AKVn8Xp4mFVDiSw6Xqxu_ltPK2qfKGBx-mg37TKGjQWT&itag=249&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zO&mm=31%2C26&mn=sn-4g5lznes%2Csn-f5f7lne6&ms=au%2Conr&mv=m&mvi=2&pl=19&pcm2=yes&initcwndbps=1607500&bui=AbKP-1NHA94gcB9G6dDwG2Jqpb8Dwscp6kPFC9tVS3PeyuM9AnupAXjNuTzZsR1QV7ob2Y8ALRn369yK&spc=UWF9fySpyqOECqZK2l0FsHX9SwfHSlfVv54BD9k_2xw1v6r3g1LmYqpSFXRN&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=oQ47xPQq799NE5PjYPO0OcYQ&rqh=1&gir=yes&clen=1161452&dur=191.761&lmt=1718607847881176&mt=1718645576&fvip=5&keepalive=yes&c=WEB&sefc=1&txp=6308224&n=9V0Qv9eOFODk5g&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cpcm2%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgG8BruVg_fAUCrYbyCRmJ79AxjhHN4WaqNAxTIczItH0CIQCFtjJ11spRyfsE3h43xTJjW4p17e-Dq2CpOW9dn2tlFA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIgKx6HGCFPgy4n0hfh638Ln4W-jtgITXZ6wbXmtfNzviACIQDdcitWojgz7QBWLHvNg4563ymSW1uQxL960iT5TAKnQw%3D%3D'
[dashsegments] Total fragments: 1
[download] Destination: /home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f249.webm
[download] 100% of 1.11MiB in 00:00
[ffmpeg] Merging formats into "/home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.webm"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i file:/home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f242.webm -i file:/home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f249.webm -c copy -map 0:v:0 -map 1:a:0 file:/home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.temp.webm
Deleting original file /home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f242.webm (pass -k to keep)
Deleting original file /home/gregorius/home/pending/videos/This_Guy_Uses_ROOK___I0EmyNep1pE.f249.webm (pass -k to keep)
```

> Downloading player 590f65a6

Yeah, it looks like it changed to a different player ID when it worked.

Player Id when error: 590f65a6
Player Id when work: 84314bef
We can acquire the [problem player JS](https://www.youtube.com/s/player/590f65a6/player_ias.vflset/en_US/base.js) and find out what feature breaks the n-sig descrambling. If this is a roll-out to `590f65a6` doing so becomes important. If not, it's for the back-burner in case YT does the same again.
Indeed, I am getting `590f65a6` in the UK.

As usual there is the definition of <details><summary>the pointless obfuscated descrambling function</summary>

```js
Ima=function(a){var b=a.split(""),c=[481196748,function(d,e){d.splice(d.length,0,e)},
-1184122307,-1844585791,-1517999176,-1838315746,-391786256,function(d,e,f,h,l){return e(f,h,l)},
311082973,777402095,-513835569,-1517999176,b,777402095,b,function(d,e){e.length!=0&&(d=(d%e.length+e.length)%e.length,e.splice(0,1,e.splice(d,1,e[0])[0]))},
"/([\\/,[",function(d,e){d.push(e)},
1836568272,",54];c[51]=c;",-132471649,function(d,e,f,h,l,m,n,p,q){return f(h,l,m,n,p,q)},
2099923865,-1844585791,function(d,e,f,h,l,m,n,p){return e(f,h,l,m,n,p)},
-1177328935,1637869400,1340863434,1591384456,function(d){throw d;},
-893696909,-1785346148,186785386,512500232,976315399,55621845,function(d,e,f,h,l,m,n){return d(l,m,n)},
1968846220,-120562974,1415280244,function(){for(var d=64,e=[];++d-e.length-32;){switch(d){case 91:d=44;continue;case 123:d=65;break;case 65:d-=18;continue;case 58:d=96;continue;case 46:d=95}e.push(String.fromCharCode(d))}return e},
-1617495598,null,function(d){d.reverse()},
function(d,e){e=(e%d.length+d.length)%d.length;d.splice(e,1)},
-439060673,2108931577,function(d,e,f){var h=d.length;e.forEach(function(l,m,n){this.push(n[m]=d[(d.indexOf(l)-d.indexOf(this[m])+m+h--)%d.length])},f.split(""))},
-206894781,"o6LTxqq",-530102236,-785373294,function(d,e,f,h,l,m){return e(h,l,m)},
null,null,1096979497,"\u2210]}(/",1867530696,196808569,-1759560780,-120562974,-939717184,1123017595,function(){for(var d=64,e=[];++d-e.length-32;)switch(d){case 58:d=96;continue;case 91:d=44;break;case 65:d=47;continue;case 46:d=153;case 123:d-=58;default:e.push(String.fromCharCode(d))}return e},
976315399,886367998,1481614131,-1632737085,1506052226,-1259426209,function(d){for(var e=d.length;e;)d.push(d.splice(--e,1)[0])},
function(d,e){e=(e%d.length+d.length)%d.length;d.splice(-e).reverse().forEach(function(f){d.unshift(f)})},
-963596628,1599531971,1653761992,193670587,-565480227,b,-1733454587,function(){for(var d=64,e=[];++d-e.length-32;){switch(d){case 58:d-=14;case 91:case 92:case 93:continue;case 123:d=47;case 94:case 95:case 96:continue;case 46:d=95}e.push(String.fromCharCode(d))}return e},
-147499041,-414478713,444508829,302113098,2140193951,714051216,1812860928,function(){for(var d=64,e=[];++d-e.length-32;)switch(d){case 46:d=95;default:e.push(String.fromCharCode(d));case 94:case 95:case 96:break;case 123:d-=76;case 92:case 93:continue;case 58:d=44;case 91:}return e},
function(d,e){if(d.length!=0){e=(e%d.length+d.length)%d.length;var f=d[0];d[0]=d[e];d[e]=f}},
function(d,e){for(d=(d%e.length+e.length)%e.length;d--;)e.unshift(e.pop())},
-949341690,-2000214115,2049985941];c[42]=c;c[53]=c;c[54]=c;try{try{c[84]<6?((0,c[44])(c[new Date("1969-12-31T14:45:53.000-09:15")/1E3],c[62]),c[71])(c[Math.pow(2,2)+7600-7592],c[new Date("1970-01-01T09:01:20.000+09:00")/1E3]):((0,c[88])(c[42],c[0]),(0,c[88])(c[0],c[28])),(0,c[7])(((0,c[29])(c[77]),c[47])((0,c[63])(),c[14],c[49]),c[11+Math.pow(6,new Date("1970-01-01T05:15:02.000+05:15")/1E3)-3],c[76],c[26])}catch(d){c[54]>new Date("1970-01-01T07:00:00.000+07:00")/1E3&&(c[51]>-9||((0,c[52])((0,c[43])(c[12]),
c[15],(0,c[89])(c[86],c[53]),c[22],c[66]),(0,c[71])((0,c[10])(),c[8],c[73]),0))&&(((0,c[31])((0,c[71])((0,c[10])(),c[36],c[73]),c[1],c[77]),c[19])(c[66],c[57]),c[71])((0,c[18])(),c[8],c[73]),c[72]===7?(0,c[48])(((0,c[68])(c[8],c[79]),c[68])(c[38],c[62]),c[76],(0,c[68])(c[8],c[4]),c[20],(0,c[71])((0,c[18])(),c[38],c[73]),c[44],c[Math.pow(1,1)-7200+7235]):(0,c[76])((0,c[68])(c[38],c[3])+(0,c[1])(c[8]),c[20],(0,c[31])((0,c[19])(c[7],c[42]),c[20],c[63],c[8]),c[29],c[66]),c[72]>=9?(0,c[70])(c[10],c[83]):
(0,c[188%Math.pow(4,4)-118])(c[10],c[25]),c[14]>9?((0,c[70])(c[40],c[30+Math.pow(6,1)- -31]),c[73])((0,c[2])(),c[10],c[75]):(0,c[33])((0,c[4])(c[68],c[89]),c[40],c[29],c[70]),c[79]==-1?(0,c[52])((0,c[40])(c[57],c[33]),c[22-Math.pow(7,1)- -74],c[57],c[72]):((0,c[60])(c[53],c[Math.pow(6,2)-69+38]),c[88])(c[59])}finally{c[55]===-8+Math.pow(4,3)%17?((((0,c[52])((0,c[41])(c[45],c[28]),c[89],c[57],c[79]),c[-503+105*Math.pow(5,1)])(c[new Date("1970-01-01T05:16:27.000+05:15")/1E3]),c[40])(c[29],c[26]),c[92])((0,c[31])(),
c[29],c[1]):(0,c[52])(((0,c[4])((0,c[41])(c[new Date("1969-12-31T21:16:17.000-02:45")/1E3],c[59]),c[Math.pow(3,4)+-31725- -31704],(0,c[88])(c[5]),c[56],c[35]),c[70])(c[64]),c[40],c[28],c[67])}try{c[3]==-5&&((0,c[89])(c[29],c[35]),"NaN")||(0,c[88])(c[28]),c[42]<5&&(c[73]<=0||(((0,c[51])(c[82],c[63]),c[52])(c[87],c[2]),""))&&(0,c[40])((0,c[32])(c[new Date("1970-01-01T05:01:05.000+05:00")/1E3],c[64]),c[3],c[63],c[41]),(0,c[18])(c[87]),(0,c[40])((0,c[53])(),c[63],c[91]),(0,c[40])((0,c[53])(),c[35],c[91])}catch(d){c[57]!==
8&&(c[60-196%Math.pow(1,4)]>=59-Math.pow(1,2)+-50||((0,c[26])((0,c[0])((0,c[69])(c[33],c[58])|(0,c[0])((0,c[69])(c[87],c[62]),c[64],c[5],c[88]),c[38],c[69]),(0,c[85])(c[22],c[5]),c[57],(0,c[19])(c[72],c[32]),c[0],(0,c[19])(c[2],c[33]),c[46],c[6]),0))&&((((0,c[new Date("1970-01-01T06:30:13.000+06:30")/1E3])((0,c[26])(),c[6],c[65]),c[24])(c[17],c[38]),((0,c[13])((0,c[74])(),c[37],c[65]),c[25])(c[38],c[47]),c[62])((0,c[70])(c[6],c[64]),c[43],(0,c[13])((0,c[74])(),c[37],c[65]),c[6],c[16]),c[13])((0,c[74])(),
c[37],c[65]),c[57]!=4&&(c[51]==-7&&((0,c[24])(c[10],c[72]),1)||(0,c[24])(c[83],c[37]))}finally{c[49]>=4&&(c[22]!==-9?((0,c[78])(c[5],(0,c[25])(c[6],c[66]),(0,c[5])(c[28],c[8]),(0,c[44])(c[37]),c[53],c[38]),c[67])((0,c[-62-Math.pow(7,1)*-19])(c[6]),c[70],c[6],c[Math.pow(5,5)+-65280- -62178]):((0,c[67])(((((0,c[35-Math.pow(8,2)+42])((0,c[74])(),c[8],c[65]),c[70])(c[37],c[64]),c[70])(c[38],c[84]),c[25])(c[Math.pow(4,1)-16+73],c[48]),c[13],(0,c[45])(),c[6],c[65]),c[70])(c[37],c[63]))}try{c[68]!=9&&(c[29]==
-9||(((0,c[67])((0,c[19])(c[61],c[75]),c[24],c[68],c[38]),c[48])(c[38]),null))&&(((0,c[73])(c[Math.pow(8,1)*-149+1237]),c[47])(c[20-308%Math.pow(4,2)],c[68]),c[47])(c[80],c[38])}catch(d){(0,c[46])(c[16])}}catch(d){return"enhanced_except_r5sB0OT-_w8_"+a}return b.join("")};
```
</details>

and a pointless redirection
```js
var HRa=[Ima];
```
and the code that calls the descrambler (`b` is the n-parameter)
```js
a.D&&(b=a.get("n"))&&(b=HRa[0](b),a.set("n",b),HRa.length||Ima(""))
```
Presumably the children who committed this nonsense bike or EV and search out "environmentally-friendly" products and yet they acquiesce in the waste of electricity by their billions of users who aren't savvy enough to avoid YT's JS.

I have the same trouble
I'm getting this error too:
```
$ ../youtube-dl --verbose --format=18 "https://www.youtube.com/watch?v=qCvqZPf3smI" -r 100k
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--format=18', 'https://www.youtube.com/watch?v=qCvqZPf3smI', '-r', '100k']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2024.06.12 [0153b387e] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 3.10.7 (CPython x86_64 64bit) - Linux-6.8.8-gnu-x86_64-with-glibc2.35 - OpenSSL 3.0.8 7 Feb 2023 - glibc 2.35
[debug] exe versions: ffmpeg 6.1.1, ffprobe 6.1.1
[debug] Proxy map: {}
[youtube] qCvqZPf3smI: Downloading webpage
WARNING: [youtube] qCvqZPf3smI: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
WARNING: [youtube] qCvqZPf3smI: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
[debug] Invoking downloader on 'https://rr3---sn-o097znsk.googlevideo.com/videoplayback?expire=1718680265&ei=aaZwZqXEFOzosfIPlrCj8Ac&ip=192.147.44.15&id=o-AHrcaP0CtzSnhKK9oCPswB0Mgb7D6ioDlGdDoDhrOaCu&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=94&mm=31%2C29&mn=sn-o097znsk%2Csn-n4v7snlr&ms=au%2Crdu&mv=m&mvi=3&pl=24&initcwndbps=7681250&bui=AbKP-1M6Y7_ZJfPtf6HeYtQ6JCt6coBSpmC_6-A1Q-mt7m43HVsvsTl6vmKv_usr3-c0DJ_Et_Uq9F0Y&spc=UWF9f-OGHzvs3XPOTMgbQkX5jhJBdo3PYjZizrDhGRfy8VsyLXnB5FqbITzh&vprv=1&svpuc=1&mime=video%2Fmp4&ns=uviRDdrPrAaNvd34t5_kJscQ&rqh=1&gir=yes&clen=270741677&ratebypass=yes&dur=7915.659&lmt=1718385543727535&mt=1718658290&fvip=1&c=WEB&sefc=1&txp=7209224&n=Y3iqaxF9noQUd0eCCw&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRQIhAPWrdP6or4ois_TBf9OlL5g1Q-R2o2SnJYproScqiI3kAiAJ9L7pNtWcUeqnW65qk6E4SrWRTn0YYBUcNnOtkB8jiA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIgWJIrtReMtuOiz5K9NdOIimcW_SgSFGAnQuF8XGkAle0CIQDkOkAi54SfNQcsxDS7j25Rikjar0hW_Dp2cmmlpndoqw%3D%3D'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/YoutubeDL.py", line 2136, in process_info
    success = dl(filename, info_dict)
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/YoutubeDL.py", line 2075, in dl
    return fd.download(name, new_info)
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/downloader/http.py", line 349, in real_download
    establish_connection()
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/downloader/http.py", line 116, in establish_connection
    raise err
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/downloader/http.py", line 110, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/home/zacchae/tmp/vids/../youtube-dl/youtube_dl/YoutubeDL.py", line 2474, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
```
Is there a work around?
I'm getting same error (same problematic player ID `590f65a6`):

```
$ youtube-dl --verbose -f251 youtu.be/nVmaUlPHEuc
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '-f251', 'youtu.be/nVmaUlPHEuc']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: be008e657
[debug] Python 3.12.3 (CPython x86_64 64bit) - Linux-6.8.0-35-generic-x86_64-with-glibc2.39 - OpenSSL 3.0.13 30 Jan 2024 - glibc 2.39
[debug] exe versions: ffmpeg 6.1.1, ffprobe 6.1.1
[debug] Proxy map: {}
WARNING: The url doesn't specify the protocol, trying with http
[youtube] nVmaUlPHEuc: Downloading webpage
WARNING: [youtube] Unable to decode n-parameter: download likely to be throttled (Unhandled exception in decode; 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 "/home/ek/PycharmProjects/youtube-dl/youtube_dl/extractor/youtube.py", line 1677, in _n_descramble
    raise ExtractorError('Unhandled exception in decode')
youtube_dl.utils.ExtractorError: Unhandled exception in decode; 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.
)
[debug] Invoking downloader on 'https://rr1---sn-a5mlrnll.googlevideo.com/videoplayback?expire=1718687135&ei=P8FwZvr9Gb6psfIPo7q_kAU&ip=2600%3A8801%3A7100%3A1b1%3A94b8%3A1124%3A8247%3Aae96&id=o-AN1qHbHALflbpvUnAAQVR05d8gXcRM0RmPfUHH5S-ZHS&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=Y2&mm=31%2C29&mn=sn-a5mlrnll%2Csn-a5meknzk&ms=au%2Crdu&mv=m&mvi=1&pl=44&initcwndbps=1745000&bui=AbKP-1O6ytsgDa3rSOv-UVcs5eR_fP4hqDYlqTD_ZBtlIdk-raYV3EjT7ByG_luTKJmBbh4B5o1rk7B9&spc=UWF9f9rYu_d5FgsWpssUxk1-1bKcFzjGUteTdHiSPLRyGPisXl-PTu9LedSx&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=O6oxW6O2iJoYIKaCPusXVS8Q&rqh=1&gir=yes&clen=79400050&dur=4440.061&lmt=1696726699824311&mt=1718665260&fvip=2&keepalive=yes&c=WEB&sefc=1&txp=4532434&n=bDlmQuYiHQDaGLz2Vd&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgWZwcc6vchS9j7TJqT0KPhk66Xxo7MgR6jwZmujF4jIICIBJi-aZfzgcq1DEWPZh5ahBdQxhMzb2iq9gSYTBXkqIs&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRgIhAOO6xH7uiXRJ5iOBAWrWt-cwxhE_7LKYQcHjmhmTc_4uAiEAx7NgWb3BcVKqy6HSNqS761qtpuja_f0TK9FPSIKHYV0%3D'
[dashsegments] Total fragments: 8
[download] Destination: Shigatsu wa Kimi no Uso (Your Lie in April) OST - Disc 1 [Marathon]-nVmaUlPHEuc.webm
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 1 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 2 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 3 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 4 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 5 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 6 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 7 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 8 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 9 of 10)...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 10 of 10)...
ERROR: giving up after 10 fragment retries
  File "/home/ek/bin/youtube-dl", line 8, in <module>
    sys.exit(main())
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/__init__.py", line 473, in main
    _real_main(argv)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/__init__.py", line 463, in _real_main
    retcode = ydl.download(all_urls)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 2218, in download
    res = self.extract_info(
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 852, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 859, in wrapper
    return func(self, *args, **kwargs)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 966, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 1004, in process_ie_result
    return self.extract_info(ie_result['url'],
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 852, in extract_info
    return self.__extract_info(url, ie, download, extra_info, process)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 859, in wrapper
    return func(self, *args, **kwargs)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 966, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 1000, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 1835, in process_video_result
    self.process_info(new_info)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 2123, in process_info
    success = dl(filename, info_dict)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 2062, in dl
    return fd.download(name, new_info)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/downloader/dash.py", line 73, in real_download
    self.report_error('giving up after %s fragment retries' % count)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/downloader/common.py", line 175, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 662, in report_error
    self.trouble(*args, **kwargs)
  File "/home/ek/PycharmProjects/youtube-dl/youtube_dl/YoutubeDL.py", line 614, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
```
I was mucking around and got a different player ID `84314bef` once (pure luck, or pure unluck because that opportunity was lost on the `-F` query ;_;); all the other 100+ attempts returned the same problematic player ID `590f65a6`.  I believe it is safe to assume that a rollout is in progress.
A brute-force workaround:

```diff
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 3bf483c1c..87fb14124 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1472,6 +1472,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                 break
         else:
             raise ExtractorError('Cannot identify player %r' % player_url)
+        player_id = id_m.group('id')
+        assert player_id != '590f65a6'
         return id_m.group('id')

     def _get_player_code(self, video_id, player_url, player_id=None):
@@ -1680,6 +1682,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                 self._downloader.to_screen('[debug] [%s] %s' % (self.IE_NAME, 'Decrypted nsig {0} => {1}'.format(n_param, self._player_cache[sig_id])))
             return self._player_cache[sig_id]
         except Exception as e:
+            raise
             self._downloader.report_warning(
                 '[%s] %s (%s %s)' % (
                     self.IE_NAME,
```

And run youtube-dl until it succeeds:

```sh
while ! youtube-dl -f251 --verbose https://youtu.be/nVmaUlPHEuc; do sleep 1; done
```

At least this worked for me, with 50+ retries.  🤣
I'm getting same error, how to fix it elegantly
Is there a way to get a specific player in ytdl? That would probably be helpful. Also I got the  bad player RNG again...
maybe the trouble is related to https://techcrunch.com/2024/06/16/youtube-is-testing-another-way-to-combat-ad-blockers/
Ironically, a page that doesn't display without a pointless interstitial page.

It's not clear how what TC describes would be having this effect.

There are two issues:
* failing to descramble the n-parameter, which should be fixable
* getting 403 instead of throttling when the descrambling fails -- will that also happen with the descrambled URL?

At yt-dlp, people have observed getting [403 with Web formats when using browser cookies](https://github.com/yt-dlp/yt-dlp/issues/10046), but not generally without cookies, unless YT bans your data centre, VPN, or bulk downloading IP address.


Need me to do something? I got the Issue again, with the same Player, so I might be able to reproduce it again if need be, unless youtube randomly decides to give me a working player again.
The descrambling problem is a parsing error that will be patched soon.

As to "getting 403 with Web formats when using browser cookies", I can't see any reason why that should succeed when it fails with yt-dlp. Review the linked yt-dlp issue (and its related issues) for guidance.

Maybe we'll be able pull the experimental OAuth2 implementation from https://github.com/coletdjnz/yt-dlp-youtube-oauth2.
Wait you said web formats? does the mp4 format at ID 18 count as that?

Also I did wipe the cookies File in my case, it was a File I needed a few months/years ago to get youtubedl to work at all.
```
==========================
TESTING NORMAL YOUTUBE-DL:
==========================


[debug] System config: []
[debug] User config: ['--no-mtime', '--match-filter', '!is_live', '--retries', 'infinite', '--fragment-retries', '2', '--skip-unavailable-fragments', '--restrict-filenames', '-i', '-o', '/home/gregorius/home/pending/videos/%(title)s___%(id)s.webm', '-f', '(bestvideo[height<=360]+worstaudio/best[height<=360])[protocol!=http_dash_segments][container!^=dash]', '--console-title', '--hls-prefer-native', '--no-cache-dir', '--http-chunk-size', '100M', '--cookies', '/home/gregorius/home/scripts/video/youtube-dl-cookies']
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=I0EmyNep1pE', '-vf', '18', '--no-playlist', '-o', '/home/gregorius/home/scripts/video/TEST_NORMAL_%(title)s___%(id)s.webm']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Single file build
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-112-generic-x86_64-with-glibc2.35 - OpenSSL 3.0.2 15 Mar 2022 - glibc 2.35
[debug] exe versions: ffmpeg 4.4.2, ffprobe 4.4.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] I0EmyNep1pE: Downloading webpage
[youtube] Downloading just video I0EmyNep1pE because of --no-playlist
[youtube] I0EmyNep1pE: Downloading player 590f65a6
WARNING: [youtube] I0EmyNep1pE: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
WARNING: [youtube] I0EmyNep1pE: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
[debug] Invoking downloader on 'https://rr1---sn-4g5edns6.googlevideo.com/videoplayback?expire=1718743429&ei=JZ1xZsexE_TPi9oPhqGUmAw&ip=47.69.137.137&id=o-ALpP8_kfzlAoOw4OghmoqjXRForiH0Sq2MSj6etIKepD&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zO&mm=31%2C26&mn=sn-4g5edns6%2Csn-f5f7lne6&ms=au%2Conr&mv=m&mvi=1&pl=19&initcwndbps=1608750&bui=AbKP-1OaqwPYcHbvgkOW_dF3v8n5-JoiKYXx2azwutwpyoRKfjnerSNcMqtNB9yDKmTsMBH5mk4fkbxe&spc=UWF9fxLno6Zu2tOYOM82-ZIS0ERcWPQYRsTA-_6zGaegxbD0BjUGxsiRsk_5&vprv=1&svpuc=1&mime=video%2Fmp4&ns=hobLoLXK120Bm1r7fCpNi6EQ&rqh=1&gir=yes&clen=4071365&ratebypass=yes&dur=191.796&lmt=1718607831904259&mt=1718721412&fvip=5&c=WEB&sefc=1&txp=6309224&n=eVGeGrQ4clzgWXjUQU&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRAIgcEPNINjUgTO2mQtU4PyTEeImVLz3CppSnmrb2rPHJR8CICMO3c6HBHuO_7vUwPZeUFia_zp4b6VbpIV9FT6sdTBc&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIhAI-e1T-chmIZNaAODqhlp4ri_qBY_2wMrba0j13M1_iTAiALMdun_YI9k8ypoox8lCPWj6D4_HJiP_zmvVUmwkY3qA%3D%3D'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/YoutubeDL.py", line 2132, in process_info
    success = dl(filename, info_dict)
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/YoutubeDL.py", line 2071, in dl
    return fd.download(name, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/downloader/http.py", line 349, in real_download
    establish_connection()
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/downloader/http.py", line 116, in establish_connection
    raise err
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/downloader/http.py", line 110, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/home/gregorius/home/scripts/video/youtube-dl-normal/youtube-dl/youtube_dl/YoutubeDL.py", line 2470, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/usr/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden



===========================
TESTING NIGHTLY YOUTUBE-DL:
===========================


[debug] System config: []
[debug] User config: ['--no-mtime', '--match-filter', '!is_live', '--retries', 'infinite', '--fragment-retries', '2', '--skip-unavailable-fragments', '--restrict-filenames', '-i', '-o', '/home/gregorius/home/pending/videos/%(title)s___%(id)s.webm', '-f', '(bestvideo[height<=360]+worstaudio/best[height<=360])[protocol!=http_dash_segments][container!^=dash]', '--console-title', '--hls-prefer-native', '--no-cache-dir', '--http-chunk-size', '100M', '--cookies', '/home/gregorius/home/scripts/video/youtube-dl-cookies']
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=I0EmyNep1pE', '-vf', '18', '--no-playlist', '-o', '/home/gregorius/home/scripts/video/TEST_NIGHTLY_%(title)s___%(id)s.webm']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2024.06.12 [0153b387e] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-112-generic-x86_64-with-glibc2.35 - OpenSSL 3.0.2 15 Mar 2022 - glibc 2.35
[debug] exe versions: ffmpeg 4.4.2, ffprobe 4.4.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] I0EmyNep1pE: Downloading webpage
[youtube] Downloading just video I0EmyNep1pE because of --no-playlist
[youtube] I0EmyNep1pE: Downloading player 590f65a6
WARNING: [youtube] I0EmyNep1pE: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
WARNING: [youtube] I0EmyNep1pE: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
youtube_dl.jsinterp.JSInterpreter.Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
[debug] Invoking downloader on 'https://rr2---sn-4g5lznes.googlevideo.com/videoplayback?expire=1718743435&ei=K51xZpCsHsWFi9oPyPGJmAU&ip=47.69.137.137&id=o-AMJwsnXuS5Sj_IxmcMfEG9jb2QL7ZZDmOcT52yff_gQy&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zO&mm=31%2C29&mn=sn-4g5lznes%2Csn-4g5edns6&ms=au%2Crdu&mv=m&mvi=2&pl=19&initcwndbps=1551250&bui=AbKP-1Mt1GYyAFk4RQokMazLpBZmh669se4lCe2MabcVCM-adEbQLktkvmVSpBTnpEJxsMgvMcnvChih&spc=UWF9f1mpWhpaiqMPXn-i1OhoT70i4fn_FIjU9oysFRLUCeCPkll2jujR_SE3&vprv=1&svpuc=1&mime=video%2Fmp4&ns=XTh292yl-K0JCktb9QQ9hFgQ&rqh=1&gir=yes&clen=4071365&ratebypass=yes&dur=191.796&lmt=1718607831904259&mt=1718721672&fvip=1&c=WEB&sefc=1&txp=6309224&n=cUQ1Yq2Psv9Sk8RY8p&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRQIgLxo5vNb8qwAJYT_Xf1NNY6H9DRt1valskQ514uHcJH4CIQC_tvhYhEAS5YeqhXIzWWVaU1wuvZih2fH0KEutbLbPBw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRQIgJDb9SYXTro7u0vqeR9TXN2p5TRUJJohnQTqsnraBkKkCIQC1IdTnbOeA6LVUQyesjnV2TizZh_j6ecV6Djha_hfbog%3D%3D'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/YoutubeDL.py", line 2136, in process_info
    success = dl(filename, info_dict)
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/YoutubeDL.py", line 2075, in dl
    return fd.download(name, new_info)
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/downloader/common.py", line 380, in download
    return self.real_download(filename, info_dict)
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/downloader/http.py", line 349, in real_download
    establish_connection()
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/downloader/http.py", line 116, in establish_connection
    raise err
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/downloader/http.py", line 110, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/home/gregorius/home/scripts/video/youtube-dl-nightly/youtube-dl/youtube_dl/YoutubeDL.py", line 2474, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/usr/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

```


yt-dl only extracts Web formats, except for age-gate bypassing.

So we can't (without changing the extractor code) use the work-around of fetching the formats as if we were an iThing that yt-dlp users have (since the yt-dlp extractor can get any or all of the various format groups that the YT webpage and APIs offer).
I have the same problem, using new, [nightly build](https://github.com/ytdl-org/ytdl-nightly/releases) of youtube-dl 2024.06.12 (latest).

```
$ youtube-dl -f 242 https://www.youtube.com/watch?v=tIiG-XqHvUQ
[youtube] tIiG-XqHvUQ: Downloading webpage
WARNING: [youtube] tIiG-XqHvUQ: Unable to decode n-parameter: download likely to be throttled (Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last):
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1646, in _decrypt_nsig
    ret = extract_nsig(jsi, func_code)(n)
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1709, in extract_nsig
    raise JSInterpreter.Exception('Signature function returned an exception')
Exception: Signature function returned an exception; 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; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
)
WARNING: [youtube] tIiG-XqHvUQ:

[dashsegments] Total fragments: 2
[download] Destination: YDB Extinction - Killing the Overkill Hype with Catastrophe _ -Cosmography101-33.3 w_Randall Carlson-tIiG-XqHvUQ.webm
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 1 of 10)...
...
[download] Got server HTTP error: HTTP Error 403: Forbidden. Retrying fragment 1 (attempt 10 of 10)...
ERROR: giving up after 10 fragment retries
```
[Verbose log here](https://pastebin.com/g2nfTCsu).

Anything can be done to help?
https://github.com/ytdl-org/youtube-dl/issues/32815#issuecomment-2176253831
> A brute-force workaround:

@astralblue: Which version it patches?

Also, due to inability to figure out exactly which version it applies, I tried nightly build without the change and it succeeded after 30+ tries.



Curiously, yt-dlp does not have this issue. I thought the jsinterp in yt-dlp and youtube-dl were pretty much on par?
```
yt-dlp "https://www.youtube.com/watch?v=2yJgwwDcgV8" -v --simulate
[debug] Command-line config: ['https://www.youtube.com/watch?v=2yJgwwDcgV8', '-v', '--simulate']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version master@2024.06.17.163732 from yt-dlp/yt-dlp-master-builds [90c3721a3] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 7.0.1-full_build-www.gyan.dev (setts), ffprobe 7.0.1-full_build-www.gyan.dev, phantomjs 2.5.0, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.06.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.35.5, urllib3-2.2.2, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1823 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=2yJgwwDcgV8
[youtube] 2yJgwwDcgV8: Downloading webpage
[youtube] 2yJgwwDcgV8: Downloading ios player API JSON
[debug] Loading youtube-nsig.590f65a6 from cache
[debug] [youtube] Decrypted nsig PC2qd-W-Wif3efRhhd => oA-qNAnWAPC7KQ
[debug] Loading youtube-nsig.590f65a6 from cache
[debug] [youtube] Decrypted nsig oJ7dw8OPYRU6qUJYtI => rZ20QpzNLP-d8g
[youtube] 2yJgwwDcgV8: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 2yJgwwDcgV8: Downloading 1 format(s): 244+251
```
Yes, but there is a bug in the evaluation of `-62-Math.pow(7, 1)*-19` here where the multiplication is not getting precedence -> 1311 vs. 71.

But more significantly, the links from the web player are getting 403 regardless of cookies, unlike in https://github.com/yt-dlp/yt-dlp/issues/10046.
Ah okay makes sense, so it seems like incorrect/missing nsig is no longer punished by throttling, but by 403.
Or perhaps not once the descrambling is fixed:
```console
$ python -m youtube_dl -v -f 18 --test  "https://www.youtube.com/watch?v=qCvqZPf3smI"
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'18', u'--test', u'https://www.youtube.com/watch?v=qCvqZPf3smI']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 0eafa09a3
[debug] Python 2.7.18 (CPython i686 32bit) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial - OpenSSL 1.1.1w  11 Sep 2023 - glibc 2.15
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[youtube] qCvqZPf3smI: Downloading webpage
[youtube] qCvqZPf3smI: Downloading player 0cbdb0bb
[debug] [youtube] Decrypted nsig pS7nuoyHbD53b1Ogg5 => hJuTwgtHbJ7KNw
[debug] [youtube] Decrypted nsig LJanpw1rKj_ErFkGnX => AJlxnCkg4YIgVA
[debug] Invoking downloader on u'https://rr5---sn-cu-aigss.googlevideo.com/videoplayback?sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&ei=4NdxZu6pOuG6vdIP78qomAM&ip=46.208.6.91&clen=270741677&spc=UWF9fzCMgE5BLW_zLwwxJRScw7NGuV3twVCPUn3eAY514F1rrgeBL-1d4voC&id=o-AP3SKVgbJGwcSKnEmAyKjq2NMA-ojDhdElUs9OJTsuPO&txp=7209224&svpuc=1&gir=yes&xpc=EgVo2aDSNQ%3D%3D&requiressl=yes&ratebypass=yes&source=youtube&mv=m&sig=AJfQdSswRAIgAt-1nRr0gUNENkkHYv5UtUugo2XyVF31falJ5D8GK0ACICx7-MqdNYepmrySWKDwZ2ddQOVkGRiZB4PqxRyHBTxZ&dur=7915.659&ns=eogiHzTeG8t8rGibJ9Ed9BcQ&initcwndbps=1637500&vprv=1&lsig=AHlkHjAwRQIgOtzZ9Ftrvs5OyPilYNUGWeiIXsiYjsXnkb_OtUT_TV4CIQDWR0rn8VzpBnpP_Cwed2YWHzmTR-NLY4Uf9s1utibUyg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lmt=1718385543727535&c=WEB&sefc=1&bui=AbKP-1Pn_KA2jKDL1neyFLmuv91AKPbt-Pu40GLa0IoUNlGAcJpQ8drZn_2YWMVGi5vTV7Pa3sbdT6Jh&mime=video%2Fmp4&fvip=1&rqh=1&itag=18&mm=31%2C29&mn=sn-cu-aigss%2Csn-cu-c9i6&mh=94&n=hJuTwgtHbJ7KNw&mt=1718736314&expire=1718758464&pl=25&ms=au%2Crdu&mvi=5'
[download] Destination: Crafting 3 Guile Scheme Programs in 2 Hours - System Crafters Live!-qCvqZPf3smI.mp4
[download] 100% of 10.00KiB in 00:00
$
```

Above got player `0cbdb0bb` which doesn't trigger the arithmetic bug, but it was fixed anyway:
```console
$ python test/test_youtube_signature.py TestSignature.test_nsig_js_590f65a6
.
----------------------------------------------------------------------
Ran 1 test in 1.966s

OK
$ 
```

Fix patch:
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index b10e844168c..9b0016d07ec 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -3033,7 +3033,6 @@ def _find_jwplayer_data(self, webpage, video_id=None, transform_source=js_to_jso
             transform_source=transform_source, default=None)
 
     def _extract_jwplayer_data(self, webpage, video_id, *args, **kwargs):
-
         # allow passing `transform_source` through to _find_jwplayer_data()
         transform_source = kwargs.pop('transform_source', None)
         kwfind = compat_kwargs({'transform_source': transform_source}) if transform_source else {}
diff --git a/youtube_dl/extractor/palcomp3.py b/youtube_dl/extractor/palcomp3.py
index fb29d83f9f2..60f7a4d48db 100644
--- a/youtube_dl/extractor/palcomp3.py
+++ b/youtube_dl/extractor/palcomp3.py
@@ -8,7 +8,7 @@
 from ..utils import (
     int_or_none,
     str_or_none,
-    try_get,
+    traverse_obj,
 )
 
 
@@ -109,7 +109,7 @@ class PalcoMP3ArtistIE(PalcoMP3BaseIE):
     }
     name'''
 
-    @ classmethod
+    @classmethod
     def suitable(cls, url):
         return False if re.match(PalcoMP3IE._VALID_URL, url) else super(PalcoMP3ArtistIE, cls).suitable(url)
 
@@ -118,7 +118,8 @@ def _real_extract(self, url):
         artist = self._call_api(artist_slug, self._ARTIST_FIELDS_TMPL)['artist']
 
         def entries():
-            for music in (try_get(artist, lambda x: x['musics']['nodes'], list) or []):
+            for music in traverse_obj(artist, (
+                    'musics', 'nodes', lambda _, m: m['musicID'])):
                 yield self._parse_music(music)
 
         return self.playlist_result(
@@ -137,7 +138,7 @@ class PalcoMP3VideoIE(PalcoMP3BaseIE):
             'title': 'Maiara e Maraisa - Você Faz Falta Aqui - DVD Ao Vivo Em Campo Grande',
             'description': 'md5:7043342c09a224598e93546e98e49282',
             'upload_date': '20161107',
-            'uploader_id': 'maiaramaraisaoficial',
+            'uploader_id': '@maiaramaraisaoficial',
             'uploader': 'Maiara e Maraisa',
         }
     }]
diff --git a/youtube_dl/jsinterp.py b/youtube_dl/jsinterp.py
index 86d902248da..02adf667846 100644
--- a/youtube_dl/jsinterp.py
+++ b/youtube_dl/jsinterp.py
@@ -14,6 +14,7 @@
     remove_quotes,
     unified_timestamp,
     variadic,
+    write_string,
 )
 from .compat import (
     compat_basestring,
@@ -53,15 +54,16 @@ def update_and_rename_wrapper(w):
 
 # NB In principle NaN cannot be checked by membership.
 # Here all NaN values are actually this one, so _NaN is _NaN,
-# although _NaN != _NaN.
+# although _NaN != _NaN. Ditto Infinity.
 
 _NaN = float('nan')
+_Infinity = float('inf')
 
 
 def _js_bit_op(op):
 
     def zeroise(x):
-        return 0 if x in (None, JS_Undefined, _NaN) else x
+        return 0 if x in (None, JS_Undefined, _NaN, _Infinity) else x
 
     @wraps_op(op)
     def wrapped(a, b):
@@ -84,7 +86,7 @@ def wrapped(a, b):
 def _js_div(a, b):
     if JS_Undefined in (a, b) or not (a or b):
         return _NaN
-    return operator.truediv(a or 0, b) if b else float('inf')
+    return operator.truediv(a or 0, b) if b else _Infinity
 
 
 def _js_mod(a, b):
@@ -220,6 +222,42 @@ def __repr__(self):
         return 'LocalNameSpace%s' % (self.maps, )
 
 
+class Debugger(object):
+    ENABLED = False
+
+    @staticmethod
+    def write(*args, **kwargs):
+        level = kwargs.get('level', 100)
+
+        def truncate_string(s, left, right=0):
+            if s is None or len(s) <= left + right:
+                return s
+            return '...'.join((s[:left - 3], s[-right:] if right else ''))
+
+        write_string('[debug] JS: {0}{1}\n'.format(
+            '  ' * (100 - level),
+            ' '.join(truncate_string(compat_str(x), 50, 50) for x in args)))
+
+    @classmethod
+    def wrap_interpreter(cls, f):
+        def interpret_statement(self, stmt, local_vars, allow_recursion, *args, **kwargs):
+            if cls.ENABLED and stmt.strip():
+                cls.write(stmt, level=allow_recursion)
+            try:
+                ret, should_ret = f(self, stmt, local_vars, allow_recursion, *args, **kwargs)
+            except Exception as e:
+                if cls.ENABLED:
+                    if isinstance(e, ExtractorError):
+                        e = e.orig_msg
+                    cls.write('=> Raises:', e, '<-|', stmt, level=allow_recursion)
+                raise
+            if cls.ENABLED and stmt.strip():
+                if should_ret or not repr(ret) == stmt:
+                    cls.write(['->', '=>'][should_ret], repr(ret), '<-|', stmt, level=allow_recursion)
+            return ret, should_ret
+        return interpret_statement
+
+
 class JSInterpreter(object):
     __named_object_counter = 0
 
@@ -307,8 +345,7 @@ def regex_flags(cls, expr):
     def __op_chars(cls):
         op_chars = set(';,[')
         for op in cls._all_operators():
-            for c in op[0]:
-                op_chars.add(c)
+            op_chars.update(op[0])
         return op_chars
 
     def _named_object(self, namespace, obj):
@@ -326,9 +363,8 @@ def _separate(cls, expr, delim=',', max_split=None, skip_delims=None):
         # collections.Counter() is ~10% slower in both 2.7 and 3.9
         counters = dict((k, 0) for k in _MATCHING_PARENS.values())
         start, splits, pos, delim_len = 0, 0, 0, len(delim) - 1
-        in_quote, escaping, skipping = None, False, 0
-        after_op, in_regex_char_group = True, False
-
+        in_quote, escaping, after_op, in_regex_char_group = None, False, True, False
+        skipping = 0
         for idx, char in enumerate(expr):
             paren_delta = 0
             if not in_quote:
@@ -382,10 +418,12 @@ def _separate_at_paren(cls, expr, delim=None):
         return separated[0][1:].strip(), separated[1].strip()
 
     @staticmethod
-    def _all_operators():
-        return itertools.chain(
-            # Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence
-            _SC_OPERATORS, _LOG_OPERATORS, _COMP_OPERATORS, _OPERATORS)
+    def _all_operators(_cached=[]):
+        if not _cached:
+            _cached.extend(itertools.chain(
+                # Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence
+                _SC_OPERATORS, _LOG_OPERATORS, _COMP_OPERATORS, _OPERATORS))
+        return _cached
 
     def _operator(self, op, left_val, right_expr, expr, local_vars, allow_recursion):
         if op in ('||', '&&'):
@@ -416,7 +454,7 @@ def _index(self, obj, idx, allow_undefined=False):
         except Exception as e:
             if allow_undefined:
                 return JS_Undefined
-            raise self.Exception('Cannot get index {idx:.100}'.format(**locals()), expr=repr(obj), cause=e)
+            raise self.Exception('Cannot get index {idx!r:.100}'.format(**locals()), expr=repr(obj), cause=e)
 
     def _dump(self, obj, namespace):
         try:
@@ -438,6 +476,7 @@ def _dump(self, obj, namespace):
     _FINALLY_RE = re.compile(r'finally\s*\{')
     _SWITCH_RE = re.compile(r'switch\s*\(')
 
+    @Debugger.wrap_interpreter
     def interpret_statement(self, stmt, local_vars, allow_recursion=100):
         if allow_recursion < 0:
             raise self.Exception('Recursion limit reached')
@@ -511,7 +550,6 @@ def interpret_statement(self, stmt, local_vars, allow_recursion=100):
                 expr = self._dump(inner, local_vars) + outer
 
         if expr.startswith('('):
-
             m = re.match(r'\((?P<d>[a-z])%(?P<e>[a-z])\.length\+(?P=e)\.length\)%(?P=e)\.length', expr)
             if m:
                 # short-cut eval of frequently used `(d%e.length+e.length)%e.length`, worth ~6% on `pytest -k test_nsig`
@@ -693,7 +731,7 @@ def interpret_statement(self, stmt, local_vars, allow_recursion=100):
                 (?P<op>{_OPERATOR_RE})?
                 =(?!=)(?P<expr>.*)$
             )|(?P<return>
-                (?!if|return|true|false|null|undefined)(?P<name>{_NAME_RE})$
+                (?!if|return|true|false|null|undefined|NaN|Infinity)(?P<name>{_NAME_RE})$
             )|(?P<indexing>
                 (?P<in>{_NAME_RE})\[(?P<idx>.+)\]$
             )|(?P<attribute>
@@ -727,11 +765,12 @@ def interpret_statement(self, stmt, local_vars, allow_recursion=100):
             raise JS_Break()
         elif expr == 'continue':
             raise JS_Continue()
-
         elif expr == 'undefined':
             return JS_Undefined, should_return
         elif expr == 'NaN':
             return _NaN, should_return
+        elif expr == 'Infinity':
+            return _Infinity, should_return
 
         elif md.get('return'):
             return local_vars[m.group('name')], should_return
@@ -760,18 +799,28 @@ def interpret_statement(self, stmt, local_vars, allow_recursion=100):
             right_expr = separated.pop()
             # handle operators that are both unary and binary, minimal BODMAS
             if op in ('+', '-'):
+                # simplify/adjust consecutive instances of these operators
                 undone = 0
                 while len(separated) > 1 and not separated[-1].strip():
                     undone += 1
                     separated.pop()
                 if op == '-' and undone % 2 != 0:
                     right_expr = op + right_expr
+                elif op == '+':
+                    while len(separated) > 1 and separated[-1].strip() in self.OP_CHARS:
+                        right_expr = separated.pop() + right_expr
+                # hanging op at end of left => unary + (strip) or - (push right)
                 left_val = separated[-1]
                 for dm_op in ('*', '%', '/', '**'):
                     bodmas = tuple(self._separate(left_val, dm_op, skip_delims=skip_delim))
                     if len(bodmas) > 1 and not bodmas[-1].strip():
                         expr = op.join(separated) + op + right_expr
-                        right_expr = None
+                        if len(separated) > 1:
+                            separated.pop()
+                            right_expr = op.join((left_val, right_expr))
+                        else:
+                            separated = [op.join((left_val, right_expr))]
+                            right_expr = None
                         break
                 if right_expr is None:
                     continue
@@ -797,6 +846,8 @@ def assertion(cndn, msg):
 
             def eval_method():
                 if (variable, member) == ('console', 'debug'):
+                    if Debugger.ENABLED:
+                        Debugger.write(self.interpret_expression('[{}]'.format(arg_str), local_vars, allow_recursion))
                     return
                 types = {
                     'String': compat_str,
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index cd43035667e..113c913df54 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -2406,7 +2406,7 @@ def __init__(self, msg, tb=None, expected=False, cause=None, video_id=None):
         """ tb, if given, is the original traceback (so that it can be printed out).
         If expected is set, this is a normal error message and most likely not a bug in youtube-dl.
         """
-
+        self.orig_msg = msg
         if sys.exc_info()[0] in (compat_urllib_error.URLError, socket.timeout, UnavailableVideoError):
             expected = True
         if video_id is not None:


Test patch:
diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py
index 91b12f5441b..da8e980207a 100644
--- a/test/test_jsinterp.py
+++ b/test/test_jsinterp.py
@@ -577,9 +577,11 @@ def test_32066(self):
     def test_unary_operators(self):
         jsi = JSInterpreter('function f(){return 2  -  - - 2;}')
         self.assertEqual(jsi.call_function('f'), 0)
-        # fails
-        # jsi = JSInterpreter('function f(){return 2 + - + - - 2;}')
-        # self.assertEqual(jsi.call_function('f'), 0)
+        jsi = JSInterpreter('function f(){return 2 + - + - - 2;}')
+        self.assertEqual(jsi.call_function('f'), 0)
+        # https://github.com/ytdl-org/youtube-dl/issues/32815
+        jsi = JSInterpreter('function f(){return 0  - 7 * - 6;}')
+        self.assertEqual(jsi.call_function('f'), 42)
 
     """ # fails so far
     def test_packed(self):
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py
index f45dfec7cff..cafba7a5cdd 100644
--- a/test/test_youtube_signature.py
+++ b/test/test_youtube_signature.py
@@ -158,6 +158,10 @@
         'https://www.youtube.com/s/player/b7910ca8/player_ias.vflset/en_US/base.js',
         '_hXMCwMt9qE310D', 'LoZMgkkofRMCZQ',
     ),
+    (
+        'https://www.youtube.com/s/player/590f65a6/player_ias.vflset/en_US/base.js',
+        '1tm7-g_A9zsI8_Lay_', 'xI4Vem4Put_rOg',
+    ),
 ]