S
S
sharkyyy32019-11-05 16:30:43
Python
sharkyyy3, 2019-11-05 16:30:43

How to send response to vk captcha via requests?

An example of a response if you need to enter a CAPTCHA:
{"error":"need_captcha","captcha_sid":"854844498568","captcha_img":"http:\/\/api.vk.com\/captcha.php?sid=854844498568&s= 1"}
In this case, you need to repeat the request, adding the following parameters to it:
captcha_sid — captcha_sid field received in the previous request;
captcha_key - what the user entered.
In which method is it necessary to pass "captcha_sid" and "captcha_key"?
Tried to transfer in the same one that called without these parameters before. But an exception is thrown if the captcha is entered correctly:

{"error":{"error_code":100,"error_msg":"One of the parameters specified was missing or invalid: 
object not found","request_params":
[{"key":"method","value":"likes.add"},{"key":"oauth","value":"1"},
{"key":"captcha_sid","value":"392898328546"},{"key":"owner_id","value":"546870322"},
{"key":"captcha_key","value":"vhpx"},{"key":"item_id","value":"150"},{"key":"type","value":"post"},{"key":"v","value":"5.101"}]}}

And if not true, then:
{"error":{"error_code":14,"error_msg":"Captcha needed","request_params":[{"key":"method","value":"likes.add"},
{"key":"oauth","value":"1"},{"key":"captcha_sid","value":"926796145969"},{"key":"owner_id","value":"320972793"},
{"key":"captcha_key","value":"1"},{"key":"item_id","value":"150"},{"key":"type","value":"post"},
{"key":"v","value":"5.101"}],"captcha_sid":"100865761840","captcha_img":"https:\/\/api.vk.com\/captcha.php?
sid=100865761840&s=1"}}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question