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

Fantia showed 403 Forbidden since yesterday #3576

Closed
zxgbs opened this issue Jan 27, 2023 · 3 comments
Closed

Fantia showed 403 Forbidden since yesterday #3576

zxgbs opened this issue Jan 27, 2023 · 3 comments

Comments

@zxgbs
Copy link

zxgbs commented Jan 27, 2023

Here is the verbose log I got, please help, thanks.

[gallery-dl][debug] Version 1.24.4
[gallery-dl][debug] Python 3.10.6 - Windows-10-10.0.19045-SP0
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.12
[gallery-dl][debug] Configuration Files ['%USERPROFILE%\gallery-dl.conf']
[gallery-dl][debug] Starting DownloadJob for 'https://fantia.jp/posts/1704263'
[cookies][debug] Extracting cookies from C:\Users\123\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies
[cookies][debug] Found local state file at 'C:\Users\123\AppData\Local\Google\Chrome\User Data\Local State'
[cookies][info] Extracted 107 cookies from chrome
[cookies][debug] cookie version breakdown: {'v10': 107, 'other': 0, 'unencrypted': 0}
[fantia][debug] Using FantiaPostExtractor for 'https://fantia.jp/posts/1704263'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): fantia.jp:443
[urllib3.connectionpool][debug] https://fantia.jp:443 "GET /api/v1/posts/1704263 HTTP/1.1" 403 None
[fantia][error] HttpError: '403 Forbidden' for 'https://fantia.jp/api/v1/posts/1704263'

@mikf
Copy link
Owner

mikf commented Jan 27, 2023

It seems Fantia now requires an X-CSRF-Token header field when logged in.

As a workaround

  • visit https://fantia.jp/ in your browser while logged in there
  • view the page's source (Ctrl+U)
  • copy the value of <meta name="csrf-token" content="VALUE" />
  • run gallery-dl with -o "headers.X-CSRF-Token=VALUE"

@zxgbs
Copy link
Author

zxgbs commented Jan 27, 2023

  • -o "headers.X-CSRF-Token=VALUE"

Worked like a miracle! Thank you!

@biggestsonicfan
Copy link

biggestsonicfan commented Jan 28, 2023

I see this closed as fixed but I just installed the lastest git through pip and I'm still getting a 403? Might be my end... I will try a few things
EDIT: It was my end. pipx force installing git branches is weird, so I uninstalled and reinstalled with pipx instead of trying to force update.

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

3 participants