xTerradon / hcaptcha-solver

Automated hCaptcha solver using binary image classification networks
https://pypi.org/project/hcaptcha-solver/
21 stars 6 forks source link

Handling of multiple challenges in one captcha #14

Closed xTerradon closed 11 months ago

xTerradon commented 11 months ago

As @ludwig7685 pointed out, there are instances when hCaptcha needs two (and maybe more?) challenges to be solved in order to mark the checkbox as completed. To implement this:

  1. wd_handler.py: requires_multiple_challenges(wd) -> checks if the open challenge requires multiple solves
  2. hcaptcha_solver.py: logic for checking if multiple challenges have to be solved and repreating solve process

the html element for accessing that info (check for number of crumbs)

<div class="crumbs-wrapper" style="width: 19px; height: 7px; position: absolute; left: 130.5px;">
    <div class="Crumb" style="width: 7px; height: 7px; overflow: hidden; border-radius: 50%; left: 0px; top: 0px; position: absolute;"><div class="crumb-bg" style="background-color: rgb(0, 131, 143); width: 7px; height: 7px;"></div></div>
    <div class="Crumb" style="width: 7px; height: 7px; overflow: hidden; border-radius: 50%; left: 12px; top: 0px; position: absolute;"><div class="crumb-bg" style="background-color: rgb(245, 245, 245); width: 7px; height: 7px;"></div></div>
</div>
xTerradon commented 11 months ago

v0.2.14 adresses this with the get_number_of_crumbs() function in wd_handler.py, prompting the solver to repeat the solving process for as many times as necessary