-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathCaptchafoxExample.cs
More file actions
31 lines (28 loc) · 1.02 KB
/
CaptchafoxExample.cs
File metadata and controls
31 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Linq;
using TwoCaptcha.Captcha;
namespace TwoCaptcha.Examples
{
public class CaptchafoxExample
{
public CaptchafoxExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);
Captchafox captcha = new Captchafox();
captcha.SetSiteKey("sk_ILKWNruBBVKDOM7dZs59KHnDLEWiH");
captcha.SetUrl("https://mysite.com/page/with/captchafox");
captcha.SetUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36");
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT");
captcha.SetApiServer("api_server");
try
{
solver.Solve(captcha).Wait();
Console.WriteLine("Captcha solved: " + captcha.Code);
}
catch (AggregateException e)
{
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
}
}
}
}