Skip to content

Commit

Permalink
Add 2captcha softId (#27)
Browse files Browse the repository at this point in the history
* add info about proxy

* Add Useful links

* add 2captcha softId

* update tests
  • Loading branch information
dzmitry-duboyski authored May 14, 2024
1 parent e9d89f2 commit 8b9e897
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 8 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ The easiest way to quickly integrate [2Captcha] into your code to automate solvi
- [send / getResult](#send--getresult)
- [balance](#balance)
- [report](#report)
- [Proxies](#proxies)
- [Error handling](#error-handling)
- [Useful links](#useful-links)

## Installation
Install nuget package from [nuget]
Expand Down Expand Up @@ -354,6 +356,16 @@ Use this method to report good or bad captcha answer.
await solver.Report(captcha.Id, true); // captcha solved correctly
await solver.Report(captcha.Id, false); // captcha solved incorrectly
```
## Proxies

You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha, keycaptcha, capy puzzle, lemin, turnstile, amazon waf and etc. The proxy will be forwarded to the API to solve the captcha.

We have our own proxies that we can offer you. [Buy residential proxies](https://2captcha.com/proxy/residential-proxies) for avoid restrictions and blocks. [Quick start](https://2captcha.com/proxy?openAddTrafficModal=true).

```csharp
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT");
```


## Error handling
If case of an error captcha solver throws an exception. It's important to properly handle these cases. We recommend to use `try catch` to handle exceptions.
Expand Down Expand Up @@ -381,10 +393,12 @@ catch (TimeoutException e)
// captcha is not solved so far
}
```
[nuget]: https://www.nuget.org/packages/2captcha-csharp/
[2Captcha]: https://2captcha.com/
[2captcha sofware catalog]: https://2captcha.com/software
[pingback settings]: https://2captcha.com/setting/pingback
[post options]: https://2captcha.com/2captcha-api#normal_post
[list of supported languages]: https://2captcha.com/2captcha-api#language
[examples directory]: /TwoCaptcha.Examples

## Useful links
- [nuget](https://www.nuget.org/packages/2captcha-csharp/)
- [2Captcha](https://2captcha.com/)
- [2captcha sofware catalog](https://2captcha.com/software)
- [Pingback settings](https://2captcha.com/setting/pingback)
- [Post options](https://2captcha.com/2captcha-api#normal_post)
- [list of supported languages](https://2captcha.com/2captcha-api#language)
- [Examples directory](./TwoCaptcha.Examples)
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/AmazonWafTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public async Task TestAllOptions()
parameters["pageurl"] = "https://non-existent-example.execute-api.us-east-1.amazonaws.com";
parameters["context"] = "test_iv";
parameters["iv"] = "test_context";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/AudioTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public async Task TestAllParameters()
parameters["method"] = "audio";
parameters["lang"] = "en";
parameters["body"] = base64EncodedImage;
parameters["soft_id"] = "4582";


await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
Expand Down
3 changes: 3 additions & 0 deletions TwoCaptcha.Tests/CanvasTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public async Task TestSingleFile()
parameters["recaptcha"] = "1";
parameters["canvas"] = "1";
parameters["textinstructions"] = hintText;
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand All @@ -50,6 +51,7 @@ public async Task TestBase64()
parameters["canvas"] = "1";
parameters["body"] = "...";
parameters["textinstructions"] = hintText;
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand All @@ -76,6 +78,7 @@ public async Task TestAllParameters()
parameters["can_no_answer"] = "0";
parameters["lang"] = "en";
parameters["textinstructions"] = hintText;
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/CapyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public async Task TestAllOptions()
parameters["captchakey"] = "PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v";
parameters["pageurl"] = "http://mysite.com/";
parameters["api_server"] = "https://myapiserver.com/";
parameters["soft_id"] = "4582";


await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
Expand Down
4 changes: 4 additions & 0 deletions TwoCaptcha.Tests/CoordinatesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public async Task TestSingleFile()
var parameters = new Dictionary<string, string>();
parameters["method"] = "post";
parameters["coordinatescaptcha"] = "1";
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand All @@ -42,6 +43,7 @@ public async Task TestSingleFileParameter()
var parameters = new Dictionary<string, string>();
parameters["method"] = "post";
parameters["coordinatescaptcha"] = "1";
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand All @@ -59,6 +61,7 @@ public async Task TestBase64()
parameters["method"] = "base64";
parameters["coordinatescaptcha"] = "1";
parameters["body"] = "...";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand All @@ -80,6 +83,7 @@ public async Task TestAllParameters()
parameters["coordinatescaptcha"] = "1";
parameters["lang"] = "en";
parameters["textinstructions"] = hintText;
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/FunCaptchaTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public async Task TestAllOptions()
parameters["surl"] = "https://client-api.arkoselabs.com";
parameters["userAgent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36";
parameters["data[anyKey]"] = "anyStringValue";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/GeeTestTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public async Task TestAllOptions()
parameters["api_server"] = "api-na.geetest.com";
parameters["challenge"] = "69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC";
parameters["pageurl"] = "https://launches.endclothing.com/distil_r_captcha.html";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/GeeTestV4Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public async Task TestAllOptions()
parameters["captcha_id"] = "72bf15796d0b69c43867452fea615052";
parameters["challenge"] = "12345678abc90123d45678ef90123a456b";
parameters["pageurl"] = "https://mysite.com/captcha.html";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
4 changes: 4 additions & 0 deletions TwoCaptcha.Tests/GridTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public async Task TestSingleFile()
var parameters = new Dictionary<string, string>();
parameters["method"] = "post";
parameters["recaptcha"] = "1";
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand All @@ -41,6 +42,7 @@ public async Task TestSingleFileParameter()
var parameters = new Dictionary<string, string>();
parameters["method"] = "post";
parameters["recaptcha"] = "1";
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand All @@ -58,6 +60,7 @@ public async Task TestBase64()
parameters["method"] = "base64";
parameters["body"] = "...";
parameters["recaptcha"] = "1";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down Expand Up @@ -87,6 +90,7 @@ public async Task TestAllParameters()
parameters["can_no_answer"] = "0";
parameters["lang"] = "en";
parameters["textinstructions"] = hintText;
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/HCaptchaTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public async Task TestAllOptions()
parameters["sitekey"] = "f1ab2cdefa3456789012345b6c78d90e";
parameters["pageurl"] = "https://www.site.com/page/";
parameters["data"] = "foo";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/KeyCaptchaTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public async Task TestAllOptions()
parameters["s_s_c_web_server_sign"] = "9006dc725760858e4c0715b835472f22-pz-";
parameters["s_s_c_web_server_sign2"] = "2ca3abe86d90c6142d5571db98af6714";
parameters["pageurl"] = "https://www.keycaptcha.ru/demo-magnetic/";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/LeminTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public async Task TestAllOptions()
parameters["captcha_id"] = "CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d";
parameters["api_server"] = "api.leminnow.com";
parameters["pageurl"] = "http://sat2.aksigorta.com.tr";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
4 changes: 4 additions & 0 deletions TwoCaptcha.Tests/NormalTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public async Task TestSingleFile()

var parameters = new Dictionary<string, string>();
parameters["method"] = "post";
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand All @@ -40,6 +41,7 @@ public async Task TestSingleFileParameter()

var parameters = new Dictionary<string, string>();
parameters["method"] = "post";
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand All @@ -56,6 +58,7 @@ public async Task TestBase64()
var parameters = new Dictionary<string, string>();
parameters["method"] = "base64";
parameters["body"] = "...";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down Expand Up @@ -88,6 +91,7 @@ public async Task TestAllParameters()
parameters["calc"] = "0";
parameters["lang"] = "en";
parameters["textinstructions"] = hintText;
parameters["soft_id"] = "4582";

var files = new Dictionary<string, FileInfo>();
files["file"] = image;
Expand Down
2 changes: 2 additions & 0 deletions TwoCaptcha.Tests/ReCaptchaTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public async Task TestV2()
parameters["action"] = "verify";
parameters["domain"] = "recaptcha.net";
parameters["data-s"] = "foo";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand All @@ -51,6 +52,7 @@ public async Task TestV3()
parameters["action"] = "verify";
parameters["min_score"] = "0.3";
parameters["domain"] = "recaptcha.net";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/RotateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public async Task TestAllParameters()
parameters["lang"] = "en";
parameters["textinstructions"] = "Put the images in the correct way up";
parameters["body"] = base64EncodedImage;
parameters["soft_id"] = "4582";


await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
Expand Down
3 changes: 3 additions & 0 deletions TwoCaptcha.Tests/TextTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public async Task TestSimpleText()
var parameters = new Dictionary<string, string>();
parameters["method"] = "post";
parameters["textcaptcha"] = question;
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand All @@ -31,6 +32,7 @@ public async Task TestTextParameter()
var parameters = new Dictionary<string, string>();
parameters["method"] = "post";
parameters["textcaptcha"] = question;
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand All @@ -46,6 +48,7 @@ public async Task TestAllParameters()
parameters["method"] = "post";
parameters["textcaptcha"] = question;
parameters["lang"] = "en";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/TurnstileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public async Task TestAllOptions()
parameters["data"] = "foo";
parameters["pagedata"] = "bar";
parameters["action"] = "baz";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
1 change: 1 addition & 0 deletions TwoCaptcha.Tests/YandexTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public async Task TestAllOptions()
parameters["method"] = "yandex";
parameters["sitekey"] = "Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV";
parameters["pageurl"] = "https://rutube.ru";
parameters["soft_id"] = "4582";

await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
Expand Down
2 changes: 1 addition & 1 deletion TwoCaptcha/TwoCaptcha.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TwoCaptcha
* ID of software developer. Developers who integrated their software
* with our service get reward: 10% of spendings of their software users.
*/
public int SoftId { get; set; }
public int SoftId { get; set; } = 4582;

/**
* URL to which the result will be sent
Expand Down

0 comments on commit 8b9e897

Please sign in to comment.