diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b81d1db..6ef9457 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -15,9 +15,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/CapMonsterCloud.Client.IntegrationTests/CapMonsterCloud.Client.IntegrationTests.csproj b/CapMonsterCloud.Client.IntegrationTests/CapMonsterCloud.Client.IntegrationTests.csproj index 329d66e..c962d6e 100644 --- a/CapMonsterCloud.Client.IntegrationTests/CapMonsterCloud.Client.IntegrationTests.csproj +++ b/CapMonsterCloud.Client.IntegrationTests/CapMonsterCloud.Client.IntegrationTests.csproj @@ -1,24 +1,24 @@ - net6.0 + net8.0 enable false CapMonsterCloud.Client.IntegrationTests - - - + + + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CapMonsterCloud.Client.Tests/CapMonsterCloud.Client.Tests.csproj b/CapMonsterCloud.Client.Tests/CapMonsterCloud.Client.Tests.csproj index 1e041b8..3c64114 100644 --- a/CapMonsterCloud.Client.Tests/CapMonsterCloud.Client.Tests.csproj +++ b/CapMonsterCloud.Client.Tests/CapMonsterCloud.Client.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable false @@ -12,9 +12,9 @@ - - - + + + diff --git a/CapMonsterCloud.Client/CapMonsterCloud.Client.csproj b/CapMonsterCloud.Client/CapMonsterCloud.Client.csproj index c838764..72e06b9 100644 --- a/CapMonsterCloud.Client/CapMonsterCloud.Client.csproj +++ b/CapMonsterCloud.Client/CapMonsterCloud.Client.csproj @@ -15,8 +15,8 @@ README.md logo.png https://github.com/ZennoLab/capmonstercloud-client-dotnet - 3.3.0 - Add Altcha, Castle, Tspd, Hunt solving support + 3.4.0 + Dependencies updated @@ -31,7 +31,7 @@ - + diff --git a/CapMonsterCloud.Client/Requests/AltchaCustomTaskRequest.cs b/CapMonsterCloud.Client/Requests/AltchaCustomTaskRequest.cs index b7277a3..c22b513 100644 --- a/CapMonsterCloud.Client/Requests/AltchaCustomTaskRequest.cs +++ b/CapMonsterCloud.Client/Requests/AltchaCustomTaskRequest.cs @@ -37,10 +37,10 @@ public sealed class AltchaCustomTaskRequest : CustomTaskRequestBase /// /// /// - /// "46d5b1c8871e5152d902ee3f?edk=1493462145de1ce33a52fb569b27a364&codeChallenge=464Cjs7PbiJJhJZ_ReJ-y9UGGDndcpsnP6vS8x1nEJyTkhjQkJyL2jcnYEuMKcrG&expires=1761048664" + /// "46d5b1c8871e5152d902ee3f?edk=1493462145de1ce33a52fb569b27a364&codeChallenge=464Cjs7PbiJJhJZ_ReJ-y9UGGDndcpsnP6vS8x1nEJyTkhjQkJyL2jcnYEuMKcrG&expires=1761048664" /// Salt obtained from the site, used for hash generation. /// Important: Always send the full value of the salt field! If the site returns something like this: - /// "salt": "46d5b1c8871e5152d902ee3f?edk=1493462145de1ce33a52fb569b27a364&codeChallenge=464Cjs7PbiJJhJZ_ReJ-y9UGGDndcpsnP6vS8x1nEJyTkhjQkJyL2jcnYEuMKcrG&expires=1761048664" + /// "salt": "46d5b1c8871e5152d902ee3f?edk=1493462145de1ce33a52fb569b27a364&codeChallenge=464Cjs7PbiJJhJZ_ReJ-y9UGGDndcpsnP6vS8x1nEJyTkhjQkJyL2jcnYEuMKcrG&expires=1761048664" /// Then copy and include it in your request exactly as it is, with all characters and parameters (edk, codeChallenge, etc.). /// /// diff --git a/CapMonsterCloud.Client/Responses/DynamicComplexImageTaskResponse.cs b/CapMonsterCloud.Client/Responses/DynamicComplexImageTaskResponse.cs index a448d0f..427fa9d 100644 --- a/CapMonsterCloud.Client/Responses/DynamicComplexImageTaskResponse.cs +++ b/CapMonsterCloud.Client/Responses/DynamicComplexImageTaskResponse.cs @@ -15,6 +15,9 @@ public class DynamicComplexImageTaskResponse : CaptchaResponseBase /// public class RecognitionMetadata { + /// + /// AnswerType + /// [JsonProperty("AnswerType")] public string AnswerType { get; set; } } diff --git a/README.md b/README.md index e3ac794..0cec3f4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Zennolab.CapMonsterCloud.Client +# Zennolab.CapMonsterCloud.Client Official C# client library for [capmonster.cloud](https://capmonster.cloud/) captcha recognition service @@ -30,30 +30,56 @@ Via .NET CLI var recaptchaV2Result = await cmCloudClient.SolveAsync(recaptchaV2Request); // solve RecaptchaV2 (with proxy) - var recaptchaV2Request = new RecaptchaV2Request + var recaptchaV2ProxyRequest = new RecaptchaV2Request { WebsiteUrl = "https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high", WebsiteKey = "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd", Proxy = new ProxyContainer("203.0.113.45", 8080, ProxyType.Http, "login", "password") }; - var recaptchaV2Result = await cmCloudClient.SolveAsync(recaptchaV2Request); + var recaptchaV2ProxyResult = await cmCloudClient.SolveAsync(recaptchaV2ProxyRequest); - // solve HCaptcha (without proxy) - var hcaptchaRequest = new HCaptchaRequest + // solve a CustomTask (anti-bot/WAF systems such as Tspd, Castle, DataDome, etc.) + var tspdRequest = new TspdCustomTaskRequest( + tspdCookie: "TS386a400d029=08...010245; TS386a400d029=08...01a06e; TS386a400d078=08...dbb3b0c; TSd2153684027=08...1944", + htmlPageBase64: "PCFET0NU...k+PC9odG1sPg==") { - WebsiteUrl = "https://lessons.zennolab.com/captchas/hcaptcha/?level=easy", - WebsiteKey = "472fc7af-86a4-4382-9a49-ca9090474471", + WebsiteUrl = "https://yourwebsite.com/page-with-tspd", + Proxy = new ProxyContainer("203.0.113.45", 8080, ProxyType.Http, "login", "password") }; - var hcaptchaResult = await cmCloudClient.SolveAsync(hcaptchaRequest); + var tspdResult = await cmCloudClient.SolveAsync(tspdRequest); Supported captcha recognition requests: -- [GeeTestRequest](https://zenno.link/doc-geetest-proxy-en) -- [HCaptchaRequest](https://zenno.link/doc-hcaptcha-proxy-en) -- [ImageToTextRequest](https://zenno.link/doc-ImageToTextTask-en) -- [RecaptchaV2Request](https://zenno.link/doc-recaptcha2-proxy-en) -- [RecaptchaV3ProxylessRequest](https://zenno.link/doc-recaptcha3-en) -- [RecaptchaV2EnterpriseRequest](https://zenno.link/doc-recaptcha2e-proxy-en) -- [TurnstileRequest](https://zenno.link/doc-turnstile-proxy-en) -- [RecaptchaComplexImageTaskRequest](https://zenno.link/doc-complextask-rc-en) -- [HcaptchaComplexImageTaskRequest](https://zenno.link/doc-complextask-hc-en) +Classic captcha tasks: + +- [AmazonWafRequest](https://zenno.link/doc-amazon-waf) +- [BinanceTaskRequest](https://zenno.link/doc-binance) +- [FunCaptchaRequest](https://zenno.link/doc-funcaptcha) +- [GeeTestRequest](https://zenno.link/doc-geetest) +- [ImageToTextRequest](https://zenno.link/doc-imagetotext) +- [MTCaptchaTaskRequest](https://zenno.link/doc-mtcaptcha) +- [ProsopoTaskRequest](https://zenno.link/doc-prosopo) +- [RecaptchaV2Request](https://zenno.link/doc-recaptcha2) +- [RecaptchaV2EnterpriseRequest](https://zenno.link/doc-recaptcha2e) +- [RecaptchaV3ProxylessRequest](https://zenno.link/doc-recaptcha3) +- [TurnstileRequest - Cloudflare Turnstile](https://zenno.link/doc-cloudflare-turnstile) +- [TurnstileRequest - Cloudflare Challenge](https://zenno.link/doc-cloudflare-challenge) +- [TurnstileRequest - Cloudflare Waiting Room](https://zenno.link/doc-cloudflare-waitingroom) +- [YidunTaskRequest](https://zenno.link/doc-yidun) + +Custom tasks (anti-bot / WAF / custom challenge systems): + +- [AlibabaCustomTaskRequest](https://zenno.link/doc-customtask-alibaba) +- [AltchaCustomTaskRequest](https://zenno.link/doc-customtask-altcha) +- [BasiliskCustomTaskRequest](https://zenno.link/doc-customtask-basilisk) +- [DataDomeCustomTaskRequest](https://zenno.link/doc-customtask-datadome) +- [FriendlyCustomTaskRequest](https://zenno.link/doc-customtask-friendly) +- [HuntCustomTaskRequest](https://zenno.link/doc-customtask-hunt) +- [ImpervaCustomTaskRequest](https://zenno.link/doc-customtask-imperva) +- [TenDiCustomTaskRequest](https://zenno.link/doc-customtask-tendi) +- [TspdCustomTaskRequest](https://zenno.link/doc-customtask-tspd) + +Complex image tasks (grid / dynamic image selection tasks): + +- [RecaptchaComplexImageTaskRequest](https://zenno.link/doc-complextask-rc) +- [RecognitionComplexImageTaskRequest](https://zenno.link/doc-complextask-recognition)