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

Solves problem but throws FlareSolverrException #14

Open
brunoamancio opened this issue Jan 6, 2023 · 6 comments
Open

Solves problem but throws FlareSolverrException #14

brunoamancio opened this issue Jan 6, 2023 · 6 comments

Comments

@brunoamancio
Copy link

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

@ngosang
Copy link
Member

ngosang commented Jan 6, 2023

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

@nebojsasandin
Copy link

nebojsasandin commented Feb 24, 2023

This is now happening on all domains with 403 Forbidden status challenge. Some examples:

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.

@darkkilltec
Copy link

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

@asulwer
Copy link

asulwer commented May 8, 2024

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
Copy link

asulwer commented May 8, 2024

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
Copy link

asulwer commented May 8, 2024

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

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

5 participants