FlareSolverrSharp icon indicating copy to clipboard operation
FlareSolverrSharp copied to clipboard

Solves problem but throws FlareSolverrException

Open brunoamancio opened this issue 2 years ago • 6 comments

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

brunoamancio avatar Jan 06 '23 04:01 brunoamancio

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

ngosang avatar Jan 06 '23 19:01 ngosang

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.

nebojsasandin avatar Feb 24 '23 10:02 nebojsasandin

I have the same issues, flaresolver solves the challenge and the real call after that throws a 403 forbidden. Does anyone have an idea?

darkkilltec avatar Oct 17 '23 10:10 darkkilltec

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.

asulwer avatar May 08 '24 00:05 asulwer

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

asulwer avatar May 08 '24 00:05 asulwer

the challenge is solved but redirects back to the same page which states javascript must be enabled. new.txt

asulwer avatar May 08 '24 01:05 asulwer