Answer the question
In order to leave comments, you need to log in
How to attach anti-captcha module to vk_api?
For example, there is a code like this
import random
import requests
import vk_api
token = 'TOKEN' # Токен пользователя
delay = '5' # Задержка в секундах
vk_session = vk_api.VkApi(token=token)
from vk_api.longpoll import VkLongPoll, VkEventType
longpoll = VkLongPoll(vk_session)
vk = vk_session.get_api()
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
if 'Привет:' in event.text:
time.sleep(int(delay))
if event.from_user:
vk.messages.send(
user_id = event.user_id,
random_id = random.randint(111111,999999999),
message = 'Привет'
)
try:
vk.messages.send(
user_id = event.user_id,
random_id = random.randint(111111,999999999),
message = 'Привет'
)
except vk_api.Captcha as e:
print(e.url) #картинка с капчей
print(e.sid) #sid капчи для отправки ответа
Answer the question
In order to leave comments, you need to log in
>>
I can send it to anti-captcha, get a solution
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question