Skip to content

Commit 8608681

Browse files
victorkowalskivictorkowalskidzmitry-duboyski
authored
new SDK (#33)
* public static void Main() * run helper * MTCaptcha added * test and readme * Cutcaptcha * readme * CyberSiARA * DataDome * DataDome * atbCAPTCHA * test * Tencent * bug fixed * Update README.md * refactor * Update README.md * Update examples * Update README.md * Add Description and Tags --------- Co-authored-by: victorkowalski <kowalsky@2captcha.com> Co-authored-by: dzmitry-duboyski <dzmitry.duboyski@gmail.com>
1 parent f8daab7 commit 8608681

69 files changed

Lines changed: 1138 additions & 183 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ riderModule.iml
66
.idea
77
.vs
88
info.md
9+
Properties/

README.md

Lines changed: 199 additions & 40 deletions
Large diffs are not rendered by default.

TwoCaptcha.Examples/AmazonWafExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ namespace TwoCaptcha.Examples
66
{
77
public class AmazonWafExample
88
{
9-
public void Main()
9+
public AmazonWafExample(string apiKey)
1010
{
11-
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
11+
TwoCaptcha solver = new TwoCaptcha(apiKey);
1212

1313
AmazonWaf captcha = new AmazonWaf();
1414
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg");

TwoCaptcha.Examples/AmazonWafOptionsExample.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ namespace TwoCaptcha.Examples
66
{
77
public class AmazonWafOptionsExample
88
{
9-
public void Main()
9+
public AmazonWafOptionsExample(string apiKey)
1010
{
11-
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
11+
TwoCaptcha solver = new TwoCaptcha(apiKey);
1212

1313
AmazonWaf captcha = new AmazonWaf();
1414
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg");
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using System.Linq;
3+
using TwoCaptcha.Captcha;
4+
5+
namespace TwoCaptcha.Examples
6+
{
7+
public class AtbCAPTCHAExample
8+
{
9+
public AtbCAPTCHAExample(string apiKey)
10+
{
11+
TwoCaptcha solver = new TwoCaptcha(apiKey);
12+
13+
AtbCAPTCHA atbCAPTCHA = new AtbCAPTCHA();
14+
atbCAPTCHA.SetAppId("af23e041b22d000a11e22a230fa8991c");
15+
atbCAPTCHA.SetApiServer("https://cap.aisecurius.com");
16+
atbCAPTCHA.SetPageUrl("https://www.example.com/");
17+
18+
try
19+
{
20+
solver.Solve(atbCAPTCHA).Wait();
21+
Console.WriteLine("Captcha solved: " + atbCAPTCHA.Code);
22+
}
23+
catch (AggregateException e)
24+
{
25+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
26+
}
27+
}
28+
}
29+
}

TwoCaptcha.Examples/AudioCaptchaExample.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
namespace TwoCaptcha.Examples
77
{
8-
internal class AudioCaptchaExample
8+
public class AudioCaptchaExample
99
{
10-
public void Main()
10+
public AudioCaptchaExample(string apiKey)
1111
{
12-
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
TwoCaptcha solver = new TwoCaptcha(apiKey);
1313

14-
byte[] bytes = File.ReadAllBytes("../../resources/audio-en.mp3");
14+
byte[] bytes = File.ReadAllBytes("resources/audio-en.mp3");
1515
string base64EncodedImage = Convert.ToBase64String(bytes);
1616

1717
AudioCaptcha captcha = new AudioCaptcha();

TwoCaptcha.Examples/AudioCaptchaOpdionsExample.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
namespace TwoCaptcha.Examples
77
{
8-
internal class AudioCaptchaOptionsExample
8+
public class AudioCaptchaOptionsExample
99
{
10-
public void Main()
10+
public AudioCaptchaOptionsExample(string apiKey)
1111
{
12-
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
TwoCaptcha solver = new TwoCaptcha(apiKey);
1313

14-
byte[] bytes = File.ReadAllBytes("../../resources/audio-ru.mp3");
14+
byte[] bytes = File.ReadAllBytes("resources/audio-ru.mp3");
1515
string base64EncodedImage = Convert.ToBase64String(bytes);
1616

1717
AudioCaptcha captcha = new AudioCaptcha();

TwoCaptcha.Examples/CanvasBase64Example.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ namespace TwoCaptcha.Examples
77
{
88
public class CanvasBase64Example
99
{
10-
public void Main()
10+
public CanvasBase64Example(string apiKey)
1111
{
12-
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
TwoCaptcha solver = new TwoCaptcha(apiKey);
1313

14-
byte[] bytes = File.ReadAllBytes("../../resources/canvas.jpg");
14+
byte[] bytes = File.ReadAllBytes("resources/canvas.jpg");
1515
string base64EncodedImage = Convert.ToBase64String(bytes);
1616

1717
Canvas captcha = new Canvas();

TwoCaptcha.Examples/CanvasExample.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ namespace TwoCaptcha.Examples
66
{
77
public class CanvasExample
88
{
9-
public void Main()
9+
public CanvasExample(string apiKey)
1010
{
11-
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
11+
TwoCaptcha solver = new TwoCaptcha(apiKey);
1212

1313
Canvas captcha = new Canvas();
14-
captcha.SetFile("../../resources/canvas.jpg");
14+
captcha.SetFile("resources/canvas.jpg");
1515
captcha.SetHintText("Draw around apple");
1616

1717
try

TwoCaptcha.Examples/CanvasOptionsExample.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ namespace TwoCaptcha.Examples
77
{
88
public class CanvasOptionsExample
99
{
10-
public void Main()
10+
public CanvasOptionsExample(string apiKey)
1111
{
12-
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
TwoCaptcha solver = new TwoCaptcha(apiKey);
1313

1414
Canvas captcha = new Canvas();
15-
captcha.SetFile("../../resources/canvas.jpg");
15+
captcha.SetFile("resources/canvas.jpg");
1616
captcha.SetPreviousId(0);
1717
captcha.SetCanSkip(false);
1818
captcha.SetLang("en");
19-
captcha.SetHintImg(new FileInfo("../../resources/canvas_hint.jpg"));
19+
captcha.SetHintImg(new FileInfo("resources/canvas_hint.jpg"));
2020
captcha.SetHintText("Draw around apple");
2121

2222
try

0 commit comments

Comments
 (0)