Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Nico is blocking VPNs and proxies #176

Open
Prcuvu opened this issue Aug 6, 2024 · 7 comments
Open

Nico is blocking VPNs and proxies #176

Prcuvu opened this issue Aug 6, 2024 · 7 comments

Comments

@Prcuvu
Copy link

Prcuvu commented Aug 6, 2024

  • Commit: 5df51ea
  • Python version: 3.12.3
  • Command line: nndownload -y [HTTP proxy address and port] -t -c https://www.nicovideo.jp/watch/sm43889206
  • Partial console output:
Logged in.
Retrieving video manifest...
HTTPError: 403 Client Error: Forbidden for url: https://nvapi.nicovideo.jp/v1/watch/sm43889206/access-rights/hls?actionTrackId=RUyJq8RGEv_1722957422351
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Scripts\nndownload.exe\__main__.py", line 7, in <module>
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 2136, in cli
    main()
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 2113, in main
    process_url_mo(session, url_mo)
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 2060, in process_url_mo
    request_video(session, url_id)
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 1059, in request_video
    template_params = perform_api_request(session, document)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 1608, in perform_api_request
    get_manifest_request.raise_for_status()
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://nvapi.nicovideo.jp/v1/watch/sm43889206/access-rights/hls?actionTrackId=RUyJq8RGEv_1722957422351

Could it be that Niconico was blocking my HTTP proxy?

@Prcuvu Prcuvu changed the title The relaunched Niconico HLS API returns HTTP 403, fails to retrieve video manifest The relaunched Niconico HLS API returns HTTP 403, fails to retrieve video manifest over HTTP proxy Aug 6, 2024
@AlexAplin
Copy link
Owner

AlexAplin commented Aug 6, 2024

I'd strongly suspect they're more stringent about this now since they migrated off their private cloud to AWS fully for delivery. Need more testing around this.

One thing I think I saw testing earlier is that the X-Request-With header might need to be updated to just be nicovideo:

"X-Request-With": "https://www.nicovideo.jp", # Only provided on this endpoint

@AlexAplin AlexAplin mentioned this issue Aug 6, 2024
49 tasks
@AlexAplin
Copy link
Owner

@Prcuvu Have you had a chance to test with the changed header, or with a different proxy? Going to renew my Mullvad proxy anyway to test but would be curious to know if you're using a common provider.

@Prcuvu
Copy link
Author

Prcuvu commented Aug 8, 2024

I tried the latest commit 13edafa over the same proxy but still no luck:

Proceeding with no login. Some content may not be available for download or may only be available in a lower quality. For access to all content, please provide a login with --username/--password, --session-cookie, or --netrc.
Retrieving video manifest...
HTTPError: 403 Client Error: Forbidden for url: https://nvapi.nicovideo.jp/v1/watch/sm43889206/access-rights/hls?actionTrackId=8rEnNRiOGm_1723143921356
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Scripts\nndownload.exe\__main__.py", line 7, in <module>
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 2178, in cli
    main()
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 2155, in main
    process_url_mo(session, url_mo)
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 2102, in process_url_mo
    request_video(session, url_id)
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 1063, in request_video
    template_params = perform_api_request(session, document)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\nndownload\nndownload.py", line 1630, in perform_api_request
    get_manifest_request.raise_for_status()
  File "C:\Users\Prcuvu\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://nvapi.nicovideo.jp/v1/watch/sm43889206/access-rights/hls?actionTrackId=8rEnNRiOGm_1723143921356

Actually I am also having trouble even watching Niconico videos using my web browser, with multiple APIs, including but not limited to watch/[sm*]/access_rights/hls, wakutkool/frames.json, recommend, user/followees/niconico-users/[user ID].json, marquee, users/me, returning HTTP 403.

@AlexAplin
Copy link
Owner

Have been hearing some rumors that potentially they are blocking Russian IPs, due to the BlackSuit hack, and likely others.

@Prcuvu
Copy link
Author

Prcuvu commented Aug 16, 2024

According to their blog post:

ニコニコ動画では、荒らし行為を防ぐために以下のような匿名性の高いアクセスを制限しています。

  • 一般的な利用では想定されないアクセス元からの通信
  • クライアントの情報を匿名化する技術を用いたアクセス
    • 例:Torやプロキシ、VPNなどを利用したアクセス

They are indeed actively blocking access through proxies.

@AlexAplin
Copy link
Owner

AlexAplin commented Aug 16, 2024

Doubt there's much to be done here then... might be nice to get a list going of any working providers or other workarounds.

@AlexAplin AlexAplin changed the title The relaunched Niconico HLS API returns HTTP 403, fails to retrieve video manifest over HTTP proxy Nico is blocking VPNs and proxies Aug 16, 2024
@AlexAplin AlexAplin pinned this issue Sep 6, 2024
@AlexAplin
Copy link
Owner

For anyone looking for a workaround to this and #197, Mullvad works here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants