-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvkimage.cpp
More file actions
47 lines (36 loc) · 1.15 KB
/
vkimage.cpp
File metadata and controls
47 lines (36 loc) · 1.15 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
37
38
39
40
41
42
43
44
45
46
47
#include <cstdio>
#include <filesystem>
#include <iostream>
#include "curl_http.hpp"
#include "api2captcha.hpp"
using namespace std;
int main (int ac, char ** av)
{
if (ac < 2)
{
printf ("Usage: ./vkimage \"API KEY\"\n");
return 0;
}
string current_path = filesystem::current_path().c_str();
string image = current_path + "/assets/vk.jpg";
api2captcha::curl_http_t http;
http.set_verbose (true);
api2captcha::client_t client;
client.set_http_client (&http);
client.set_api_key (av[1]);
std::string method = "vkimage";
const char *c_strMethod = method.c_str();
api2captcha::vk_t cap (c_strMethod);
cap.set_file (image);
cap.set_steps ("[5,12,22,24,21,23,10,7,2,8,19,18,8,24,21,22,11,14,16,5,18,20,4,21,12,6,0,0,11,12,8,20,19,3,14,8,9,13,16,24,18,3,2,23,8,12,6,1,11,0,20,15,19,22,17,24,8,0,12,5,19,14,11,6,7,14,23,24,23,20,4,20,6,12,4,17,4,18,6,20,17,5,23,7,10,2,8,9,5,4,17,24,11,14,4,10,12,22,21,2]");
try
{
client.solve (cap);
printf ("code '%s'\n", cap.code ().c_str ());
}
catch (std::exception & e)
{
fprintf (stderr, "Failed: %s\n", e.what ());
}
return 0;
}