Skip to content

Commit d64462a

Browse files
authored
Merge pull request #16 from zatvorius/master
New methods: - GeeTestV4 - Audio - Yandex - Lemin - Turnstile - AmazonWaf
2 parents 8397a96 + 6e1606d commit d64462a

21 files changed

+567
-0
lines changed

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ The easiest way to quickly integrate [2Captcha] into your code to automate solvi
1010
- [ReCaptcha v3](#recaptcha-v3)
1111
- [FunCaptcha](#funcaptcha)
1212
- [GeeTest](#geetest)
13+
- [GeeTestV4](#geetestv4)
1314
- [hCaptcha](#hcaptcha)
1415
- [KeyCaptcha](#keycaptcha)
1516
- [Capy](#capy)
1617
- [Grid (ReCaptcha V2 Old Method)](#grid)
1718
- [Canvas](#canvas)
1819
- [ClickCaptcha](#clickcaptcha)
1920
- [Rotate](#rotate)
21+
- [Audio](#audio)
22+
- [Yandex](#yandex)
23+
- [Lemin](#lemin)
24+
- [Turnstile](#turnstile)
25+
- [AmazonWaf](#amazonwaf)
2026
- [Other methods](#other-methods)
2127
- [send / getResult](#send--getresult)
2228
- [balance](#balance)
@@ -171,6 +177,16 @@ captcha.SetUrl("https://mysite.com/captcha.html");
171177
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT");
172178
```
173179

180+
### GeeTestV4
181+
Method to solve GeeTestV4 puzzle captcha. Returns a set of tokens as JSON.
182+
183+
```csharp
184+
GeeTestV4 captcha = new GeeTestV4();
185+
captcha.SetCaptchaId("72bf15796d0b69c43867452fea615052");
186+
captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
187+
captcha.SetUrl("https://mysite.com/captcha.html");
188+
```
189+
174190
### hCaptcha
175191
Use this method to solve hCaptcha challenge. Returns a token to bypass captcha.
176192

@@ -255,6 +271,56 @@ captcha.SetHintImg(new FileInfo("path/to/hint.jpg"));
255271
captcha.SetHintText("Put the images in the correct way up");
256272
```
257273

274+
### Audio
275+
This method can be used to solve a audio captcha
276+
277+
```csharp
278+
AudioCaptcha captcha = new AudioCaptcha();
279+
byte[] bytes = File.ReadAllBytes("../../resources/audio-en.mp3");
280+
string base64EncodedImage = Convert.ToBase64String(bytes);
281+
captcha.SetBase64(base64EncodedImage);
282+
```
283+
284+
### Yandex
285+
Use this method to solve Yandex and obtain a token to bypass the protection.
286+
287+
```csharp
288+
Yandex captcha = new Yandex();
289+
captcha.SetSiteKey("Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV");
290+
captcha.SetUrl("https://rutube.ru");
291+
```
292+
293+
### Lemin
294+
Use this method to solve Lemin and obtain a token to bypass the protection.
295+
296+
```csharp
297+
Lemin captcha = new Lemin();
298+
captcha.SetCaptchaId("CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d");
299+
captcha.SetApiServer("api.leminnow.com");
300+
captcha.SetUrl("http://sat2.aksigorta.com.tr");
301+
```
302+
303+
### Turnstile
304+
Use this method to solve Turnstile and obtain a token to bypass the protection.
305+
306+
```csharp
307+
Turnstile captcha = new Turnstile();
308+
captcha.SetSiteKey("0x4AAAAAAAChNiVJM_WtShFf");
309+
captcha.SetUrl("https://ace.fusionist.io");
310+
```
311+
312+
### AmazonWaf
313+
Use this method to solve AmazonWaf and obtain a token to bypass the protection.
314+
315+
```csharp
316+
AmazonWaf captcha = new AmazonWaf();
317+
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg");
318+
captcha.SetUrl("https://non-existent-example.execute-api.us-east-1.amazonaws.com");
319+
captcha.SetContext("test_iv");
320+
captcha.SetIV("test_context");
321+
```
322+
323+
258324
## Other methods
259325

260326
### send / getResult
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Linq;
3+
using TwoCaptcha.Captcha;
4+
5+
namespace TwoCaptcha.Examples
6+
{
7+
public class AmazonWafExample
8+
{
9+
public void Main()
10+
{
11+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
13+
AmazonWaf captcha = new AmazonWaf();
14+
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg");
15+
captcha.SetUrl("https://non-existent-example.execute-api.us-east-1.amazonaws.com");
16+
captcha.SetContext("test_iv");
17+
captcha.SetIV("test_context");
18+
19+
try
20+
{
21+
solver.Solve(captcha).Wait();
22+
Console.WriteLine("Captcha solved: " + captcha.Code);
23+
}
24+
catch (AggregateException e)
25+
{
26+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
27+
}
28+
}
29+
}
30+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Linq;
3+
using TwoCaptcha.Captcha;
4+
5+
namespace TwoCaptcha.Examples
6+
{
7+
public class AmazonWafOptionsExample
8+
{
9+
public void Main()
10+
{
11+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
13+
AmazonWaf captcha = new AmazonWaf();
14+
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg");
15+
captcha.SetUrl("https://non-existent-example.execute-api.us-east-1.amazonaws.com");
16+
captcha.SetContext("test_iv");
17+
captcha.SetIV("test_context");
18+
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT");
19+
20+
try
21+
{
22+
solver.Solve(captcha).Wait();
23+
Console.WriteLine("Captcha solved: " + captcha.Code);
24+
}
25+
catch (AggregateException e)
26+
{
27+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
28+
}
29+
}
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.IO;
3+
using System.Linq;
4+
using TwoCaptcha.Captcha;
5+
6+
namespace TwoCaptcha.Examples
7+
{
8+
internal class AudioCaptchaExample
9+
{
10+
public void Main()
11+
{
12+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
13+
14+
byte[] bytes = File.ReadAllBytes("../../resources/audio-en.mp3");
15+
string base64EncodedImage = Convert.ToBase64String(bytes);
16+
17+
AudioCaptcha captcha = new AudioCaptcha();
18+
captcha.SetBase64(base64EncodedImage);
19+
20+
try
21+
{
22+
solver.Solve(captcha).Wait();
23+
Console.WriteLine("Captcha solved: " + captcha.Code);
24+
}
25+
catch (AggregateException e)
26+
{
27+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
28+
}
29+
}
30+
}
31+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.IO;
3+
using System.Linq;
4+
using TwoCaptcha.Captcha;
5+
6+
namespace TwoCaptcha.Examples
7+
{
8+
internal class AudioCaptchaOptionsExample
9+
{
10+
public void Main()
11+
{
12+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
13+
14+
byte[] bytes = File.ReadAllBytes("../../resources/audio-ru.mp3");
15+
string base64EncodedImage = Convert.ToBase64String(bytes);
16+
17+
AudioCaptcha captcha = new AudioCaptcha();
18+
captcha.SetBase64(base64EncodedImage);
19+
captcha.SetLang("ru");
20+
21+
try
22+
{
23+
solver.Solve(captcha).Wait();
24+
Console.WriteLine("Captcha solved: " + captcha.Code);
25+
}
26+
catch (AggregateException e)
27+
{
28+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
29+
}
30+
}
31+
}
32+
}
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 GeeTestV4Example
8+
{
9+
public void Main()
10+
{
11+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
13+
GeeTestV4 captcha = new GeeTestV4();
14+
captcha.SetCaptchaId("72bf15796d0b69c43867452fea615052");
15+
captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
16+
captcha.SetUrl("https://mysite.com/captcha.html");
17+
18+
try
19+
{
20+
solver.Solve(captcha).Wait();
21+
Console.WriteLine("Captcha solved: " + captcha.Code);
22+
}
23+
catch (AggregateException e)
24+
{
25+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
26+
}
27+
}
28+
}
29+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Linq;
3+
using TwoCaptcha.Captcha;
4+
5+
namespace TwoCaptcha.Examples
6+
{
7+
public class GeeTestV4OptionsExample
8+
{
9+
public void Main()
10+
{
11+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
13+
GeeTestV4 captcha = new GeeTestV4();
14+
captcha.SetCaptchaId("72bf15796d0b69c43867452fea615052");
15+
captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
16+
captcha.SetUrl("https://mysite.com/captcha.html");
17+
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT");
18+
19+
try
20+
{
21+
solver.Solve(captcha).Wait();
22+
Console.WriteLine("Captcha solved: " + captcha.Code);
23+
}
24+
catch (AggregateException e)
25+
{
26+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
27+
}
28+
}
29+
}
30+
}
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 LeminExample
8+
{
9+
public void Main()
10+
{
11+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
13+
Lemin captcha = new Lemin();
14+
captcha.SetCaptchaId("CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d");
15+
captcha.SetApiServer("api.leminnow.com");
16+
captcha.SetUrl("http://sat2.aksigorta.com.tr");
17+
18+
try
19+
{
20+
solver.Solve(captcha).Wait();
21+
Console.WriteLine("Captcha solved: " + captcha.Code);
22+
}
23+
catch (AggregateException e)
24+
{
25+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
26+
}
27+
}
28+
}
29+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Linq;
3+
using TwoCaptcha.Captcha;
4+
5+
namespace TwoCaptcha.Examples
6+
{
7+
public class LeminOptionsExample
8+
{
9+
public void Main()
10+
{
11+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
13+
Lemin captcha = new Lemin();
14+
captcha.SetCaptchaId("CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d");
15+
captcha.SetApiServer("api.leminnow.com");
16+
captcha.SetUrl("http://sat2.aksigorta.com.tr");
17+
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT");
18+
19+
try
20+
{
21+
solver.Solve(captcha).Wait();
22+
Console.WriteLine("Captcha solved: " + captcha.Code);
23+
}
24+
catch (AggregateException e)
25+
{
26+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
27+
}
28+
}
29+
}
30+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Linq;
3+
using TwoCaptcha.Captcha;
4+
5+
namespace TwoCaptcha.Examples
6+
{
7+
public class TurnstileExample
8+
{
9+
public void Main()
10+
{
11+
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
12+
13+
Turnstile captcha = new Turnstile();
14+
captcha.SetSiteKey("0x4AAAAAAAChNiVJM_WtShFf");
15+
captcha.SetUrl("https://ace.fusionist.io");
16+
17+
try
18+
{
19+
solver.Solve(captcha).Wait();
20+
Console.WriteLine("Captcha solved: " + captcha.Code);
21+
}
22+
catch (AggregateException e)
23+
{
24+
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)