Skip to content
This repository was archived by the owner on Jul 30, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<RootNamespace>CapMonsterCloud.Client.IntegrationTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="FluentAssertions" Version="8.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Moq.Contrib.HttpClient" Version="1.4.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.8.0">
<PackageReference Include="NUnit" Version="4.6.1" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.14.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
Expand All @@ -12,9 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="FluentAssertions" Version="8.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageReference Include="NUnit" Version="4.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions CapMonsterCloud.Client/CapMonsterCloud.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>logo.png</PackageIcon>
<RepositoryUrl>https://github.com/ZennoLab/capmonstercloud-client-dotnet</RepositoryUrl>
<Version>3.3.0</Version>
<PackageReleaseNotes>Add Altcha, Castle, Tspd, Hunt solving support</PackageReleaseNotes>
<Version>3.4.0</Version>
<PackageReleaseNotes>Dependencies updated</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -31,7 +31,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions CapMonsterCloud.Client/Requests/AltchaCustomTaskRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public sealed class AltchaCustomTaskRequest : CustomTaskRequestBase
/// </param>
///
/// <param name="salt">
/// <example>"46d5b1c8871e5152d902ee3f?edk=1493462145de1ce33a52fb569b27a364&codeChallenge=464Cjs7PbiJJhJZ_ReJ-y9UGGDndcpsnP6vS8x1nEJyTkhjQkJyL2jcnYEuMKcrG&expires=1761048664"</example>
/// <example>"46d5b1c8871e5152d902ee3f?edk=1493462145de1ce33a52fb569b27a364&amp;codeChallenge=464Cjs7PbiJJhJZ_ReJ-y9UGGDndcpsnP6vS8x1nEJyTkhjQkJyL2jcnYEuMKcrG&amp;expires=1761048664"</example>
/// 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&amp;codeChallenge=464Cjs7PbiJJhJZ_ReJ-y9UGGDndcpsnP6vS8x1nEJyTkhjQkJyL2jcnYEuMKcrG&amp;expires=1761048664"
/// Then copy and include it in your request exactly as it is, with all characters and parameters (edk, codeChallenge, etc.).
/// </param>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class DynamicComplexImageTaskResponse : CaptchaResponseBase
/// </summary>
public class RecognitionMetadata
{
/// <summary>
/// AnswerType
/// </summary>
[JsonProperty("AnswerType")]
public string AnswerType { get; set; }
}
Expand Down
60 changes: 43 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Zennolab.CapMonsterCloud.Client
# Zennolab.CapMonsterCloud.Client

Official C# client library for [capmonster.cloud](https://capmonster.cloud/) captcha recognition service

Expand Down Expand Up @@ -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)
Loading