vk_api + anti-captcha

Install python libraries:

pip install antigate

pip install grab pycurl

pip install requests

init:

vk_session = vk_api.VkApi(phone, password), captcha_handler=captcha_handler)

def captcha_handler(captcha):
    urllib.urlretrieve(str(captcha.get_url()), "captcha.jpg")
    gate = AntiGate(ANTI_CAPTCHA_API_KEY)
    captcha_id = gate.send('captcha.jpg')
    key = gate.get(captcha_id)
    return captcha.try_again(key)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s