Answer the question
In order to leave comments, you need to log in
How to get captcha information using VK API?
Hello.
The following problem arose: after some requests from my script, VK sometimes asks to enter a captcha. As I understand it, if you use the VK API for Python, then an exception with an error number is also thrown. But inside the exception there is no information about the captcha.
The exception class is described here: https://github.com/dimka665/vk/blob/master/vk/exce...
Actually, the question is how to get the captcha_sid and captcha_img fields .
There is something similar in this question, but here the request is not made using the VK API: A request to the VK API with the captcha_key parameters returns another captcha, what is the error? I would like to understand how to do this using the VK API for Python.
Answer the question
In order to leave comments, you need to log in
In the repository, in the exceptions.py file , there is a class "VkAPIMethodError". Its constructor(?) contains the line self.error = error
. You can try to catch the error and call exception.error.get('captcha_sid')
I don't use python myself, maybe I'm wrong.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question