diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..425ead8 Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md index c15de0c..f070d49 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Examples of API requests for different captcha types are available on the [Golan - [Cutcaptcha](#cutcaptcha) - [Friendly Captcha](#friendly-captcha) - [Audio Captcha](#audio-captcha) + - [VK Captcha](#vk-captcha) - [Prosopo](#prosopo) - [Captchafox](#captchafox) - [Temu](#temu) @@ -554,11 +555,28 @@ audio := api2captcha.Audio{ } ``` +### VKCaptcha + +[API method description.](https://2captcha.com/2captcha-api#vkcaptcha) + +We offer two methods to solve this type of captcha - token-based and image-based. + +We use the body (image in base64 format) or file (image as file) and steps parameters. +You can get both values from the response to the request https://api.vk.com/method/captchaNotRobot.getContent?v={API_VER} when loading the captcha widget on the page. + +```go +vkcaptcha := api2captcha.VKCaptcha{ + Base64: "/9j/4AAQSkZJRgABAQAAAQABAAD/2wB...", + Steps: "[5,19,14,14,6,4,8,9...] +} +``` + ### Prosopo [API method description.](https://2captcha.com/2captcha-api#prosopo-procaptcha) Use this method to solve Prosopo Captcha and obtain a token to bypass the protection. + ```go prosopo := api2captcha.Prosopo{ SiteKey: "5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm", diff --git a/api2captcha.go b/api2captcha.go index ffdee24..345678e 100644 --- a/api2captcha.go +++ b/api2captcha.go @@ -231,6 +231,12 @@ type ( Lang string } + VKCaptcha struct { + File string + Base64 string + Steps string + } + Prosopo struct { Url string SiteKey string @@ -1123,6 +1129,20 @@ func (c *Audio) ToRequest() Request { return req } +func (c *VKCaptcha) ToRequest() Request { + req := Request{ + Params: map[string]string{"method": "vkimage"}, + } + if c.File != "" { + req.Files["file"] = c.File + } + if c.Base64 != "" { + req.Params["body"] = c.Base64 + } + if c.Steps != "" { + req.Params["steps"] = c.Steps + } + func (c *Prosopo) ToRequest() Request { req := Request{ Params: map[string]string{"method": "prosopo"}, diff --git a/examples/.DS_Store b/examples/.DS_Store new file mode 100644 index 0000000..f11e5d9 Binary files /dev/null and b/examples/.DS_Store differ