diff --git a/CapMonster.Cloud.Tests/TaskTests.cs b/CapMonster.Cloud.Tests/TaskTests.cs index 41781d0..c8b5184 100644 --- a/CapMonster.Cloud.Tests/TaskTests.cs +++ b/CapMonster.Cloud.Tests/TaskTests.cs @@ -1,6 +1,7 @@ using CapMonster.Cloud.Models; using CapMonster.Cloud.Tasks; using CapMonster.Cloud.Tasks.Responses; +using CapMonster.Cloud.Utilities; namespace CapMonster.Cloud.Tests; @@ -71,7 +72,7 @@ public async void HCaptcha_Test(string websiteUrl, string websiteKey, bool usePr { var client = new CapMonsterClient(Environment.GetEnvironmentVariable("APIKEY")!); UseProxy(client, useProxy); - var task = new FunCaptchaTask(websiteUrl, websiteKey); + var task = new HCaptchaTask(websiteUrl, websiteKey); var id = await client.CreateTask(task); Assert.IsType(id); var response = await client.JoinTaskResult(id); diff --git a/CapMonster.Cloud/CapMonster.Cloud.csproj b/CapMonster.Cloud/CapMonster.Cloud.csproj index 9108022..614d887 100644 --- a/CapMonster.Cloud/CapMonster.Cloud.csproj +++ b/CapMonster.Cloud/CapMonster.Cloud.csproj @@ -5,7 +5,7 @@ enable enable CapMonster.Cloud - 1.0.0-alpha + 1.0.0 Alperen Sert Alperen Sert Capmonster,ReCaptcha v2 solver, Bypass captcha, anti-captcha, @@ -19,7 +19,7 @@ - + diff --git a/CapMonster.Cloud/CapMonsterClient.cs b/CapMonster.Cloud/CapMonsterClient.cs index c1df7fb..99e0226 100644 --- a/CapMonster.Cloud/CapMonsterClient.cs +++ b/CapMonster.Cloud/CapMonsterClient.cs @@ -71,6 +71,25 @@ public async Task GetBalanceAsync() var r = await CheckResponse(response); return r.Balance; } + + public async Task ReportIncorrectCaptcha(CaptchaTypes captchaType, int taskId) + { + var data = new VanillaTask(_clientKey) + { + TaskId = taskId + }; + var endpoint = captchaType switch + { + CaptchaTypes.Image => Endpoints.IncorrectImageCaptcha, + CaptchaTypes.Token => Endpoints.IncorrectTokenCaptcha, + CaptchaTypes.ReCaptcha => Endpoints.IncorrectTokenCaptcha, + CaptchaTypes.HCaptcha => Endpoints.IncorrectTokenCaptcha, + _ => throw new ArgumentOutOfRangeException(nameof(captchaType), captchaType, null) + }; + var response = await MakeRequest(endpoint, JsonConvert.SerializeObject(data)); + CheckResponse(JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync())); + return true; + } public async Task> GetTaskResultAsync(int taskId) where T : ITaskResponse { diff --git a/CapMonster.Cloud/Endpoints.cs b/CapMonster.Cloud/Endpoints.cs index 073f457..6e9cfb0 100644 --- a/CapMonster.Cloud/Endpoints.cs +++ b/CapMonster.Cloud/Endpoints.cs @@ -1,10 +1,14 @@ namespace CapMonster.Cloud; -internal class Endpoints +internal static class Endpoints { public const string Balance = "/getBalance"; public const string CreateTask = "/createTask"; public const string TaskResult = "/getTaskResult"; + + public const string IncorrectImageCaptcha = "/reportIncorrectImageCaptcha"; + + public const string IncorrectTokenCaptcha = "/reportIncorrectTokenCaptcha"; } \ No newline at end of file diff --git a/CapMonster.Cloud/Utilities/CaptchaTypes.cs b/CapMonster.Cloud/Utilities/CaptchaTypes.cs new file mode 100644 index 0000000..f26d77f --- /dev/null +++ b/CapMonster.Cloud/Utilities/CaptchaTypes.cs @@ -0,0 +1,9 @@ +namespace CapMonster.Cloud.Utilities; + +public enum CaptchaTypes +{ + Image, + Token, + ReCaptcha, + HCaptcha +} \ No newline at end of file diff --git a/README.md b/README.md index 9cc5cb6..db38d1a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ dotnet add package CapMonster.Cloud --version 1.0.0 via adding PackageReference: ```xml - + ``` For projects that support PackageReference, copy this XML node into the project file to reference the package.