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

Is Anyone Else Getting New Cloudflare Errors? #255

Closed
Emilaia opened this issue Jul 16, 2022 · 3 comments
Closed

Is Anyone Else Getting New Cloudflare Errors? #255

Emilaia opened this issue Jul 16, 2022 · 3 comments

Comments

@Emilaia
Copy link

Emilaia commented Jul 16, 2022

I started using this tool like a month ago, and from the get go I required making use of the credential parameters (which involve both cookie data and the user agent) in order to download anything.

But I was able to get that working without much issues.
However, like two weeks ago, I started getting something as follows:

[12:11:19] [INFO] Using mirror: https://nhentai.net
[12:11:19] [INFO] Using viewer template "default"
[12:11:19] [ERROR] Blocked by Cloudflare captcha, please set your cookie and user agent.

I've tried logging in and out to start a new cookie, getting the cookie from another browser and so on, but it keeps telling me that's basically invalid.

I'm aware that the Tachiyomi extension for nHentai had issues almost during this period as well, where it wasn't possible to use the extension without some workaround, so I post this today to ask if this is an issue for everyone, or if there's a possibility I was just IP blocked or something along those lines.

@illya-laifu
Copy link

It's not an IP block, that I can say for sure. I have the same issues as well. Piping the request through mitmproxy shows the status of 503, and the response is the one of CF validation. (The one that needs javascript). I have the cf_clearance=CLOUDFLARE cookie set as well as the useragent, taken directly from my browser.

What also seems weird is that the verification in the utils.py that checks if the CF validation passed is unstable, as sometimes it works and other times it fails to detect the CF blocker.

Two back to back runs:

> # Run 1
[01:46:12] [ERROR] Blocked by Cloudflare captcha, please set your cookie and useragent
> # Run 2

[01:46:14] [WARNING] Cannot get your username, please check your cookie or use `nhentai --cookie` to set your cookie
[01:46:14] [ERROR] Can't get your number of favorited doujins. Did the login failed?

And the headers for those requests are identical: (Without the cookie, ofc)

# Request 1
Host:             nhentai.net
User-Agent:       Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0
Accept-Encoding:  gzip, deflate, br
Accept:           */*
Connection:       keep-alive
Referer:          https://nhentai.net/login/

@jherazob
Copy link

jherazob commented Aug 5, 2022

Decided to check what other people have done for this, and there is a "cloudscraper" python module precisely created to bypass the CF captchas for bots, doesn't seem to be guaranteed to work and seems to be fussy about user agents and other such things, but looks like it works. Might help here. Frankly i wouldn't mind being asked to solve a captcha once in a while (not every execution for example), but don't yet see a way to do this for a bot (that's the very purpose of captchas after all), so it seems bypassing it is the choice. Would be much better if nhentai had a supported API instead.

@RicterZ
Copy link
Owner

RicterZ commented Feb 4, 2023

check #262

@RicterZ RicterZ closed this as completed Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants