I have a script in Python that helps me to post some notes in VK. But sometimes my script needs to solve captcha. I have following code:
vk = vkontakte.API(token=token)
response = vk.wall.repost(object = link)
As I understand, if I need to solve captcha, VK API raises exception. But, I couldn't find any examples for it. Problem is that I can't get captcha_sid and captcha_img from it.
Or maybe you know how can I get response in JSON format, not as exception ?
You can access vk api via http requests. For doing this you need access_token, read here how to get it if you dont have it already.
Then you way will be very easy by link
If repost done successfully, you will see response like this:
But if you need to solve captcha response will be like this:
Now you can easily get captcha sid and captcha_img link, download it, solve and repeat request upper just with adding 2 parameters to it:
captcha_key=YOUR_SOLVED_CAPTCHA&captcha_sid=SID_YOU_GOTSuccess :)