From 969fa3071f2085512a19c910ea69bc13a7d5eb25 Mon Sep 17 00:00:00 2001 From: PBadicean Date: Mon, 22 Sep 2025 22:33:12 +0200 Subject: [PATCH] added vk-method --- .DS_Store | Bin 0 -> 6148 bytes README.md | 17 +++++++++++++++++ api2captcha.go | 22 ++++++++++++++++++++++ examples/.DS_Store | Bin 0 -> 6148 bytes 4 files changed, 39 insertions(+) create mode 100644 .DS_Store create mode 100644 examples/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..425ead8e0974c05be4101f97147d16b74ab278b8 GIT binary patch literal 6148 zcmeHKy-LJD5T14d=-#;#6|6;4ZeH^?S`yEp8Qa#Wc-BC>~ zRhU0V`zKGUbuq(plxHVD=NPS3H^1lE78ji>m4`s|1JHhbjzz|vhVE^NUIrkEr;}vtoP7of5lT@IjI&CqWq{HqtE?4XXC7ql$ zA5M36+M&3xJJ$ChoLnwwqcLC%#0>1o<%H}1)#m;`PO>Xwz!=ym23%T{#SFKkwRLoJ uTx&h_7RthLonW7WNhrmLLk3gWo24mn)8Tba)`$[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...] +} +``` + ## Other methods ### Send / GetResult diff --git a/api2captcha.go b/api2captcha.go index 6240745..8dc01a3 100644 --- a/api2captcha.go +++ b/api2captcha.go @@ -228,6 +228,12 @@ type ( Base64 string Lang string } + + VKCaptcha struct { + File string + Base64 string + Steps string + } ) var ( @@ -1097,3 +1103,19 @@ 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 + } + return req +} diff --git a/examples/.DS_Store b/examples/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f11e5d991b61490c1b7766e718964343ed88664b GIT binary patch literal 6148 zcmeHKK~BR!475Xqg1F>}#3f(InMUpKP{HI3%>j{d(UBx(kwK1gY-!Wn7qh#rU5~uo@E;kF zXLm{q+TgdM{pXhy&Hi}XRaM<|HSFnC_Fms^->%0#%U^xg4?FuLnPUoUvPXJC4l8;F zE~pvqrR4RH&u%^+mwi5?x!Ue4r=R==dBy*Qq~_ubI0MeWQ89p;Es~xqdg}~01I|Ft zfV>}as9_H v-JI0g96E=Jh+k0bL(qw(7`{@9FQ8Fi&!qz_4TB;q5dRQ}G