ekonda / sketal

Бот для ВКонтакте. Беседы / группы / развлечения.
MIT License
119 stars 64 forks source link

Ошибка обработки капчи #17

Closed Volcharka closed 7 years ago

Volcharka commented 7 years ago

Ключ установлен, но при появлении капчи бот выключается.

←[35m04:39:45←[0m - ←[31mERROR←[0m - ←[39mПроизошла фатальная ошибка во время работы:
←[0m
Traceback (most recent call last):
  File "C:\LOLBot-master1\command.py", line 40, in process_command
    await self.system.call_command(cmd_text, msg_obj, cmd.args)
  File "C:\LOLBot-master1\plugin_system.py", line 135, in call_command
    await command_function(*args, **kwargs)
  File "C:\LOLBot-master1\plugins\msg_sender.py", line 37, in write_msg
    result = await msg.vk.method('messages.send', val)
  File "C:\LOLBot-master1\vkplus.py", line 214, in method
    return await api_method(key, **data)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\api.py", line 9, in __call__
    return await getattr(self, method_name)(**method_kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\api.py", line 25, in __call__
    return await self._api._session.make_request(self, timeout)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\sessions.py", line 24,
in make_request
    return await self.send_api_request(method_request._method_name, params, timeout)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\sessions.py", line 41,
in send_api_request
    params['captcha_key'] = await self.enter_captcha(captcha_url, captcha_sid)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\sessions.py", line 59,
in enter_captcha
    raise VkCaptchaNeeded(url, sid)
aiovk.exceptions.VkCaptchaNeeded: You must enter the captcha

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "lolbot.py", line 252, in <module>
    loop.run_until_complete(bot.run(loop))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 466, in run_u
ntil_complete
    return future.result()
  File "lolbot.py", line 232, in run
    await self.check_event(event)
  File "lolbot.py", line 174, in check_event
    await self.check_if_command(data, msg_id)
  File "lolbot.py", line 236, in check_if_command
    result = await self.cmd_system.process_command(msg_obj)
  File "C:\LOLBot-master1\command.py", line 44, in process_command
    await msg_obj.answer(f"{msg_obj.vk.anti_flood()}. "
  File "C:\LOLBot-master1\vkplus.py", line 307, in answer
    await self.vk.method('messages.send', values)
  File "C:\LOLBot-master1\vkplus.py", line 214, in method
    return await api_method(key, **data)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\api.py", line 9, in __call__
    return await getattr(self, method_name)(**method_kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\api.py", line 25, in __call__
    return await self._api._session.make_request(self, timeout)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\sessions.py", line 24,
in make_request
    return await self.send_api_request(method_request._method_name, params, timeout)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\sessions.py", line 41,
in send_api_request
    params['captcha_key'] = await self.enter_captcha(captcha_url, captcha_sid)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiovk\sessions.py", line 59,
in enter_captcha
    raise VkCaptchaNeeded(url, sid)
aiovk.exceptions.VkCaptchaNeeded: You must enter the captcha
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0311DFD0>
PS C:\LOLBot-master1>
astrdark commented 7 years ago

Похоже, ты не установил requirements.txt. Сделай это: pip3 install -r requirements.txt

Volcharka commented 7 years ago

Я установил requirements.txt

astrdark commented 7 years ago

@Volcharka у тебя правильно указан сервис?

astrdark commented 7 years ago

'На текущий момент может принимать значение - rucaptcha или antigate'

Volcharka commented 7 years ago

Всё указано верно. Сервис rucapthca и ключ.

astrdark commented 7 years ago

@Volcharka проверь питон. Может у тебя запускается 2.7, а для работы бота надо 3+

Volcharka commented 7 years ago

У меня python 3.6, все нормально

ghost commented 7 years ago

@Volcharka попробуй с последними изменениями

Volcharka commented 7 years ago

Все теперь работает, в том числе с капчей на голосовые сообщения, но подозрительно дорого, 0.1 рубль за 1 разгадку капчи

ghost commented 7 years ago

@Volcharka это уже зависит от сервисов обработки капч :)