Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ riderModule.iml
.idea
.vs
info.md
Properties/
239 changes: 199 additions & 40 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions TwoCaptcha.Examples/AmazonWafExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace TwoCaptcha.Examples
{
public class AmazonWafExample
{
public void Main()
public AmazonWafExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

AmazonWaf captcha = new AmazonWaf();
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg");
Expand Down
4 changes: 2 additions & 2 deletions TwoCaptcha.Examples/AmazonWafOptionsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace TwoCaptcha.Examples
{
public class AmazonWafOptionsExample
{
public void Main()
public AmazonWafOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

AmazonWaf captcha = new AmazonWaf();
captcha.SetSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg");
Expand Down
29 changes: 29 additions & 0 deletions TwoCaptcha.Examples/AtbCAPTCHAExample.cs
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 AtbCAPTCHAExample
{
public AtbCAPTCHAExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);

AtbCAPTCHA atbCAPTCHA = new AtbCAPTCHA();
atbCAPTCHA.SetAppId("af23e041b22d000a11e22a230fa8991c");
atbCAPTCHA.SetApiServer("https://cap.aisecurius.com");
atbCAPTCHA.SetPageUrl("https://www.example.com/");

try
{
solver.Solve(atbCAPTCHA).Wait();
Console.WriteLine("Captcha solved: " + atbCAPTCHA.Code);
}
catch (AggregateException e)
{
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
}
}
}
}
8 changes: 4 additions & 4 deletions TwoCaptcha.Examples/AudioCaptchaExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

namespace TwoCaptcha.Examples
{
internal class AudioCaptchaExample
public class AudioCaptchaExample
{
public void Main()
public AudioCaptchaExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

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

AudioCaptcha captcha = new AudioCaptcha();
Expand Down
8 changes: 4 additions & 4 deletions TwoCaptcha.Examples/AudioCaptchaOpdionsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

namespace TwoCaptcha.Examples
{
internal class AudioCaptchaOptionsExample
public class AudioCaptchaOptionsExample
{
public void Main()
public AudioCaptchaOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

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

AudioCaptcha captcha = new AudioCaptcha();
Expand Down
6 changes: 3 additions & 3 deletions TwoCaptcha.Examples/CanvasBase64Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace TwoCaptcha.Examples
{
public class CanvasBase64Example
{
public void Main()
public CanvasBase64Example(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

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

Canvas captcha = new Canvas();
Expand Down
6 changes: 3 additions & 3 deletions TwoCaptcha.Examples/CanvasExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace TwoCaptcha.Examples
{
public class CanvasExample
{
public void Main()
public CanvasExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

Canvas captcha = new Canvas();
captcha.SetFile("../../resources/canvas.jpg");
captcha.SetFile("resources/canvas.jpg");
captcha.SetHintText("Draw around apple");

try
Expand Down
8 changes: 4 additions & 4 deletions TwoCaptcha.Examples/CanvasOptionsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ namespace TwoCaptcha.Examples
{
public class CanvasOptionsExample
{
public void Main()
public CanvasOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

Canvas captcha = new Canvas();
captcha.SetFile("../../resources/canvas.jpg");
captcha.SetFile("resources/canvas.jpg");
captcha.SetPreviousId(0);
captcha.SetCanSkip(false);
captcha.SetLang("en");
captcha.SetHintImg(new FileInfo("../../resources/canvas_hint.jpg"));
captcha.SetHintImg(new FileInfo("resources/canvas_hint.jpg"));
captcha.SetHintText("Draw around apple");

try
Expand Down
4 changes: 2 additions & 2 deletions TwoCaptcha.Examples/CapyExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace TwoCaptcha.Examples
{
public class CapyExample
{
public void Main()
public CapyExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

Capy captcha = new Capy();
captcha.SetSiteKey("PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v");
Expand Down
4 changes: 2 additions & 2 deletions TwoCaptcha.Examples/CapyOptionsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace TwoCaptcha.Examples
{
public class CapyOptionsExample
{
public void Main()
public CapyOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

Capy captcha = new Capy();
captcha.SetSiteKey("PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v");
Expand Down
6 changes: 3 additions & 3 deletions TwoCaptcha.Examples/CoordinatesBase64Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace TwoCaptcha.Examples
{
public class CoordinatesBase64Example
{
public void Main()
public CoordinatesBase64Example(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

byte[] bytes = File.ReadAllBytes("../../resources/grid.jpg");
byte[] bytes = File.ReadAllBytes("resources/grid.jpg");
string base64EncodedImage = Convert.ToBase64String(bytes);

Coordinates captcha = new Coordinates();
Expand Down
6 changes: 3 additions & 3 deletions TwoCaptcha.Examples/CoordinatesExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace TwoCaptcha.Examples
{
public class CoordinatesExample
{
public void Main()
public CoordinatesExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

Coordinates captcha = new Coordinates("../../resources/grid.jpg");
Coordinates captcha = new Coordinates("resources/grid.jpg");

try
{
Expand Down
8 changes: 4 additions & 4 deletions TwoCaptcha.Examples/CoordinatesOptionsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ namespace TwoCaptcha.Examples
{
public class CoordinatesOptionsExample
{
public void Main()
public CoordinatesOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

Coordinates captcha = new Coordinates();
captcha.SetFile("src/main/resources/grid_2.jpg");
captcha.SetFile("resources/grid_2.jpg");
captcha.SetLang("en");
captcha.SetHintImg(new FileInfo("../../resources/grid_hint.jpg"));
captcha.SetHintImg(new FileInfo("resources/grid_hint.jpg"));
captcha.SetHintText("Select all images with an Orange");

try
Expand Down
29 changes: 29 additions & 0 deletions TwoCaptcha.Examples/CutcaptchaExample.cs
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 CutcaptchaExample
{
public CutcaptchaExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);

Cutcaptcha cutcaptcha = new Cutcaptcha();
cutcaptcha.SetMiseryKey("a1488b66da00bf332a1488993a5443c79047e752");
cutcaptcha.SetPageUrl("https://example.cc/foo/bar.html");
cutcaptcha.SetApiKey("SAb83IIB");

try
{
solver.Solve(cutcaptcha).Wait();
Console.WriteLine("Captcha solved: " + cutcaptcha.Code);
}
catch (AggregateException e)
{
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
}
}
}
}
29 changes: 29 additions & 0 deletions TwoCaptcha.Examples/CyberSiARAExample.cs
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 CyberSiARAExample
{
public CyberSiARAExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);

CyberSiARA cyberSiARA = new CyberSiARA();
cyberSiARA.SetMasterUrlId("tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv");
cyberSiARA.SetPageUrl("https://demo.mycybersiara.com/");
cyberSiARA.SetUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36");

try
{
solver.Solve(cyberSiARA).Wait();
Console.WriteLine("Captcha solved: " + cyberSiARA.Code);
}
catch (AggregateException e)
{
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
}
}
}
}
30 changes: 30 additions & 0 deletions TwoCaptcha.Examples/DataDomeExample.cs
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 DataDomeExample
{
public DataDomeExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);

DataDome dataDome = new DataDome();
dataDome.SetCapthaUrl("https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAA...P~XFrBVptk&t=fe&referer=https%3A%2F%2Fhexample.com&s=45239&e=c538be..c510a00ea");
dataDome.SetPageUrl("https://example.com/");
dataDome.SetProxy("http", "username:password@1.2.3.4:5678");
dataDome.SetUserAgent("Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.3");

try
{
solver.Solve(dataDome).Wait();
Console.WriteLine("Captcha solved: " + dataDome.Code);
}
catch (AggregateException e)
{
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
}
}
}
}
4 changes: 2 additions & 2 deletions TwoCaptcha.Examples/FriendlyCaptchaExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace TwoCaptcha.Examples
{
public class FriendlyCaptchaExample
{
public void Main()
public FriendlyCaptchaExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

FriendlyCaptcha captcha = new FriendlyCaptcha();
captcha.SetSiteKey("2FZFEVS1FZCGQ9");
Expand Down
5 changes: 3 additions & 2 deletions TwoCaptcha.Examples/FunCaptchaExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
namespace TwoCaptcha.Examples
{
public class FunCaptchaExample

{
public void Main()
public FunCaptchaExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

FunCaptcha captcha = new FunCaptcha();
captcha.SetSiteKey("69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC");
Expand Down
4 changes: 2 additions & 2 deletions TwoCaptcha.Examples/FunCaptchaOptionsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace TwoCaptcha.Examples
{
public class FunCaptchaOptionsExample
{
public void Main()
public FunCaptchaOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

FunCaptcha captcha = new FunCaptcha();
captcha.SetSiteKey("69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC");
Expand Down
8 changes: 4 additions & 4 deletions TwoCaptcha.Examples/GeeTestExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ namespace TwoCaptcha.Examples
{
public class GeeTestExample
{
public void Main()
public GeeTestExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

GeeTest captcha = new GeeTest();
captcha.SetGt("f2ae6cadcf7886856696502e1d55e00c");
captcha.SetApiServer("api-na.geetest.com");
captcha.SetApiServer("api.geetest.com");
captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
captcha.SetUrl("https://mysite.com/captcha.html");
captcha.SetUrl("https://2captcha.com/demo/geetest");

try
{
Expand Down
8 changes: 4 additions & 4 deletions TwoCaptcha.Examples/GeeTestOptionsExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ namespace TwoCaptcha.Examples
{
public class GeeTestOptionsExample
{
public void Main()
public GeeTestOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
TwoCaptcha solver = new TwoCaptcha(apiKey);

GeeTest captcha = new GeeTest();
captcha.SetGt("f2ae6cadcf7886856696502e1d55e00c");
captcha.SetApiServer("api-na.geetest.com");
captcha.SetApiServer("api.geetest.com");
captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
captcha.SetUrl("https://mysite.com/captcha.html");
captcha.SetUrl("https://2captcha.com/demo/geetest");
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT");

try
Expand Down
Loading