-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDataDomeExample.cs
30 lines (27 loc) · 1.07 KB
/
DataDomeExample.cs
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
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:[email protected]: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);
}
}
}
}