-
-
Notifications
You must be signed in to change notification settings - Fork 975
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
cloudflare iuam challenge [nhentai] '503 Service Temporarily Unavailable' #2636
Comments
Looks like nhentai figured out what was going on and shut down the API. I should note that I am able to reproduce this on Kubuntu 20.04 with Python 3.8. |
And here's a log of the OP's original commandline:
|
See #2537 (comment). Instead of exporting your cookies manually, it is also possible to use |
There's a much quicker solution I've found, as well: |
Last commit: Mar 23, 2020 There previously was a cloudflare module in gallery-dl itself, which had more or less the same functionality as cfscrape, but cloudflare updated its challenge to one that requires a browser engine to solve: d656892 |
i dont quite get these coding things but it looks p doomed i guess, but here is what i got after trying out the cookies method, cut down on repeated warnings. thanks for the help anyways
|
i just realised what doujin it was that i used to test that method sigh i should've read it beforehand woops |
You did not set the same useragent string for gallery-dl as was used by your browser when solving the challenge, did you:
You can edit and/or delete your own posts, by the way. |
I have never heard of this user agent thing so I don't think I did, how do I use it ? Do I have to set it up on my end because I'm not sure what to put in the '...' ? Do I have to format it like this "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0", where can I find this information, sorry I don't know what those number mean or where to start. And thank you now I know lol. |
A User Agent string is a bit of information the your web browser sends with each request to identify itself. What this string is depends on what browser you are using. To find out what your browser is sending, go to https://httpbin.org/user-agent {
"user-agent": "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"
} so I would have to use the following command with gallery-dl:
(replace my values with whatever you are getting) You can also put these options in a config file, so you don't have to type them every time you want to download from nhentai or any other Cloudflare Protected ™️ website. {
"cookies": ["firefox"],
"user-agent": "Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"
} |
Well I just tried this, aside from the repeated cookies warnings, it works fine. I've think i found the config files as well so thank you very much for this fix, makes things a lot easier lol. ps ty for this gallery-dl script, its opened my interest to coding as a whole cus you can do pretty cool stuff with coding actually lol. im not sure if i should b pressing the 'close with comment' option but yea i'd say this has been resolved, thanks. |
@mikf Wouldn't it be useful to automatically extract the user agent from the browser, as well, so it wouldn't break when the browser gets an update? |
This would certainly be useful, but I don't think that's possible. Cookies are stored in an external file that can be accessed and read from, but the user agent string is embedded somewhere in the browser executable file itself. |
You could cheat by starting firefox with the necessary CLI arguments to navigate it to a local webserver, then grab the headers from that. Wouldn't need much special other than a dependency with Flask. Pretty invasive, but it'd work. |
i'm using @mikf |
I mean, I could add such an option, but it would have to open a dummy page on localhost with your browser each time you run gallery-dl. Is this really something you'd want? Is it really this inconvenient to replace the user agent string when you update your browser? |
wow that's complicated! |
Commit 9f06e79 makes it possible to set |
this only happens on nhentai, is this temporary ? how can i do the recaptcha ? thanks
The text was updated successfully, but these errors were encountered: