Repository: yt-dlp
Issue: [NicoNico] Unable to fetch data: HTTP Error 400: Bad Request - geo-restriction not being detected by yt-dlp
Labels: geo-blocked,site-bug

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

USA, Japan

### Provide a description that is worded well enough to be understood

Whenever I try and download any video from NicoNico, it always results in "Unable to fetch data: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)" even if the video isn't blocked behind a login requirement.

I tried a few different videos but none download, opening them in my browser loads and plays them just fine.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', '--check-formats', '--no-warnings', '--cookies-from-browser', 'firefox', '--no-check-certificate', 'https://www.nicovideo.jp/watch/so44275623']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.10.22 from yt-dlp/yt-dlp [67adeb7ba] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg N-117657-gfe21944656-20241026 (setts), ffprobe N-117657-gfe21944656-20241026
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.35.5, urllib3-2.2.3, websockets-13.1
[debug] Proxy map: {}
Extracting cookies from firefox
[debug] Extracting cookies from: "C:\Users\sunka\AppData\Roaming\Mozilla\Firefox\Profiles\0c2fe4fr.default-release\cookies.sqlite"
Extracted 2534 cookies from firefox
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1839 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.10.22 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.10.22 from yt-dlp/yt-dlp)
[niconico] Extracting URL: https://www.nicovideo.jp/watch/so44275623
[niconico] so44275623: Downloading webpage
[niconico] so44275623: Downloading API JSON
ERROR: [niconico] so44275623: Unable to fetch data: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)

  File "yt_dlp\extractor\common.py", line 741, in extract
  File "yt_dlp\extractor\niconico.py", line 463, in _real_extract
  File "yt_dlp\extractor\common.py", line 1151, in download_content
  File "yt_dlp\extractor\common.py", line 1111, in download_handle
  File "yt_dlp\extractor\common.py", line 961, in _download_webpage_handle
  File "yt_dlp\extractor\common.py", line 910, in _request_webpage

  File "yt_dlp\extractor\common.py", line 897, in _request_webpage
  File "yt_dlp\YoutubeDL.py", line 4165, in urlopen
  File "yt_dlp\networking\common.py", line 117, in send
  File "yt_dlp\networking\_helper.py", line 208, in wrapper
  File "yt_dlp\networking\common.py", line 340, in send
  File "yt_dlp\networking\_requests.py", line 365, in _send
yt_dlp.networking.exceptions.HTTPError: HTTP Error 400: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "yt_dlp\extractor\niconico.py", line 451, in _real_extract
  File "yt_dlp\extractor\common.py", line 961, in _download_webpage_handle
  File "yt_dlp\extractor\common.py", line 910, in _request_webpage
yt_dlp.utils.ExtractorError: Unable to download webpage: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "yt_dlp\extractor\common.py", line 897, in _request_webpage
  File "yt_dlp\YoutubeDL.py", line 4165, in urlopen
  File "yt_dlp\networking\common.py", line 117, in send
  File "yt_dlp\networking\_helper.py", line 208, in wrapper
  File "yt_dlp\networking\common.py", line 340, in send
  File "yt_dlp\networking\_requests.py", line 365, in _send
yt_dlp.networking.exceptions.HTTPError: HTTP Error 400: Bad Request
```