Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -554,11 +555,28 @@ audio := api2captcha.Audio{
}
```

### VKCaptcha

<sup>[API method description.](https://2captcha.com/2captcha-api#vkcaptcha)</sup>

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

<sup>[API method description.](https://2captcha.com/2captcha-api#prosopo-procaptcha)</sup>

Use this method to solve Prosopo Captcha and obtain a token to bypass the protection.

```go
prosopo := api2captcha.Prosopo{
SiteKey: "5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm",
Expand Down
20 changes: 20 additions & 0 deletions api2captcha.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ type (
Lang string
}

VKCaptcha struct {
File string
Base64 string
Steps string
}

Prosopo struct {
Url string
SiteKey string
Expand Down Expand Up @@ -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"},
Expand Down
Binary file added examples/.DS_Store
Binary file not shown.