From e77037f5a673e116d23545be9beb9bed9d9e2b7e Mon Sep 17 00:00:00 2001 From: Werner van Deventer Date: Wed, 21 Aug 2024 11:49:57 +0100 Subject: [PATCH 1/4] [FIX] Correct all compiler warnings. --- CapSolver.Tests/BaseMethodTests.cs | 4 ++-- CapSolver.Tests/HCaptchaTaskTest.cs | 2 +- CapSolver.Tests/ReCaptchaV2TaskTest.cs | 2 +- CapSolver.Tests/ReCaptchaV3TaskTest.cs | 2 +- CapSolver/CapSolver.csproj | 4 ++-- CapSolver/Models/Responses/DatadomeSliderResponse.cs | 2 +- CapSolver/Models/Responses/GeeTestV4Response.cs | 12 ++++++------ .../Responses/HCaptchaClassificationResponse.cs | 2 +- CapSolver/Models/Responses/MtCaptchaResponse.cs | 4 ++-- CapSolver/Tasks/AntiAkamaiBMPTask.cs | 2 +- CapSolver/Tasks/AntiCloudflareTask.cs | 2 +- CapSolver/Tasks/AwsWafClassificationTask.cs | 2 +- CapSolver/Tasks/BinanceCaptchaTask.cs | 2 +- CapSolver/Tasks/DatadomeSliderTask.cs | 2 +- CapSolver/Tasks/FunCaptchaClassification.cs | 2 +- CapSolver/Tasks/FunCaptchaTask.cs | 2 +- CapSolver/Tasks/GeeTestTask.cs | 2 +- CapSolver/Tasks/HCaptchaClassificationTask.cs | 2 +- CapSolver/Tasks/ImageToTextTask.cs | 2 +- CapSolver/Tasks/MtCaptchaTask.cs | 2 +- CapSolver/Tasks/ReCaptchaV2Enterprise.cs | 2 +- CapSolver/Tasks/ReCaptchaV2Task.cs | 2 +- CapSolver/Tasks/ReCaptchaV3Task.cs | 2 +- 23 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CapSolver.Tests/BaseMethodTests.cs b/CapSolver.Tests/BaseMethodTests.cs index 440cff2..7c7626c 100644 --- a/CapSolver.Tests/BaseMethodTests.cs +++ b/CapSolver.Tests/BaseMethodTests.cs @@ -3,7 +3,7 @@ namespace CapSolver.Tests; public class BaseMethodTests { [Fact] - public async void TestBalance() + public async Task TestBalance() { var client = new CapSolverClient(Environment.GetEnvironmentVariable("APIKEY")!, false); float balance = await client.GetBalance(); @@ -12,7 +12,7 @@ public async void TestBalance() } [Fact] - public async void TestPackages() + public async Task TestPackages() { var client = new CapSolverClient(Environment.GetEnvironmentVariable("APIKEY")!, false); List packages = await client.GetPackages(); diff --git a/CapSolver.Tests/HCaptchaTaskTest.cs b/CapSolver.Tests/HCaptchaTaskTest.cs index bd82e5b..c474adc 100644 --- a/CapSolver.Tests/HCaptchaTaskTest.cs +++ b/CapSolver.Tests/HCaptchaTaskTest.cs @@ -3,7 +3,7 @@ namespace CapSolver.Tests; public class HCaptchaTaskTest { [Fact] - public async void Test() + public async Task Test() { var client = new CapSolverClient(Environment.GetEnvironmentVariable("APIKEY")!, false); var task = new HCaptchaTask("https://lessons.zennolab.com/captchas/hcaptcha/?level=easy", diff --git a/CapSolver.Tests/ReCaptchaV2TaskTest.cs b/CapSolver.Tests/ReCaptchaV2TaskTest.cs index f11a118..8f729f5 100644 --- a/CapSolver.Tests/ReCaptchaV2TaskTest.cs +++ b/CapSolver.Tests/ReCaptchaV2TaskTest.cs @@ -3,7 +3,7 @@ namespace CapSolver.Tests; public class ReCaptchaV2TaskTest { [Fact] - public async void Test() + public async Task Test() { var client = new CapSolverClient(Environment.GetEnvironmentVariable("APIKEY")!, false); var task = new ReCaptchaV2Task("https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high", diff --git a/CapSolver.Tests/ReCaptchaV3TaskTest.cs b/CapSolver.Tests/ReCaptchaV3TaskTest.cs index d2dca39..54b1386 100644 --- a/CapSolver.Tests/ReCaptchaV3TaskTest.cs +++ b/CapSolver.Tests/ReCaptchaV3TaskTest.cs @@ -3,7 +3,7 @@ namespace CapSolver.Tests; public class ReCaptchaV3TaskTest { [Fact] - public async void Test() + public async Task Test() { var client = new CapSolverClient(Environment.GetEnvironmentVariable("APIKEY")!, false); var task = new ReCaptchaV3Task("https://lessons.zennolab.com/captchas/recaptcha/v3.php?level=beta", diff --git a/CapSolver/CapSolver.csproj b/CapSolver/CapSolver.csproj index 3ad80a2..c49ad45 100644 --- a/CapSolver/CapSolver.csproj +++ b/CapSolver/CapSolver.csproj @@ -4,7 +4,7 @@ enable enable CapSolver - 1.2.1 + 1.3.0 Alperen Sert Alperen Sert CapSolver,ReCaptcha v2 solver, Bypass captcha, anti-captcha, @@ -16,7 +16,7 @@ git - + \ No newline at end of file diff --git a/CapSolver/Models/Responses/DatadomeSliderResponse.cs b/CapSolver/Models/Responses/DatadomeSliderResponse.cs index 4a6244a..ea2da61 100644 --- a/CapSolver/Models/Responses/DatadomeSliderResponse.cs +++ b/CapSolver/Models/Responses/DatadomeSliderResponse.cs @@ -6,7 +6,7 @@ namespace CapSolver.Models.Responses; public class DatadomeSliderResponse : ITaskResponse { [JsonProperty("cookie")] - public string Cookie { get; set; } + public string? Cookie { get; set; } [JsonRequired] [JsonProperty("userAgent")] diff --git a/CapSolver/Models/Responses/GeeTestV4Response.cs b/CapSolver/Models/Responses/GeeTestV4Response.cs index 7944605..f49ae98 100644 --- a/CapSolver/Models/Responses/GeeTestV4Response.cs +++ b/CapSolver/Models/Responses/GeeTestV4Response.cs @@ -5,21 +5,21 @@ namespace CapSolver.Models.Responses; public class GeeTestV4Response { [JsonProperty("captcha_id")] - public string CaptchaId { get; set; } + public string? CaptchaId { get; set; } [JsonProperty("captcha_output")] - public string CaptchaOutput { get; set; } + public string? CaptchaOutput { get; set; } [JsonProperty("gen_time")] - public string GenTime { get; set; } + public string? GenTime { get; set; } [JsonProperty("lot_number")] - public string LotNumber { get; set; } + public string? LotNumber { get; set; } [JsonProperty("pass_token")] - public string Token { get; set; } + public string? Token { get; set; } [JsonProperty("risk_type")] - public string RiskType { get; set; } + public string? RiskType { get; set; } } diff --git a/CapSolver/Models/Responses/HCaptchaClassificationResponse.cs b/CapSolver/Models/Responses/HCaptchaClassificationResponse.cs index a54e0f1..a1c4743 100644 --- a/CapSolver/Models/Responses/HCaptchaClassificationResponse.cs +++ b/CapSolver/Models/Responses/HCaptchaClassificationResponse.cs @@ -13,5 +13,5 @@ public class HCaptchaClassificationResponse : ITaskResponse public IList? Box { get; set; } [JsonProperty("imageSize")] - public Tuple ImageSize { get; set; } + public Tuple? ImageSize { get; set; } } \ No newline at end of file diff --git a/CapSolver/Models/Responses/MtCaptchaResponse.cs b/CapSolver/Models/Responses/MtCaptchaResponse.cs index b3cd7b0..ec97fe6 100644 --- a/CapSolver/Models/Responses/MtCaptchaResponse.cs +++ b/CapSolver/Models/Responses/MtCaptchaResponse.cs @@ -6,8 +6,8 @@ namespace CapSolver.Models.Responses; public class MtCaptchaResponse : ITaskResponse { [JsonProperty("token")] - public string Token { get; set; } + public string? Token { get; set; } [JsonProperty("userAgent")] - public string UserAgent { get; set; } + public string? UserAgent { get; set; } } diff --git a/CapSolver/Tasks/AntiAkamaiBMPTask.cs b/CapSolver/Tasks/AntiAkamaiBMPTask.cs index 38d9c35..79c95b8 100644 --- a/CapSolver/Tasks/AntiAkamaiBMPTask.cs +++ b/CapSolver/Tasks/AntiAkamaiBMPTask.cs @@ -12,7 +12,7 @@ public class AntiAkamaiBMPTask : ITask /// Task's type. /// [JsonProperty("type")] - private readonly string Type = "AntiAkamaiBMPTask"; + private string Type => "AntiAkamaiBMPTask"; /// /// Package name of AkamaiBMP mobile APP diff --git a/CapSolver/Tasks/AntiCloudflareTask.cs b/CapSolver/Tasks/AntiCloudflareTask.cs index abeb73b..437ca54 100644 --- a/CapSolver/Tasks/AntiCloudflareTask.cs +++ b/CapSolver/Tasks/AntiCloudflareTask.cs @@ -6,7 +6,7 @@ namespace CapSolver.Tasks; public class AntiCloudflareTask : ITask, IProxyTask { [JsonProperty("type")] - private readonly string Type = "AntiCloudflareTask"; + private string Type => "AntiCloudflareTask"; /// /// The address of the target page. diff --git a/CapSolver/Tasks/AwsWafClassificationTask.cs b/CapSolver/Tasks/AwsWafClassificationTask.cs index 40fee48..6a96d89 100644 --- a/CapSolver/Tasks/AwsWafClassificationTask.cs +++ b/CapSolver/Tasks/AwsWafClassificationTask.cs @@ -6,7 +6,7 @@ namespace CapSolver.Tasks; public class AwsWafClassificationTask : ITask { [JsonProperty("type")] - private readonly string Type = "AwsWafClassification"; + private string Type => "AwsWafClassification"; /// /// Base64-encoded images, do not include "data:image/***;base64," diff --git a/CapSolver/Tasks/BinanceCaptchaTask.cs b/CapSolver/Tasks/BinanceCaptchaTask.cs index b992115..adb69fc 100644 --- a/CapSolver/Tasks/BinanceCaptchaTask.cs +++ b/CapSolver/Tasks/BinanceCaptchaTask.cs @@ -6,7 +6,7 @@ namespace CapSolver.Tasks; public class BinanceCaptchaTask : ITask, IProxyTask { [JsonProperty("type")] - private readonly string Type = "BinanceCaptchaTask"; + private string Type => "BinanceCaptchaTask"; /// /// Address of a webpage with bncaptcha diff --git a/CapSolver/Tasks/DatadomeSliderTask.cs b/CapSolver/Tasks/DatadomeSliderTask.cs index 1450d49..8bd2a93 100644 --- a/CapSolver/Tasks/DatadomeSliderTask.cs +++ b/CapSolver/Tasks/DatadomeSliderTask.cs @@ -10,7 +10,7 @@ namespace CapSolver.Tasks; public class DatadomeSliderTask : ITask, IProxyTask { [JsonProperty("type")] - private readonly string Type = "DatadomeSliderTask"; + private string Type => "DatadomeSliderTask"; /// /// Address of the webpage diff --git a/CapSolver/Tasks/FunCaptchaClassification.cs b/CapSolver/Tasks/FunCaptchaClassification.cs index 2176b11..71c225e 100644 --- a/CapSolver/Tasks/FunCaptchaClassification.cs +++ b/CapSolver/Tasks/FunCaptchaClassification.cs @@ -9,7 +9,7 @@ namespace CapSolver.Tasks; public class FunCaptchaClassification : ITask { [JsonProperty("type")] - private readonly string Type = "FunCaptchaClassification"; + private string Type => "FunCaptchaClassification"; /// /// Base64 encoded image, can be a screenshot (pass only the hexagonal image, do not pass the rest of the content) diff --git a/CapSolver/Tasks/FunCaptchaTask.cs b/CapSolver/Tasks/FunCaptchaTask.cs index f114448..827e7ba 100644 --- a/CapSolver/Tasks/FunCaptchaTask.cs +++ b/CapSolver/Tasks/FunCaptchaTask.cs @@ -9,7 +9,7 @@ namespace CapSolver.Tasks; public class FunCaptchaTask : ITask, IProxyTask, IUserAgentTask { [JsonProperty("type")] - private readonly string Type = "FunCaptchaTask"; + private string Type => "FunCaptchaTask"; /// /// Address of a webpage with Funcaptcha diff --git a/CapSolver/Tasks/GeeTestTask.cs b/CapSolver/Tasks/GeeTestTask.cs index 845bc55..db722a0 100644 --- a/CapSolver/Tasks/GeeTestTask.cs +++ b/CapSolver/Tasks/GeeTestTask.cs @@ -9,7 +9,7 @@ namespace CapSolver.Tasks; public class GeeTestTask : ITask, IProxyTask, IUserAgentTask, ICookieTask { [JsonProperty("type")] - private readonly string Type = "GeeTestTask"; + private string Type => "GeeTestTask"; /// /// Address of a webpage with Geetest diff --git a/CapSolver/Tasks/HCaptchaClassificationTask.cs b/CapSolver/Tasks/HCaptchaClassificationTask.cs index c6b1b21..04e5f73 100644 --- a/CapSolver/Tasks/HCaptchaClassificationTask.cs +++ b/CapSolver/Tasks/HCaptchaClassificationTask.cs @@ -9,7 +9,7 @@ namespace CapSolver.Tasks; public class HCaptchaClassificationTask : ITask { [JsonProperty("type")] - private readonly string Type = "HCaptchaClassification"; + private string Type => "HCaptchaClassification"; /// /// Base64-encoded images, do not include "data:image/***;base64," diff --git a/CapSolver/Tasks/ImageToTextTask.cs b/CapSolver/Tasks/ImageToTextTask.cs index 71ddcad..dfd516e 100644 --- a/CapSolver/Tasks/ImageToTextTask.cs +++ b/CapSolver/Tasks/ImageToTextTask.cs @@ -12,7 +12,7 @@ public class ImageToTextTask : ITask /// Task's type. /// [JsonProperty("type")] - private readonly string Type = "ImageToTextTask"; + private string Type => "ImageToTextTask"; /// /// Base64 encoded content of the image (without line breaks) diff --git a/CapSolver/Tasks/MtCaptchaTask.cs b/CapSolver/Tasks/MtCaptchaTask.cs index 6ac42eb..b785ce5 100644 --- a/CapSolver/Tasks/MtCaptchaTask.cs +++ b/CapSolver/Tasks/MtCaptchaTask.cs @@ -6,7 +6,7 @@ namespace CapSolver.Tasks; public class MtCaptchaTask : ITask, IProxyTask, IUserAgentTask { [JsonProperty("type")] - private readonly string Type = "MtCaptchaTask"; + private string Type => "MtCaptchaTask"; /// /// Web address of the website using hcaptcha, generally it's fixed value. (Ex: https://google.com) diff --git a/CapSolver/Tasks/ReCaptchaV2Enterprise.cs b/CapSolver/Tasks/ReCaptchaV2Enterprise.cs index 35b18c9..677d578 100644 --- a/CapSolver/Tasks/ReCaptchaV2Enterprise.cs +++ b/CapSolver/Tasks/ReCaptchaV2Enterprise.cs @@ -12,7 +12,7 @@ public class ReCaptchaV2Enterprise : ITask, IProxyTask, IUserAgentTask, ICookieT /// Task's type. /// [JsonProperty("type")] - private readonly string Type = "ReCaptchaV2EnterpriseTask"; + private string Type => "ReCaptchaV2EnterpriseTask"; /// /// Address of a webpage with Google ReCaptcha diff --git a/CapSolver/Tasks/ReCaptchaV2Task.cs b/CapSolver/Tasks/ReCaptchaV2Task.cs index 6a8416f..ddc3170 100644 --- a/CapSolver/Tasks/ReCaptchaV2Task.cs +++ b/CapSolver/Tasks/ReCaptchaV2Task.cs @@ -9,7 +9,7 @@ namespace CapSolver.Tasks; public class ReCaptchaV2Task : ITask, IUserAgentTask, ICookieTask, IProxyTask { [JsonProperty("type")] - private readonly string Type = "ReCaptchaV2Task"; + private string Type => "ReCaptchaV2Task"; /// /// Address of a webpage with Google ReCaptcha diff --git a/CapSolver/Tasks/ReCaptchaV3Task.cs b/CapSolver/Tasks/ReCaptchaV3Task.cs index e7b19d0..0f6eaab 100644 --- a/CapSolver/Tasks/ReCaptchaV3Task.cs +++ b/CapSolver/Tasks/ReCaptchaV3Task.cs @@ -9,7 +9,7 @@ namespace CapSolver.Tasks; public class ReCaptchaV3Task : ITask, IProxyTask, IUserAgentTask, ICookieTask { [JsonProperty("type")] - private readonly string Type = "ReCaptchaV3Task"; + private string Type { get; set; } = "ReCaptchaV3Task"; /// /// Address of a webpage with Google ReCaptcha From 63c04c75ba87c1ebb261f19d4a61a3563877c24e Mon Sep 17 00:00:00 2001 From: Werner van Deventer Date: Wed, 21 Aug 2024 11:51:26 +0100 Subject: [PATCH 2/4] [FEAT] Additional target for .NET Core 8.0 and update version in Readme. --- CapSolver/CapSolver.csproj | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CapSolver/CapSolver.csproj b/CapSolver/CapSolver.csproj index c49ad45..07fde95 100644 --- a/CapSolver/CapSolver.csproj +++ b/CapSolver/CapSolver.csproj @@ -1,6 +1,6 @@ - net6.0 + net6.0;net8.0 enable enable CapSolver diff --git a/README.md b/README.md index ab71cda..a801dc6 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,18 @@ ### Installation via Package Manager: ``` -NuGet\Install-Package CapSolver -Version 1.2.1 +NuGet\Install-Package CapSolver -Version 1.3.0 ``` This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package. via .NET CLI: ```ssh -dotnet add package CapSolver --version 1.2.1 +dotnet add package CapSolver --version 1.3.0 ``` via adding PackageReference: ```xml - + ``` For projects that support PackageReference, copy this XML node into the project file to reference the package. From 4d01fd52ea16436c475fc671b1c7ed8544dedbc7 Mon Sep 17 00:00:00 2001 From: Werner van Deventer Date: Wed, 21 Aug 2024 16:03:31 +0100 Subject: [PATCH 3/4] [UPDATE] Update task objects to match latest documentation, add new tasks and remove unsupported tasks. --- CapSolver.Tests/HCaptchaTaskTest.cs | 2 +- CapSolver/CapSolver.csproj | 22 +++--- CapSolver/CapSolverClient.cs | 20 +++--- .../CapSolver.cs => CapSolverException.cs} | 6 +- .../Models/Responses/AntiAkamaiBMPResponse.cs | 19 ----- .../Models/Responses/AntiAwsWafResponse.cs | 11 +++ .../Models/Responses/AntiKasadaResponse.cs | 19 ----- ...reResponse.cs => AntiTurnstileResponse.cs} | 2 +- .../Responses/AwsWafClassificationResponse.cs | 4 ++ .../Responses/BinanceCaptchaResponse.cs | 15 ---- .../Responses/DatadomeSliderResponse.cs | 3 +- .../FunCaptchaClassificationResponse.cs | 19 ----- .../Responses/FunCaptchaTaskResponse.cs | 11 --- .../HCaptchaClassificationResponse.cs | 3 + ...chaTaskResponse.cs => HCaptchaResponse.cs} | 2 +- .../ReCaptchaV2ClassificationResponse.cs | 20 ++++++ .../Models/Responses/ReCaptchaV3Response.cs | 3 +- .../VisionEngineClassificationResponse.cs | 16 +++++ CapSolver/Tasks/AntiAkamaiBMPTask.cs | 71 ------------------- CapSolver/Tasks/AntiAwsWafTask.cs | 62 ++++++++++++++++ CapSolver/Tasks/AntiKasadaTask.cs | 35 --------- ...CloudflareTask.cs => AntiTurnstileTask.cs} | 12 ++-- CapSolver/Tasks/AwsWafClassificationTask.cs | 10 ++- CapSolver/Tasks/BinanceCaptchaTask.cs | 43 ----------- CapSolver/Tasks/DatadomeSliderTask.cs | 2 +- CapSolver/Tasks/FunCaptchaClassification.cs | 45 ------------ CapSolver/Tasks/FunCaptchaTask.cs | 64 ----------------- CapSolver/Tasks/GeeTestTask.cs | 29 ++++---- CapSolver/Tasks/HCaptchaClassificationTask.cs | 37 ++++++---- CapSolver/Tasks/HCaptchaTask.cs | 10 +-- CapSolver/Tasks/HCaptchaTurboTask.cs | 12 ---- CapSolver/Tasks/ImageToTextTask.cs | 12 +++- CapSolver/Tasks/MtCaptchaTask.cs | 29 +++----- .../Tasks/ReCaptchaV2ClassificationTask.cs | 39 ++++++++++ ...rprise.cs => ReCaptchaV2EnterpriseTask.cs} | 4 +- CapSolver/Tasks/ReCaptchaV2Task.cs | 4 +- CapSolver/Tasks/ReCaptchaV3Task.cs | 5 +- .../Tasks/VisionEngineClassificationTask.cs | 65 +++++++++++++++++ CapSolver/Utilities/Endpoints.cs | 2 - CapSolver/Utilities/ICookieTask.cs | 3 +- CapSolver/Utilities/IProxyTask.cs | 3 +- CapSolver/Utilities/ITask.cs | 3 +- CapSolver/Utilities/ITaskResponse.cs | 3 +- CapSolver/Utilities/Proxy.cs | 8 +-- CapSolver/Utilities/VanillaTask.cs | 2 +- README.md | 25 +++---- 46 files changed, 348 insertions(+), 488 deletions(-) rename CapSolver/{Utilities/CapSolver.cs => CapSolverException.cs} (79%) delete mode 100644 CapSolver/Models/Responses/AntiAkamaiBMPResponse.cs create mode 100644 CapSolver/Models/Responses/AntiAwsWafResponse.cs delete mode 100644 CapSolver/Models/Responses/AntiKasadaResponse.cs rename CapSolver/Models/Responses/{AntiCloudflareResponse.cs => AntiTurnstileResponse.cs} (88%) delete mode 100644 CapSolver/Models/Responses/BinanceCaptchaResponse.cs delete mode 100644 CapSolver/Models/Responses/FunCaptchaClassificationResponse.cs delete mode 100644 CapSolver/Models/Responses/FunCaptchaTaskResponse.cs rename CapSolver/Models/Responses/{HCaptchaTaskResponse.cs => HCaptchaResponse.cs} (80%) create mode 100644 CapSolver/Models/Responses/ReCaptchaV2ClassificationResponse.cs create mode 100644 CapSolver/Models/Responses/VisionEngineClassificationResponse.cs delete mode 100644 CapSolver/Tasks/AntiAkamaiBMPTask.cs create mode 100644 CapSolver/Tasks/AntiAwsWafTask.cs delete mode 100644 CapSolver/Tasks/AntiKasadaTask.cs rename CapSolver/Tasks/{AntiCloudflareTask.cs => AntiTurnstileTask.cs} (75%) delete mode 100644 CapSolver/Tasks/BinanceCaptchaTask.cs delete mode 100644 CapSolver/Tasks/FunCaptchaClassification.cs delete mode 100644 CapSolver/Tasks/FunCaptchaTask.cs delete mode 100644 CapSolver/Tasks/HCaptchaTurboTask.cs create mode 100644 CapSolver/Tasks/ReCaptchaV2ClassificationTask.cs rename CapSolver/Tasks/{ReCaptchaV2Enterprise.cs => ReCaptchaV2EnterpriseTask.cs} (95%) create mode 100644 CapSolver/Tasks/VisionEngineClassificationTask.cs diff --git a/CapSolver.Tests/HCaptchaTaskTest.cs b/CapSolver.Tests/HCaptchaTaskTest.cs index c474adc..0110fc0 100644 --- a/CapSolver.Tests/HCaptchaTaskTest.cs +++ b/CapSolver.Tests/HCaptchaTaskTest.cs @@ -11,7 +11,7 @@ public async Task Test() string id = await client.CreateTask(task); Assert.IsType(id); Assert.NotNull(id); - var response = await client.JoinTaskResult(id); + var response = await client.JoinTaskResult(id); Assert.NotNull(response.GReCaptchaResponse); Assert.IsType(response.GReCaptchaResponse); } diff --git a/CapSolver/CapSolver.csproj b/CapSolver/CapSolver.csproj index 07fde95..d9bd650 100644 --- a/CapSolver/CapSolver.csproj +++ b/CapSolver/CapSolver.csproj @@ -1,22 +1,22 @@ - + net6.0;net8.0 enable enable - CapSolver - 1.3.0 - Alperen Sert - Alperen Sert - CapSolver,ReCaptcha v2 solver, Bypass captcha, anti-captcha, + CapSolver + 2.0.0 + Alperen Sert + Alperen Sert + CapSolver,ReCaptcha v2 solver, Bypass captcha, anti-captcha, CapSolver.com Library for .NET Core MIT https://github.com/alperensert/CapSolver https://github.com/alperensert/CapSolver README.md git - - - - - + + + + + \ No newline at end of file diff --git a/CapSolver/CapSolverClient.cs b/CapSolver/CapSolverClient.cs index efed143..3bcbf93 100644 --- a/CapSolver/CapSolverClient.cs +++ b/CapSolver/CapSolverClient.cs @@ -102,15 +102,11 @@ public async Task CreateTask(ITask task) break; } } - var method = task switch - { - AntiAkamaiBMPTask => Endpoints.CreateTaskAntiAkamai, - AntiKasadaTask => Endpoints.CreateTaskKasada, - _ => Endpoints.CreateTask - }; - if (task is HCaptchaTurboTask && IsProxyActive() == false) - throw new CapSolverException(13, "PROXY_NEEDED", "HCaptchaTurboTask requires your own proxies."); - var r = await CheckResponse(await MakeRequest(method, data)); + + if (task is DatadomeSliderTask && !IsProxyActive()) + throw new CapSolverException(13, "PROXY_NEEDED", "DatadomeSliderTask requires your own proxies."); + + var r = await CheckResponse(await MakeRequest(Endpoints.CreateTask, data)); return r.TaskId; } @@ -120,7 +116,7 @@ public async Task CreateTask(ITask task) public void DisableProxy() => _proxy = null; - private bool IsReady(TaskResponse response) where T : ITaskResponse => response.Status == "ready"; + private static bool IsReady(TaskResponse response) where T : ITaskResponse => response.Status == "ready"; private async Task MakeRequest(string endpoint, string data) { @@ -139,7 +135,7 @@ private async Task MakeRequest(string endpoint, string data return response; } - private void CheckResponse(ErrorResponse? response) + private static void CheckResponse(ErrorResponse? response) { if (response == null) { @@ -151,7 +147,7 @@ private void CheckResponse(ErrorResponse? response) } } - private async Task CheckResponse(HttpResponseMessage response) where T : ErrorResponse + private static async Task CheckResponse(HttpResponseMessage response) where T : ErrorResponse { try { diff --git a/CapSolver/Utilities/CapSolver.cs b/CapSolver/CapSolverException.cs similarity index 79% rename from CapSolver/Utilities/CapSolver.cs rename to CapSolver/CapSolverException.cs index 511e49e..7472cdd 100644 --- a/CapSolver/Utilities/CapSolver.cs +++ b/CapSolver/CapSolverException.cs @@ -1,7 +1,7 @@ -namespace CapSolver.Utilities; +namespace CapSolver; -[System.Serializable] -public class CapSolverException : System.Exception +[Serializable] +public class CapSolverException : Exception { public int ErrorId { get; set; } diff --git a/CapSolver/Models/Responses/AntiAkamaiBMPResponse.cs b/CapSolver/Models/Responses/AntiAkamaiBMPResponse.cs deleted file mode 100644 index 5a2700d..0000000 --- a/CapSolver/Models/Responses/AntiAkamaiBMPResponse.cs +++ /dev/null @@ -1,19 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Models.Responses; - -public class AntiAkamaiBMPResponse : ITaskResponse -{ - [JsonRequired] - [JsonProperty("deviceId")] - public string DeviceId { get; set; } = null!; - - [JsonRequired] - [JsonProperty("sensors")] - public IList Sensors { get; set; } = null!; - - [JsonRequired] - [JsonProperty("version")] - public string Version { get; set; } = null!; -} \ No newline at end of file diff --git a/CapSolver/Models/Responses/AntiAwsWafResponse.cs b/CapSolver/Models/Responses/AntiAwsWafResponse.cs new file mode 100644 index 0000000..586b745 --- /dev/null +++ b/CapSolver/Models/Responses/AntiAwsWafResponse.cs @@ -0,0 +1,11 @@ +using CapSolver.Utilities; +using Newtonsoft.Json; + +namespace CapSolver.Models.Responses; + +public class AntiAwsWafResponse : ITaskResponse +{ + [JsonRequired] + [JsonProperty("cookie")] + public string Cookie { get; set; } = null!; +} \ No newline at end of file diff --git a/CapSolver/Models/Responses/AntiKasadaResponse.cs b/CapSolver/Models/Responses/AntiKasadaResponse.cs deleted file mode 100644 index 1b9dd1b..0000000 --- a/CapSolver/Models/Responses/AntiKasadaResponse.cs +++ /dev/null @@ -1,19 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Models.Responses; - -public class AntiKasadaResponse : ITaskResponse -{ - [JsonRequired] - [JsonProperty("x-kpsdk-ct")] - public string KPsdkCT { get; set; } = null!; - - [JsonRequired] - [JsonProperty("x-kpsdk-cd")] - public string KPsdkCD { get; set; } = null!; - - [JsonRequired] - [JsonProperty("user-agent")] - public string UserAgent { get; set; } = null!; -} \ No newline at end of file diff --git a/CapSolver/Models/Responses/AntiCloudflareResponse.cs b/CapSolver/Models/Responses/AntiTurnstileResponse.cs similarity index 88% rename from CapSolver/Models/Responses/AntiCloudflareResponse.cs rename to CapSolver/Models/Responses/AntiTurnstileResponse.cs index b5f3bd0..516fc5b 100644 --- a/CapSolver/Models/Responses/AntiCloudflareResponse.cs +++ b/CapSolver/Models/Responses/AntiTurnstileResponse.cs @@ -3,7 +3,7 @@ namespace CapSolver.Models.Responses; -public class AntiCloudflareResponse : ITaskResponse +public class AntiTurnstileResponse : ITaskResponse { [JsonRequired] [JsonProperty("token")] diff --git a/CapSolver/Models/Responses/AwsWafClassificationResponse.cs b/CapSolver/Models/Responses/AwsWafClassificationResponse.cs index 604ade6..5e798f2 100644 --- a/CapSolver/Models/Responses/AwsWafClassificationResponse.cs +++ b/CapSolver/Models/Responses/AwsWafClassificationResponse.cs @@ -5,6 +5,10 @@ namespace CapSolver.Models.Responses; public class AwsWafClassificationResponse : ITaskResponse { + [JsonRequired] + [JsonProperty("objects")] + public IList Objects { get; set; } = null!; + [JsonRequired] [JsonProperty("box")] public IList Box { get; set; } = null!; diff --git a/CapSolver/Models/Responses/BinanceCaptchaResponse.cs b/CapSolver/Models/Responses/BinanceCaptchaResponse.cs deleted file mode 100644 index 05374ec..0000000 --- a/CapSolver/Models/Responses/BinanceCaptchaResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Models.Responses; - -public class BinanceCaptchaResponse : ITaskResponse -{ - [JsonRequired] - [JsonProperty("token")] - public string Token { get; set; } = null!; - - [JsonRequired] - [JsonProperty("userAgent")] - public string UserAgent { get; set; } = null!; -} diff --git a/CapSolver/Models/Responses/DatadomeSliderResponse.cs b/CapSolver/Models/Responses/DatadomeSliderResponse.cs index ea2da61..81a6a56 100644 --- a/CapSolver/Models/Responses/DatadomeSliderResponse.cs +++ b/CapSolver/Models/Responses/DatadomeSliderResponse.cs @@ -5,8 +5,9 @@ namespace CapSolver.Models.Responses; public class DatadomeSliderResponse : ITaskResponse { + [JsonRequired] [JsonProperty("cookie")] - public string? Cookie { get; set; } + public string Cookie { get; set; } = null!; [JsonRequired] [JsonProperty("userAgent")] diff --git a/CapSolver/Models/Responses/FunCaptchaClassificationResponse.cs b/CapSolver/Models/Responses/FunCaptchaClassificationResponse.cs deleted file mode 100644 index f0e8c8c..0000000 --- a/CapSolver/Models/Responses/FunCaptchaClassificationResponse.cs +++ /dev/null @@ -1,19 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Models.Responses; - -public class FunCaptchaClassificationResponse : ITaskResponse -{ - [JsonProperty("objects", NullValueHandling = NullValueHandling.Include)] - public IList? Objects { get; set; } - - [JsonProperty("labels", NullValueHandling = NullValueHandling.Include)] - public IList? Labels { get; set; } - - [JsonProperty("hasObject", NullValueHandling = NullValueHandling.Include)] - public bool? HasObject { get; set; } - - [JsonProperty("type", NullValueHandling = NullValueHandling.Include)] - public string? Type { get; set; } -} \ No newline at end of file diff --git a/CapSolver/Models/Responses/FunCaptchaTaskResponse.cs b/CapSolver/Models/Responses/FunCaptchaTaskResponse.cs deleted file mode 100644 index ed7b7c8..0000000 --- a/CapSolver/Models/Responses/FunCaptchaTaskResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Models.Responses; - -public class FunCaptchaTaskResponse : ITaskResponse -{ - [JsonRequired] - [JsonProperty("token")] - public string Token { get; set; } = null!; -} \ No newline at end of file diff --git a/CapSolver/Models/Responses/HCaptchaClassificationResponse.cs b/CapSolver/Models/Responses/HCaptchaClassificationResponse.cs index a1c4743..f3bc241 100644 --- a/CapSolver/Models/Responses/HCaptchaClassificationResponse.cs +++ b/CapSolver/Models/Responses/HCaptchaClassificationResponse.cs @@ -12,6 +12,9 @@ public class HCaptchaClassificationResponse : ITaskResponse [JsonProperty("box")] public IList? Box { get; set; } + [JsonProperty("tags")] + public IList? Tags { get; set; } + [JsonProperty("imageSize")] public Tuple? ImageSize { get; set; } } \ No newline at end of file diff --git a/CapSolver/Models/Responses/HCaptchaTaskResponse.cs b/CapSolver/Models/Responses/HCaptchaResponse.cs similarity index 80% rename from CapSolver/Models/Responses/HCaptchaTaskResponse.cs rename to CapSolver/Models/Responses/HCaptchaResponse.cs index a1645d2..598510d 100644 --- a/CapSolver/Models/Responses/HCaptchaTaskResponse.cs +++ b/CapSolver/Models/Responses/HCaptchaResponse.cs @@ -3,7 +3,7 @@ namespace CapSolver.Models.Responses; -public class HCaptchaTaskResponse : ReCaptchaV2Response, ITaskResponse +public class HCaptchaResponse : ReCaptchaV2Response, ITaskResponse { [JsonRequired] [JsonProperty("timestamp")] diff --git a/CapSolver/Models/Responses/ReCaptchaV2ClassificationResponse.cs b/CapSolver/Models/Responses/ReCaptchaV2ClassificationResponse.cs new file mode 100644 index 0000000..9d9708b --- /dev/null +++ b/CapSolver/Models/Responses/ReCaptchaV2ClassificationResponse.cs @@ -0,0 +1,20 @@ +using CapSolver.Utilities; +using Newtonsoft.Json; + +namespace CapSolver.Models.Responses; + +public class ReCaptchaV2ClassificationResponse : ITaskResponse +{ + [JsonRequired] + [JsonProperty("type")] + public string Type { get; set; } = null!; + + [JsonProperty("size")] + public int Size { get; set; } + + [JsonProperty("objects")] + public IList? Objects { get; set; } = null!; + + [JsonProperty("hasObject")] + public bool? HasObject { get; set; } +} \ No newline at end of file diff --git a/CapSolver/Models/Responses/ReCaptchaV3Response.cs b/CapSolver/Models/Responses/ReCaptchaV3Response.cs index a4ebc22..7bd9f70 100644 --- a/CapSolver/Models/Responses/ReCaptchaV3Response.cs +++ b/CapSolver/Models/Responses/ReCaptchaV3Response.cs @@ -3,6 +3,5 @@ namespace CapSolver.Models.Responses; public class ReCaptchaV3Response : ReCaptchaV2Response, ITaskResponse -{ - +{ } \ No newline at end of file diff --git a/CapSolver/Models/Responses/VisionEngineClassificationResponse.cs b/CapSolver/Models/Responses/VisionEngineClassificationResponse.cs new file mode 100644 index 0000000..e938550 --- /dev/null +++ b/CapSolver/Models/Responses/VisionEngineClassificationResponse.cs @@ -0,0 +1,16 @@ +using CapSolver.Utilities; +using Newtonsoft.Json; + +namespace CapSolver.Models.Responses; + +public class VisionEngineClassificationResponse : ITaskResponse +{ + [JsonProperty("distance")] + public int Distance { get; set; } + + [JsonProperty("angle")] + public int Angle{ get; set; } + + [JsonProperty("box")] + public IList? Box { get; set; } +} \ No newline at end of file diff --git a/CapSolver/Tasks/AntiAkamaiBMPTask.cs b/CapSolver/Tasks/AntiAkamaiBMPTask.cs deleted file mode 100644 index 79c95b8..0000000 --- a/CapSolver/Tasks/AntiAkamaiBMPTask.cs +++ /dev/null @@ -1,71 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Tasks; - -/// -/// This task type is used to solve Akamai BMP. -/// -public class AntiAkamaiBMPTask : ITask -{ - /// - /// Task's type. - /// - [JsonProperty("type")] - private string Type => "AntiAkamaiBMPTask"; - - /// - /// Package name of AkamaiBMP mobile APP - /// - [JsonRequired] - [JsonProperty("packageName")] - public string PackageName { get; set; } - - /// - /// AKAMAI BMP Version number, default is: 3.2.6 , max support is: 3.3.1 - /// - [JsonProperty("version", NullValueHandling = NullValueHandling.Ignore)] - public string? Version { get; set; } - - /// - /// If you want to have a fixed device ID in the sensor, you can pass this parameter - /// - [JsonProperty("deviceId", NullValueHandling = NullValueHandling.Ignore)] - public string? DeviceId { get; set; } - - /// - /// Input fixed deviceInfo, default is: random. - /// - [JsonProperty("deviceName", NullValueHandling = NullValueHandling.Ignore)] - public string? DeviceName { get; set; } - - /// - /// Sensor combinations acquired at once.
- /// Maximum is 50. - ///
- /// - [JsonProperty("count", NullValueHandling = NullValueHandling.Ignore)] - public int? Count { get; set; } - - /// - /// Prepare AntiAkamaiBMP task. - /// - /// Package name of AkamaiBMP mobile APP - /// AKAMAI BMP Version number, default is: 3.2.6 , max support is: 3.3.1 - /// If you want to have a fixed device ID in the sensor, you can pass this parameter - /// Input fixed deviceInfo, default is: random. - /// Sensor combinations acquired at once. - public AntiAkamaiBMPTask(string packageName, - string? version = null, - string? deviceId = null, - string? deviceName = null, - int? count = null) - { - PackageName = packageName; - Version = version; - DeviceId = deviceId; - DeviceName = deviceName; - Count = count; - } - -} \ No newline at end of file diff --git a/CapSolver/Tasks/AntiAwsWafTask.cs b/CapSolver/Tasks/AntiAwsWafTask.cs new file mode 100644 index 0000000..2af90e5 --- /dev/null +++ b/CapSolver/Tasks/AntiAwsWafTask.cs @@ -0,0 +1,62 @@ +using CapSolver.Utilities; +using Newtonsoft.Json; + +namespace CapSolver.Tasks; + +public class AntiAwsWafTask : ITask, IProxyTask +{ + [JsonProperty("type")] + private string Type => "AntiAwsWafTask"; + + /// + /// The URL of the page that returns the captcha info + /// + [JsonRequired] + [JsonProperty("websiteURL")] + public string WebsiteURL { get; set; } + + /// + /// When the status code returned by the websiteURL page is 405, awsContext is required + /// + [JsonProperty("awsKey", NullValueHandling = NullValueHandling.Ignore)] + public string? AwsKey { get; set; } + + /// + /// When the status code returned by the websiteURL page is 405, awsIv is required + /// + [JsonProperty("awsIv", NullValueHandling = NullValueHandling.Ignore)] + public string? AwsIv { get; set; } + + /// + /// When the status code returned by the websiteURL page is 405, awsContext is required + /// + [JsonProperty("awsContext", NullValueHandling = NullValueHandling.Ignore)] + public string? AwsContext { get; set; } + + /// + /// When the status code returned by the websiteURL page is 405 or 202, awsChallengeJs is required + /// + [JsonProperty("awsChallengeJS", NullValueHandling = NullValueHandling.Ignore)] + public string? AwsChallengeJS { get; set; } + + /// + /// + /// The URL of the page that returns the captcha info + /// When the status code returned by the websiteURL page is 405, awsContext is required + /// When the status code returned by the websiteURL page is 405, awsIv is required + /// When the status code returned by the websiteURL page is 405, awsContext is required + /// When the status code returned by the websiteURL page is 405 or 202, awsChallengeJs is required + public AntiAwsWafTask(string websiteUrl, + string? awsKey = null, + string? awsIv = null, + string? awsContext = null, + string? awsChallengeJS = null) + { + + WebsiteURL = websiteUrl; + AwsKey = awsKey; + AwsIv = awsIv; + AwsContext = awsContext; + AwsChallengeJS = awsChallengeJS; + } +} diff --git a/CapSolver/Tasks/AntiKasadaTask.cs b/CapSolver/Tasks/AntiKasadaTask.cs deleted file mode 100644 index cf02512..0000000 --- a/CapSolver/Tasks/AntiKasadaTask.cs +++ /dev/null @@ -1,35 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Tasks; - -/// -/// This task type is used to solve AntiKasada. -/// This task type requires proxy. -/// -public class AntiKasadaTask : ITask, IProxyTask -{ - /// - /// Address of a webpage with Kasada - /// - [JsonProperty("pageURL")] - public string PageUrl { get; set; } - - /// - /// Only cd data is returned - /// - /// - [JsonProperty("onlyCD", NullValueHandling = NullValueHandling.Ignore)] - public string? OnlyCD { get; set; } - - /// - /// Prepare AntiKasada task - /// - /// Address of a webpage with Kasada - /// Only cd data is returned - public AntiKasadaTask(string pageUrl, string? onlyCd = null) - { - PageUrl = pageUrl; - OnlyCD = onlyCd; - } -} \ No newline at end of file diff --git a/CapSolver/Tasks/AntiCloudflareTask.cs b/CapSolver/Tasks/AntiTurnstileTask.cs similarity index 75% rename from CapSolver/Tasks/AntiCloudflareTask.cs rename to CapSolver/Tasks/AntiTurnstileTask.cs index 437ca54..c8923bb 100644 --- a/CapSolver/Tasks/AntiCloudflareTask.cs +++ b/CapSolver/Tasks/AntiTurnstileTask.cs @@ -3,10 +3,10 @@ namespace CapSolver.Tasks; -public class AntiCloudflareTask : ITask, IProxyTask +public class AntiTurnstileTask : ITask { [JsonProperty("type")] - private string Type => "AntiCloudflareTask"; + private string Type => "AntiTurnstileTaskProxyLess"; /// /// The address of the target page. @@ -27,14 +27,14 @@ public class AntiCloudflareTask : ITask, IProxyTask public Dictionary? MetaData { get; set; } /// - /// Prepare an AntiCloudflare task. + /// Prepare an AntiTurnstileProxyLess task. /// /// The address of the target page. /// Turnstile siteKey /// Turnstile extra data - public AntiCloudflareTask(string websiteUrl, - string websiteKey, - Dictionary? metaData = null) + public AntiTurnstileTask(string websiteUrl, + string websiteKey, + Dictionary? metaData = null) { WebsiteKey = websiteKey; WebsiteURL = websiteUrl; diff --git a/CapSolver/Tasks/AwsWafClassificationTask.cs b/CapSolver/Tasks/AwsWafClassificationTask.cs index 6a96d89..bffef77 100644 --- a/CapSolver/Tasks/AwsWafClassificationTask.cs +++ b/CapSolver/Tasks/AwsWafClassificationTask.cs @@ -8,6 +8,12 @@ public class AwsWafClassificationTask : ITask [JsonProperty("type")] private string Type => "AwsWafClassification"; + /// + /// Page source url to improve accuracy + /// + [JsonProperty("websiteURL")] + public string? WebsiteUrl { get; set; } + /// /// Base64-encoded images, do not include "data:image/***;base64," /// @@ -30,8 +36,10 @@ public class AwsWafClassificationTask : ITask /// /// Base64-encoded images, do not include "data:image/***;base64,"Base64-encoded images, do not include "data:image/***;base64," /// For full names of questions, please refer to the following list of questions. + /// Page source url to improve accuracy public AwsWafClassificationTask(IList images, - string question) + string question, + string? websiteUrl = null) { Images = images; Question = question; diff --git a/CapSolver/Tasks/BinanceCaptchaTask.cs b/CapSolver/Tasks/BinanceCaptchaTask.cs deleted file mode 100644 index adb69fc..0000000 --- a/CapSolver/Tasks/BinanceCaptchaTask.cs +++ /dev/null @@ -1,43 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Tasks; - -public class BinanceCaptchaTask : ITask, IProxyTask -{ - [JsonProperty("type")] - private string Type => "BinanceCaptchaTask"; - - /// - /// Address of a webpage with bncaptcha - /// - [JsonProperty("websiteURL")] - public string WebsiteURL { get; set; } - - /// - /// bizId always be login - /// - [JsonProperty("websiteKey")] - public string WebsiteKey { get; set; } - - /// - /// validateId bncaptcha validateId field - /// - [JsonProperty("validateId")] - public string ValidateId { get; set; } - - /// - /// Prepare a BinanceCaptcha task. - /// - /// Address of a webpage with bncaptcha - /// bizId always be login - /// validateId bncaptcha validateId field - public BinanceCaptchaTask(string websiteUrl, - string websiteKey, - string validateId) - { - WebsiteKey = websiteKey; - WebsiteURL = websiteUrl; - ValidateId = validateId; - } -} diff --git a/CapSolver/Tasks/DatadomeSliderTask.cs b/CapSolver/Tasks/DatadomeSliderTask.cs index 8bd2a93..52ed186 100644 --- a/CapSolver/Tasks/DatadomeSliderTask.cs +++ b/CapSolver/Tasks/DatadomeSliderTask.cs @@ -19,7 +19,7 @@ public class DatadomeSliderTask : ITask, IProxyTask public string WebsiteURL { get; set; } /// - /// Captcha Url where is the captcha + /// If the url contains t=bv that means that your ip must be banned, t should be t=fe /// [JsonProperty("captchaUrl")] public string CaptchaURL { get; set; } diff --git a/CapSolver/Tasks/FunCaptchaClassification.cs b/CapSolver/Tasks/FunCaptchaClassification.cs deleted file mode 100644 index 71c225e..0000000 --- a/CapSolver/Tasks/FunCaptchaClassification.cs +++ /dev/null @@ -1,45 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Tasks; - -/// -/// This task type is used to solve FunCaptchaClassification. -/// -public class FunCaptchaClassification : ITask -{ - [JsonProperty("type")] - private string Type => "FunCaptchaClassification"; - - /// - /// Base64 encoded image, can be a screenshot (pass only the hexagonal image, do not pass the rest of the content) - /// - [JsonRequired] - [JsonProperty("image")] - public string Image { get; set; } - - /// - /// Question name. Pass the full name, such as: Pick the lion - /// Only support English requires accurate case, other languages please convert to English yourself - /// The server will automatically determine different image types according to the question, so please make sure the question is correct. - /// Please see the list at the end of the document for the full list of image types and corresponding English questions - ///
- /// See the supported question list: click here - ///
- [JsonRequired] - [JsonProperty("question")] - public string Question { get; set; } - - /// - /// Prepare a FunCaptchaClassification task. - ///
- /// See supported types of FunCaptcha: click here - ///
- /// Base64 encoded image, can be a screenshot (pass only the hexagonal image, do not pass the rest of the content) - /// Question name. Pass the full name, such as: Pick the lion. Only support English requires accurate case, other languages please convert to English yourself.
See the supported question list: click here - public FunCaptchaClassification(string image, string question) - { - Image = image; - Question = question; - } -} \ No newline at end of file diff --git a/CapSolver/Tasks/FunCaptchaTask.cs b/CapSolver/Tasks/FunCaptchaTask.cs deleted file mode 100644 index 827e7ba..0000000 --- a/CapSolver/Tasks/FunCaptchaTask.cs +++ /dev/null @@ -1,64 +0,0 @@ -using CapSolver.Utilities; -using Newtonsoft.Json; - -namespace CapSolver.Tasks; - -/// -/// This task type is used to solve FunCaptcha -/// -public class FunCaptchaTask : ITask, IProxyTask, IUserAgentTask -{ - [JsonProperty("type")] - private string Type => "FunCaptchaTask"; - - /// - /// Address of a webpage with Funcaptcha - /// - [JsonProperty("websiteURL")] - public string WebsiteURL { get; set; } - - /// - /// Funcaptcha website key. - /// - [JsonProperty("websitePublicKey")] - public string WebsitePublicKey { get; set; } - - /// - /// A special subdomain of funcaptcha.com, from which the JS captcha widget should be loaded. Most FunCaptcha installations work from shared domains. - /// - [JsonProperty("funcaptchaApiJSSubdomain")] - public string? ApiJsSubdomain { get; set; } - - /// - /// Additional parameter that may be required by FunCaptcha implementation. Use this property to send "blob" value as a stringified array. See example how it may look like. - /// - [JsonProperty("data")] - public string? Data { get; set; } - - /// - /// Browser's User-Agent which is used in emulation. It is required that you use a signature of a modern browser, otherwise Google will ask you to "update your browser" - /// - /// - [JsonProperty("userAgent", NullValueHandling = NullValueHandling.Ignore)] - public string? UserAgent { get; set; } - - /// - /// Prepare a FunCaptcha task - /// - /// Address of a webpage with Funcaptcha - /// Funcaptcha website key. - /// A special subdomain of funcaptcha.com, from which the JS captcha widget should be loaded. Most FunCaptcha installations work from shared domains. - /// Additional parameter that may be required by FunCaptcha implementation. Use this property to send "blob" value as a stringified array. See example how it may look like. - public FunCaptchaTask(string websiteUrl, - string websitePublicKey, - string? apiJsSubdomain = null, - string? data = null, - string? userAgent = null) - { - WebsiteURL = websiteUrl; - WebsitePublicKey = websitePublicKey; - ApiJsSubdomain = apiJsSubdomain; - Data = data; - UserAgent = userAgent; - } -} \ No newline at end of file diff --git a/CapSolver/Tasks/GeeTestTask.cs b/CapSolver/Tasks/GeeTestTask.cs index db722a0..fd008e5 100644 --- a/CapSolver/Tasks/GeeTestTask.cs +++ b/CapSolver/Tasks/GeeTestTask.cs @@ -6,29 +6,34 @@ namespace CapSolver.Tasks; /// /// This task is used to solve GeeTest. /// -public class GeeTestTask : ITask, IProxyTask, IUserAgentTask, ICookieTask +public class GeeTestTask : ITask, ICookieTask { [JsonProperty("type")] - private string Type => "GeeTestTask"; + private string Type => "GeeTestTaskProxyLess"; /// - /// Address of a webpage with Geetest + /// Web address of the website using geetest (Ex: https://geetest.com) /// + [JsonRequired] + [JsonProperty("websiteURL")] public string WebsiteURL { get; set; } /// - /// The domain public key, rarely updated. + /// Only Geetest V3 is required /// [JsonProperty("gt", NullValueHandling = NullValueHandling.Ignore)] public string? Gt { get; set; } /// - /// Changing token key. Make sure you grab a fresh one for each captcha; otherwise, you'll be charged for an error task. + /// Only Geetest V3 is required /// [JsonProperty("challenge", NullValueHandling = NullValueHandling.Ignore)] public string? Challenge { get; set; } - [JsonProperty("captchaId")] + /// + /// Only Geetest V4 is required + /// + [JsonProperty("captchaId", NullValueHandling = NullValueHandling.Ignore)] public string? CaptchaId { get; set; } /// @@ -36,34 +41,26 @@ public class GeeTestTask : ITask, IProxyTask, IUserAgentTask, ICookieTask /// [JsonProperty("geetestApiServerSubdomain", NullValueHandling = NullValueHandling.Ignore)] public string? ApiServerSubdomain { get; set; } - - /// - /// Browser's User-Agent which is used in emulation. It is required that you use a signature of a modern browser, otherwise Google will ask you to "update your browser". - /// - [JsonProperty("userAgent", NullValueHandling = NullValueHandling.Ignore)] - public string? UserAgent { get; set; } /// - /// Preapre a GeeTest task + /// Prepare a GeeTest task /// /// Address of a webpage with Geetest /// The domain public key, rarely updated. /// Changing token key. Make sure you grab a fresh one for each captcha; otherwise, you'll be charged for an error task. /// Optional API subdomain. May be required for some implementations. - /// Browser's User-Agent which is used in emulation. public GeeTestTask(string websiteUrl, string? gt = null, string? challenge = null, string? apiServerSubdomain = null, - string? userAgent = null, string? captchaId = null) { WebsiteURL = websiteUrl; Gt = gt; Challenge = challenge; ApiServerSubdomain = apiServerSubdomain; - UserAgent = userAgent; CaptchaId = captchaId; + if (gt != null && challenge != null) { CaptchaId = null; diff --git a/CapSolver/Tasks/HCaptchaClassificationTask.cs b/CapSolver/Tasks/HCaptchaClassificationTask.cs index 04e5f73..5e82b58 100644 --- a/CapSolver/Tasks/HCaptchaClassificationTask.cs +++ b/CapSolver/Tasks/HCaptchaClassificationTask.cs @@ -12,7 +12,20 @@ public class HCaptchaClassificationTask : ITask private string Type => "HCaptchaClassification"; /// - /// Base64-encoded images, do not include "data:image/***;base64," + /// Page source url to improve accuracy + /// + [JsonProperty("websiteURL")] + public string? WebsiteUrl { get; set; } + + /// + /// Website key to improve accuracy + /// + [JsonProperty("websiteKey")] + public string? WebsiteKey { get; set; } + + /// + /// Base64 encoded images, do not include "data:image/***; base64," + /// Assembles the picture as a list: [base64, base64, base64...] /// [JsonRequired] [JsonProperty("queries")] @@ -21,27 +34,21 @@ public class HCaptchaClassificationTask : ITask /// /// Question ID. Support English and Chinese, other languages please convert yourself /// - [JsonProperty("question", NullValueHandling = NullValueHandling.Ignore)] - public string? Question { get; set; } - - /// - /// The default result is false. If you need to return coordinates such as [0, 3, 4, 6, 7], put as true. - /// - [JsonProperty("coordinate", NullValueHandling = NullValueHandling.Ignore)] - public bool? Coordinate { get; set; } + [JsonRequired] + [JsonProperty("question")] + public string Question { get; set; } /// /// Prepare a HCaptchaClassification task. /// - /// Base64-encoded images, do not include "data:image/***;base64,"Base64-encoded images, do not include "data:image/***;base64," - /// Question ID. Support English and Chinese, other languages please convert yourself - /// The default result is false. If you need to return coordinates such as [0, 3, 4, 6, 7], put as true. + /// Base64 encoded images, do not include "data:image/***; base64," + /// Question ID. English is supported only. Please convert other languages by yourself + /// Page source url to improve accuracy public HCaptchaClassificationTask(IList queries, - string? question = null, - bool? coordinate = null) + string question, + string? websiteUrl = null) { Queries = queries; Question = question; - Coordinate = coordinate; } } \ No newline at end of file diff --git a/CapSolver/Tasks/HCaptchaTask.cs b/CapSolver/Tasks/HCaptchaTask.cs index 95596e5..4399b31 100644 --- a/CapSolver/Tasks/HCaptchaTask.cs +++ b/CapSolver/Tasks/HCaptchaTask.cs @@ -6,10 +6,10 @@ namespace CapSolver.Tasks; /// /// This task type is used to solve HCaptcha. /// -public class HCaptchaTask : ITask, IProxyTask, IUserAgentTask +public class HCaptchaTask : ITask, IUserAgentTask { [JsonProperty("type")] - protected string Type = "HCaptchaTask"; + protected string Type = "HCaptchaTaskProxyLess"; /// /// Address of a webpage with hCaptcha @@ -49,13 +49,11 @@ public class HCaptchaTask : ITask, IProxyTask, IUserAgentTask /// Address of a webpage with hCaptcha /// hCaptcha website key /// Custom data that is used in some implementations of hCaptcha Enterprise. So you need to put true in the isEnterprise parameter. In most cases you see it as rqdata inside network requests. IMPORTANT: you MUST provide userAgent if you submit captcha with data parameter. The value should match the User-Agent you use when interacting with the target website. - /// Use true for enterprise version of hcaptcha /// Use true for invisible version of hcaptcha /// Browser's User-Agent which is used in emulation. public HCaptchaTask(string websiteUrl, string websiteKey, object? enterprisePayload = null, - bool? isEnterprise = null, bool? isInvisible = null, string? userAgent = null) { @@ -64,9 +62,5 @@ public HCaptchaTask(string websiteUrl, EnterprisePayload = enterprisePayload; IsInvisible = isInvisible; UserAgent = userAgent; - if (isEnterprise == true) - { - Type = "HCaptchaEnterpriseTask"; - } } } \ No newline at end of file diff --git a/CapSolver/Tasks/HCaptchaTurboTask.cs b/CapSolver/Tasks/HCaptchaTurboTask.cs deleted file mode 100644 index e1b1bba..0000000 --- a/CapSolver/Tasks/HCaptchaTurboTask.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace CapSolver.Tasks; - -public class HCaptchaTurboTask : HCaptchaTask -{ - public HCaptchaTurboTask(string websiteUrl, string websiteKey, - object? enterprisePayload = null, bool? isEnterprise = null, - bool? isInvisible = null, string? userAgent = null) - : base(websiteUrl, websiteKey, enterprisePayload, isEnterprise, isInvisible, userAgent) - { - Type = "HCaptchaTurboTask"; - } -} \ No newline at end of file diff --git a/CapSolver/Tasks/ImageToTextTask.cs b/CapSolver/Tasks/ImageToTextTask.cs index dfd516e..175ce5d 100644 --- a/CapSolver/Tasks/ImageToTextTask.cs +++ b/CapSolver/Tasks/ImageToTextTask.cs @@ -15,13 +15,21 @@ public class ImageToTextTask : ITask private string Type => "ImageToTextTask"; /// - /// Base64 encoded content of the image (without line breaks) + /// Page source url to improve accuracy + /// + [JsonProperty("websiteURL")] + public string? WebsiteUrl { get; set; } + + /// + /// Base64 encoded content of the image (no newlines, no data:image/***;charset=utf-8;base64,) /// [JsonProperty("body")] public string Body { get; set; } /// - /// Specifies the module. Currently, the supported modules are common and queueit. + /// Specifies the module. + ///
+ /// See independent module support list: click here ///
[JsonProperty("module")] public string? Module { get; set; } diff --git a/CapSolver/Tasks/MtCaptchaTask.cs b/CapSolver/Tasks/MtCaptchaTask.cs index b785ce5..b75cb62 100644 --- a/CapSolver/Tasks/MtCaptchaTask.cs +++ b/CapSolver/Tasks/MtCaptchaTask.cs @@ -3,43 +3,34 @@ namespace CapSolver.Tasks; -public class MtCaptchaTask : ITask, IProxyTask, IUserAgentTask +public class MtCaptchaTask : ITask, IProxyTask { [JsonProperty("type")] private string Type => "MtCaptchaTask"; /// - /// Web address of the website using hcaptcha, generally it's fixed value. (Ex: https://google.com) + /// Web address of the website using MTCaptcha, generally it's fixed value. (Ex: https://google.com) /// [JsonRequired] [JsonProperty("websiteURL")] public string WebsiteURL { get; set; } /// - /// if the url contains t=bv that means that your ip must be banned, t should be t=fe + /// The domain public key, rarely updated. (Ex: sk=MTPublic-xxx public key) /// [JsonRequired] - [JsonProperty("captchaUrl")] - public string CaptchaURL { get; set; } + [JsonProperty("websiteKey")] + public string WebsiteKey { get; set; } /// - /// Browser's User-Agent which is used in emulation. It is required that you use a signature of a modern browser, otherwise Google will ask you to "update your browser". /// - [JsonRequired] - [JsonProperty("userAgent")] - public string UserAgent { get; set; } - - /// - /// - /// Web address of the website using hcaptcha, generally it's fixed value. - /// if the url contains t=bv that means that your ip must be banned, t should be t=fe - /// Browser's User-Agent which is used in emulation. It is required that you use a signature of a modern browser, otherwise Google will ask you to "update your browser". + /// Web address of the website using MTCaptcha, generally it's fixed value. + /// The domain public key, rarely updated. (Ex: sk=MTPublic-xxx public key) public MtCaptchaTask(string websiteUrl, - string captchaUrl, - string userAgent) + string websiteKey) { - CaptchaURL = captchaUrl; + WebsiteURL = websiteUrl; - UserAgent = userAgent; + WebsiteKey = websiteKey; } } diff --git a/CapSolver/Tasks/ReCaptchaV2ClassificationTask.cs b/CapSolver/Tasks/ReCaptchaV2ClassificationTask.cs new file mode 100644 index 0000000..11dc418 --- /dev/null +++ b/CapSolver/Tasks/ReCaptchaV2ClassificationTask.cs @@ -0,0 +1,39 @@ +using CapSolver.Utilities; +using Newtonsoft.Json; + +namespace CapSolver.Tasks; + +public class ReCaptchaV2ClassificationTask : ITask +{ + [JsonProperty("type")] + private string Type => "ReCaptchaV2Classification"; + + /// + /// Base64-encoded images, do not include "data:image/***;base64," + /// + [JsonRequired] + [JsonProperty("images")] + public IList Images { get; set; } + + /// + /// For full names of questions, please refer to the following list of questions. + ///
+ /// See supported types: click here + ///
+ [JsonProperty("question", NullValueHandling = NullValueHandling.Include)] + public string Question { get; set; } + + /// + /// Prepare a ReCaptchaV2Classification task. + ///
+ /// See supported types: click here + ///
+ /// Base64-encoded images, do not include "data:image/***;base64,"Base64-encoded images, do not include "data:image/***;base64," + /// For full names of questions, please refer to the following list of questions. + public ReCaptchaV2ClassificationTask(IList images, + string question) + { + Images = images; + Question = question; + } +} diff --git a/CapSolver/Tasks/ReCaptchaV2Enterprise.cs b/CapSolver/Tasks/ReCaptchaV2EnterpriseTask.cs similarity index 95% rename from CapSolver/Tasks/ReCaptchaV2Enterprise.cs rename to CapSolver/Tasks/ReCaptchaV2EnterpriseTask.cs index 677d578..b8fa0eb 100644 --- a/CapSolver/Tasks/ReCaptchaV2Enterprise.cs +++ b/CapSolver/Tasks/ReCaptchaV2EnterpriseTask.cs @@ -6,7 +6,7 @@ namespace CapSolver.Tasks; /// /// This task type is used to solve the ReCaptchaV2 Enterprise version. /// -public class ReCaptchaV2Enterprise : ITask, IProxyTask, IUserAgentTask, ICookieTask +public class ReCaptchaV2EnterpriseTask : ITask, IProxyTask, IUserAgentTask, ICookieTask { /// /// Task's type. @@ -65,7 +65,7 @@ public class ReCaptchaV2Enterprise : ITask, IProxyTask, IUserAgentTask, ICookieT /// Domain address from which to load reCAPTCHA Enterprise. /// Additional cookies which we must use during interaction with target page or Google. /// Browser's User-Agent which is used in emulation. - public ReCaptchaV2Enterprise(string websiteUrl, + public ReCaptchaV2EnterpriseTask(string websiteUrl, string websiteKey, object? enterprisePayload = null, string? apiDomain = null, diff --git a/CapSolver/Tasks/ReCaptchaV2Task.cs b/CapSolver/Tasks/ReCaptchaV2Task.cs index ddc3170..5ca2cc4 100644 --- a/CapSolver/Tasks/ReCaptchaV2Task.cs +++ b/CapSolver/Tasks/ReCaptchaV2Task.cs @@ -16,14 +16,14 @@ public class ReCaptchaV2Task : ITask, IUserAgentTask, ICookieTask, IProxyTask /// [JsonRequired] [JsonProperty("websiteURL")] - public string WebsiteUrl { get; set; } = null!; + public string WebsiteUrl { get; set; } /// /// Recaptcha website key.
///
[JsonRequired] [JsonProperty("websiteKey")] - public string WebsiteKey { get; set; } = null!; + public string WebsiteKey { get; set; } /// /// Specify whether or not Recaptcha is invisible. diff --git a/CapSolver/Tasks/ReCaptchaV3Task.cs b/CapSolver/Tasks/ReCaptchaV3Task.cs index 0f6eaab..a617af0 100644 --- a/CapSolver/Tasks/ReCaptchaV3Task.cs +++ b/CapSolver/Tasks/ReCaptchaV3Task.cs @@ -30,7 +30,7 @@ public class ReCaptchaV3Task : ITask, IProxyTask, IUserAgentTask, ICookieTask /// [JsonRequired] [JsonProperty("pageAction")] - public string PageAction { get; set; } = "verify"; + public string PageAction { get; set; } /// /// Value from 0.1 to 0.9 @@ -73,7 +73,7 @@ public class ReCaptchaV3Task : ITask, IProxyTask, IUserAgentTask, ICookieTask /// Browser's User-Agent which is used in emulation. public ReCaptchaV3Task(string websiteUrl, string websiteKey, - string pageAction, + string pageAction = "verify", double? minimumScore = null, string? cookies = null, string? userAgent = null, @@ -88,6 +88,7 @@ public ReCaptchaV3Task(string websiteUrl, EnterprisePayload = enterprisePayload; ApiDomain = apiDomain; Cookies = cookies; + if (enterprisePayload != null) { Type = "ReCaptchaV3EnterpriseTask"; diff --git a/CapSolver/Tasks/VisionEngineClassificationTask.cs b/CapSolver/Tasks/VisionEngineClassificationTask.cs new file mode 100644 index 0000000..a9d16c7 --- /dev/null +++ b/CapSolver/Tasks/VisionEngineClassificationTask.cs @@ -0,0 +1,65 @@ +using CapSolver.Utilities; +using Newtonsoft.Json; + +namespace CapSolver.Tasks; + +/// +/// This task type is used to solve VisionEngine +/// +public class VisionEngineClassificationTask : ITask +{ + [JsonProperty("type")] + private string Type => "VisionEngine"; + + /// + /// See supported images types: click here + /// + [JsonRequired] + [JsonProperty("module")] + public string Module { get; set; } + + /// + /// Base64 encoded content of the image (no newlines, no data:image/***;charset=utf-8;base64,) + /// + [JsonRequired] + [JsonProperty("image")] + public string Image { get; set; } + + /// + /// Base64 encoded content of the background image (no newlines, no data:image/***;charset=utf-8;base64,) + /// + [JsonRequired] + [JsonProperty("imageBackground")] + public string ImageBackground { get; set; } + + /// + /// Page source url to improve accuracy + /// + [JsonProperty("websiteURL")] + public string? WebsiteUrl { get; set; } + + /// + /// space_detection requires + /// + [JsonProperty("question")] + public string? Question { get; set; } + + /// + /// Prepare a HCaptchaClassification task. + /// + /// See supported images types: click here + /// Base64 encoded content of the image (no newlines, no data:image/***;charset=utf-8;base64,) + /// Base64 encoded content of the background image (no newlines, no data:image/***;charset=utf-8;base64,) + /// Page source url to improve accuracy + /// space_detection requires + public VisionEngineClassificationTask(string module, + string image, + string imageBackground, + string? websiteUrl = null, + string? question = null) + { + Module = module; + Image = image; + ImageBackground = imageBackground; + } +} \ No newline at end of file diff --git a/CapSolver/Utilities/Endpoints.cs b/CapSolver/Utilities/Endpoints.cs index 91fc165..87c7b44 100644 --- a/CapSolver/Utilities/Endpoints.cs +++ b/CapSolver/Utilities/Endpoints.cs @@ -5,6 +5,4 @@ internal static class Endpoints public const string Balance = "/getBalance"; public const string CreateTask = "/createTask"; public const string GetTaskResult = "/getTaskResult"; - public const string CreateTaskKasada = "/kasada/invoke"; - public const string CreateTaskAntiAkamai = "/akamaibmp/invoke"; } \ No newline at end of file diff --git a/CapSolver/Utilities/ICookieTask.cs b/CapSolver/Utilities/ICookieTask.cs index c71f416..fc86c68 100644 --- a/CapSolver/Utilities/ICookieTask.cs +++ b/CapSolver/Utilities/ICookieTask.cs @@ -1,6 +1,5 @@ namespace CapSolver.Utilities; public interface ICookieTask -{ - +{ } \ No newline at end of file diff --git a/CapSolver/Utilities/IProxyTask.cs b/CapSolver/Utilities/IProxyTask.cs index 7a1d910..5b09188 100644 --- a/CapSolver/Utilities/IProxyTask.cs +++ b/CapSolver/Utilities/IProxyTask.cs @@ -1,6 +1,5 @@ namespace CapSolver.Utilities; public interface IProxyTask -{ - +{ } \ No newline at end of file diff --git a/CapSolver/Utilities/ITask.cs b/CapSolver/Utilities/ITask.cs index 22f3c49..1955289 100644 --- a/CapSolver/Utilities/ITask.cs +++ b/CapSolver/Utilities/ITask.cs @@ -1,6 +1,5 @@ namespace CapSolver.Utilities; public interface ITask -{ - +{ } \ No newline at end of file diff --git a/CapSolver/Utilities/ITaskResponse.cs b/CapSolver/Utilities/ITaskResponse.cs index ec0eecc..4b91767 100644 --- a/CapSolver/Utilities/ITaskResponse.cs +++ b/CapSolver/Utilities/ITaskResponse.cs @@ -1,6 +1,5 @@ namespace CapSolver.Utilities; public interface ITaskResponse -{ - +{ } \ No newline at end of file diff --git a/CapSolver/Utilities/Proxy.cs b/CapSolver/Utilities/Proxy.cs index 64deca9..21d3cf0 100644 --- a/CapSolver/Utilities/Proxy.cs +++ b/CapSolver/Utilities/Proxy.cs @@ -20,10 +20,10 @@ public class Proxy : IProxyTask public string? ProxyPassword { get; set; } public Proxy(string proxyType, - string proxyAddress, - int proxyPort, - string? proxyLogin = null, - string? proxyPassword = null) + string proxyAddress, + int proxyPort, + string? proxyLogin = null, + string? proxyPassword = null) { ProxyType = proxyType; ProxyAddress = proxyAddress; diff --git a/CapSolver/Utilities/VanillaTask.cs b/CapSolver/Utilities/VanillaTask.cs index 373a3e6..b5c7859 100644 --- a/CapSolver/Utilities/VanillaTask.cs +++ b/CapSolver/Utilities/VanillaTask.cs @@ -9,7 +9,7 @@ public class VanillaTask /// [JsonRequired] [JsonProperty("clientKey", NullValueHandling = NullValueHandling.Ignore)] - public string ClientKey { get; set; } = null!; + public string ClientKey { get; set; } [JsonProperty("task", NullValueHandling = NullValueHandling.Ignore)] public ITask? Task { get; private set; } diff --git a/README.md b/README.md index a801dc6..f24c465 100644 --- a/README.md +++ b/README.md @@ -6,37 +6,34 @@ ### Installation via Package Manager: ``` -NuGet\Install-Package CapSolver -Version 1.3.0 +NuGet\Install-Package CapSolver -Version 2.0.0 ``` This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package. via .NET CLI: ```ssh -dotnet add package CapSolver --version 1.3.0 +dotnet add package CapSolver --version 2.0.0 ``` via adding PackageReference: ```xml - + ``` For projects that support PackageReference, copy this XML node into the project file to reference the package. ### Supported Captcha Types -- Image to text +- Image To Text - ReCaptcha V2 +- ReCaptcha V2 Classification - ReCaptcha V3 - HCaptcha - HCaptcha Classification -- FunCaptcha -- FunCaptcha Classification - GeeTest -- Datadome Slider -- Anti Cloud Flare -- Mt Captcha -- Binance Captcha +- Datadome Slider / Interstitial +- Anti Turnstile / Cloudflare +- MTCaptcha - AWS WAF Classification -- Anti Kasada -- Anti Akamai BMP +- Vision Engine Classification ### Usage Examples --- @@ -65,9 +62,9 @@ var response = await client.JoinTaskResult(id); #### FunCaptcha Task ```csharp var client = new CapSolverClient("apikey", false); -var task = new FunCaptchaTask("funcaptcha-site", "funcaptcha-key", "funcaptcha-js-source"); +var task = new HCaptchaTask("hcaptcha-site", "hcaptcha-key"); string id = await client.CreateTask(task); -var response = await client.JoinTaskResult(id); +var response = await client.JoinTaskResult(id); ``` For other examples and api documentation please visit [wiki](https://captchaai.atlassian.net/wiki/spaces/CAPTCHAAI/overview) \ No newline at end of file From d851db817034f50e05051ec5b20dd17ab4d717c9 Mon Sep 17 00:00:00 2001 From: Werner van Deventer Date: Wed, 21 Aug 2024 16:24:43 +0100 Subject: [PATCH 4/4] [FIX] Update README with new tasks details and missing constructor value settings. --- CapSolver/Tasks/AwsWafClassificationTask.cs | 1 + CapSolver/Tasks/HCaptchaClassificationTask.cs | 1 + CapSolver/Tasks/ReCaptchaV2EnterpriseTask.cs | 2 +- CapSolver/Tasks/VisionEngineClassificationTask.cs | 2 ++ README.md | 3 ++- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CapSolver/Tasks/AwsWafClassificationTask.cs b/CapSolver/Tasks/AwsWafClassificationTask.cs index bffef77..7d854c2 100644 --- a/CapSolver/Tasks/AwsWafClassificationTask.cs +++ b/CapSolver/Tasks/AwsWafClassificationTask.cs @@ -43,5 +43,6 @@ public AwsWafClassificationTask(IList images, { Images = images; Question = question; + WebsiteUrl = websiteUrl; } } diff --git a/CapSolver/Tasks/HCaptchaClassificationTask.cs b/CapSolver/Tasks/HCaptchaClassificationTask.cs index 5e82b58..2f6ffb4 100644 --- a/CapSolver/Tasks/HCaptchaClassificationTask.cs +++ b/CapSolver/Tasks/HCaptchaClassificationTask.cs @@ -50,5 +50,6 @@ public HCaptchaClassificationTask(IList queries, { Queries = queries; Question = question; + WebsiteUrl = websiteUrl; } } \ No newline at end of file diff --git a/CapSolver/Tasks/ReCaptchaV2EnterpriseTask.cs b/CapSolver/Tasks/ReCaptchaV2EnterpriseTask.cs index b8fa0eb..7a3be1d 100644 --- a/CapSolver/Tasks/ReCaptchaV2EnterpriseTask.cs +++ b/CapSolver/Tasks/ReCaptchaV2EnterpriseTask.cs @@ -70,7 +70,7 @@ public ReCaptchaV2EnterpriseTask(string websiteUrl, object? enterprisePayload = null, string? apiDomain = null, string? userAgent = null, - string? cookies= null) + string? cookies = null) { WebsiteUrl = websiteUrl; WebsiteKey = websiteKey; diff --git a/CapSolver/Tasks/VisionEngineClassificationTask.cs b/CapSolver/Tasks/VisionEngineClassificationTask.cs index a9d16c7..fbc9642 100644 --- a/CapSolver/Tasks/VisionEngineClassificationTask.cs +++ b/CapSolver/Tasks/VisionEngineClassificationTask.cs @@ -61,5 +61,7 @@ public VisionEngineClassificationTask(string module, Module = module; Image = image; ImageBackground = imageBackground; + WebsiteUrl = websiteUrl; + Question = question; } } \ No newline at end of file diff --git a/README.md b/README.md index f24c465..0059a7c 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,11 @@ For projects that support PackageReference, copy this XML node into the project - ReCaptcha V3 - HCaptcha - HCaptcha Classification -- GeeTest +- GeeTest V3 / V4 - Datadome Slider / Interstitial - Anti Turnstile / Cloudflare - MTCaptcha +- AWS WAF Captcha - AWS WAF Classification - Vision Engine Classification