forked from FlareSolverr/FlareSolverrSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f79593
commit 2033709
Showing
10 changed files
with
192 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,42 @@ | ||
| ||
using System; | ||
using System.Collections.Generic; | ||
using FlareSolverrSharp.Exceptions; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
|
||
namespace FlareSolverrSharp.Sample; | ||
|
||
static class Program | ||
public static class Program | ||
{ | ||
static void Main() | ||
|
||
public static async Task Main() | ||
{ | ||
ClearanceHandlerSample.SampleGet().Wait(); | ||
ClearanceHandlerSample.SamplePostUrlEncoded().Wait(); | ||
/*ClearanceHandlerSample.SampleGet().Wait(); | ||
ClearanceHandlerSample.SamplePostUrlEncoded().Wait();*/ | ||
|
||
var handler = new ClearanceHandler(Settings.FlareSolverrApiUrl) | ||
{ | ||
EnsureResponseIntegrity = false, | ||
Solverr = | ||
{ | ||
MaxTimeout = 60000 | ||
} | ||
}; | ||
|
||
var client = new HttpClient(handler); | ||
|
||
var x = await client.GetAsync(Settings.ProtectedUri); | ||
|
||
Console.WriteLine(x); | ||
Console.WriteLine( ChallengeDetector.IsClearanceRequiredAsync(x)); | ||
/*foreach (KeyValuePair<string, IEnumerable<string>> pair in x.Headers) { | ||
Console.WriteLine(pair); | ||
}*/ | ||
foreach (var y in x.Headers.Server) { | ||
|
||
Console.WriteLine(y.Product.Name); | ||
} | ||
// Assert.IsTrue(c.Message.Contains("Error connecting to FlareSolverr server")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.