FlareSolverrSharp
FlareSolverrSharp copied to clipboard
Solves problem but throws FlareSolverrException
https://www.tibia.com/community/?subtopic=characters&name=Dummy
can be solved but FlareSolverrException
is thrown.
The code in ClearanceHandler.cs
is:
// Change the cookies in the original request with the cookies provided by FlareSolverr
InjectCookies(request, flareSolverrResponse);
response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
// Detect if there is a challenge in the response
if (ChallengeDetector.IsClearanceRequired(response))
throw new FlareSolverrException("The cookies provided by FlareSolverr are not valid");
There is no cookie in flareSolverrResponse.Solution.Cookies
I can reproduce the issue. For some reason when I send a request using .Net code I get the Cloudflare Challenge. When I send the request with FlareSolverr or my web browser I don't get the Challenge. For now you can use FlareSolverr as proxy.
var uri = new Uri("https://www.tibia.com/community/?subtopic=characters&name=Dummy");
var flareSolverr = new FlareSolverr(Settings.FlareSolverrApiUrl);
var request = new HttpRequestMessage(HttpMethod.Get, uri);
var flareSolverrResponse = await flareSolverr.Solve(request);
You can get the HTML from flareSolverrResponse.Solution.Response
This is now happening on all domains with 403 Forbidden status challenge. Some examples:
- https://babia.to/
- https://iganony.com/
There is no challenge via FlareSolverr, however, there's instant 403 Forbidden web exception thrown when trying to navigate to one of these via .Net code. That said, there's an interesting approach by https://github.com/csharp-leaf/Leaf.xNet which isn't utilizing any of the available HttpRequest libraries, instead they're making raw TCP requests, and they're able to bypass 403 Forbidden web exception just like FlareSolverr is, but without using selenium or real browsers.
I have the same issues, flaresolver solves the challenge and the real call after that throws a 403 forbidden. Does anyone have an idea?
the issue, as i posted in my original issue, is that the redirect claims javascript is not enabled. changing the behavior of FlareSolverr via FlareSolverrSharp isn't possible. the challenge is solved and redirects to a page that claims javascript is not enabled. looking at the code i can see that it is not enabled.
That said, there's an interesting approach by https://github.com/csharp-leaf/Leaf.xNet which isn't utilizing any of the available HttpRequest libraries, instead they're making raw TCP requests, and they're able to bypass 403 Forbidden web exception just like FlareSolverr is, but without using selenium or real browsers.
real work requires real investigation.
they marked that code as a PAID service
the challenge is solved but redirects back to the same page which states javascript must be enabled. new.txt