-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathVkCaptchaExample.cs
More file actions
36 lines (32 loc) · 1.12 KB
/
VkCaptchaExample.cs
File metadata and controls
36 lines (32 loc) · 1.12 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
32
33
34
35
36
using System;
using System.IO;
using System.Linq;
using TwoCaptcha.Captcha;
using static System.Net.Mime.MediaTypeNames;
namespace TwoCaptcha.Examples
{
public class VkCaptchaExample
{
public VkCaptchaExample(string apiKey)
{
TokenBased(apiKey);
}
private void TokenBased(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);
VkCaptcha captcha = new VkCaptcha("vkcaptcha");
captcha.SetRedirectUri("https://id.vk.com/not_robot_captcha?domain=vk.com&session_token=eyJ....HGsc5B4LyvjA&variant=popup&blank=1");
captcha.SetuserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36");
captcha.SetProxy("http", "1.2.3.4");
try
{
solver.Solve(captcha).Wait();
Console.WriteLine("Captcha solved: " + captcha.Code);
}
catch (AggregateException e)
{
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
}
}
}
}