-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from zatvorius/master
New methods: - GeeTestV4 - Audio - Yandex - Lemin - Turnstile - AmazonWaf
- Loading branch information
Showing
21 changed files
with
567 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
public class AmazonWafExample | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
AmazonWaf captcha = new AmazonWaf(); | ||
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg"); | ||
captcha.SetUrl("https://non-existent-example.execute-api.us-east-1.amazonaws.com"); | ||
captcha.SetContext("test_iv"); | ||
captcha.SetIV("test_context"); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
public class AmazonWafOptionsExample | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
AmazonWaf captcha = new AmazonWaf(); | ||
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg"); | ||
captcha.SetUrl("https://non-existent-example.execute-api.us-east-1.amazonaws.com"); | ||
captcha.SetContext("test_iv"); | ||
captcha.SetIV("test_context"); | ||
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT"); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
internal class AudioCaptchaExample | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
byte[] bytes = File.ReadAllBytes("../../resources/audio-en.mp3"); | ||
string base64EncodedImage = Convert.ToBase64String(bytes); | ||
|
||
AudioCaptcha captcha = new AudioCaptcha(); | ||
captcha.SetBase64(base64EncodedImage); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
internal class AudioCaptchaOptionsExample | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
byte[] bytes = File.ReadAllBytes("../../resources/audio-ru.mp3"); | ||
string base64EncodedImage = Convert.ToBase64String(bytes); | ||
|
||
AudioCaptcha captcha = new AudioCaptcha(); | ||
captcha.SetBase64(base64EncodedImage); | ||
captcha.SetLang("ru"); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
public class GeeTestV4Example | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
GeeTestV4 captcha = new GeeTestV4(); | ||
captcha.SetCaptchaId("72bf15796d0b69c43867452fea615052"); | ||
captcha.SetChallenge("12345678abc90123d45678ef90123a456b"); | ||
captcha.SetUrl("https://mysite.com/captcha.html"); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
public class GeeTestV4OptionsExample | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
GeeTestV4 captcha = new GeeTestV4(); | ||
captcha.SetCaptchaId("72bf15796d0b69c43867452fea615052"); | ||
captcha.SetChallenge("12345678abc90123d45678ef90123a456b"); | ||
captcha.SetUrl("https://mysite.com/captcha.html"); | ||
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT"); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
public class LeminExample | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
Lemin captcha = new Lemin(); | ||
captcha.SetCaptchaId("CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d"); | ||
captcha.SetApiServer("api.leminnow.com"); | ||
captcha.SetUrl("http://sat2.aksigorta.com.tr"); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
public class LeminOptionsExample | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
Lemin captcha = new Lemin(); | ||
captcha.SetCaptchaId("CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d"); | ||
captcha.SetApiServer("api.leminnow.com"); | ||
captcha.SetUrl("http://sat2.aksigorta.com.tr"); | ||
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT"); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Linq; | ||
using TwoCaptcha.Captcha; | ||
|
||
namespace TwoCaptcha.Examples | ||
{ | ||
public class TurnstileExample | ||
{ | ||
public void Main() | ||
{ | ||
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY"); | ||
|
||
Turnstile captcha = new Turnstile(); | ||
captcha.SetSiteKey("0x4AAAAAAAChNiVJM_WtShFf"); | ||
captcha.SetUrl("https://ace.fusionist.io"); | ||
|
||
try | ||
{ | ||
solver.Solve(captcha).Wait(); | ||
Console.WriteLine("Captcha solved: " + captcha.Code); | ||
} | ||
catch (AggregateException e) | ||
{ | ||
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.