imartemy1524 / vk_captcha

Vk Captcha solver
MIT License
28 stars 11 forks source link

Код падает если картинка не погрузилась #10

Open SlowMotion241 opened 1 year ago

SlowMotion241 commented 1 year ago

Вот такая ошибка возникает:

solved accuracy(=0.1688) < miniumum(=0.4). Trying again. Solved accuracy(=0.1157) < miniumum(=0.4). Trying again. Traceback (most recent call last): File "/Users/Documents/Python/vk_captcha/main.py", line 38, in <module> asyncio.run(captcha_solver()) File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/Documents/Python/vk_captcha/main.py", line 35, in captcha_solver answer, accuracy = await solver.solve_async(url=url, minimum_accuracy=0.4, repeat_count=10) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/vk_captcha/solver.py", line 146, in solve_async answer, accuracy = next(iter(completed)).result() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/vk_captcha/solver.py", line 156, in _solve_task img: "np.ndarray" = img.astype(np.float32) / 255. ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'astype'