thicccat688 / selenium-recaptcha-solver

ReCAPTCHA solver for selenium (Using audio).
MIT License
105 stars 37 forks source link

Several enhancements #2

Closed alexreg closed 1 year ago

alexreg commented 1 year ago

Three additions/changes here:

  1. Support nested frames, since this is the scenario when you encounter the Incapsula version of reCAPTCHA. Very similar fix – just means switching to parent_frame instead of default_content.
  2. Add a slow mode that sleeps a random time (between 1 and 4 seconds) before UI interactions. Maybe this can be optimised a bit more, or made configurable even, but this definitely helps with some websites I've tested on.
  3. Use Google Cloud Speech-to-Text API. As far as I can tell, the older Google Speech Recognition API is quite different, and indeed now deprecated.
thicccat688 commented 1 year ago

Hi Alex,

I've been looking at your changes, and they look pretty good!

I've made one comment on a minor improvement, so if you could change that, I'll merge your pull request.

Your contribution is very constructive, so thank you!

alexreg commented 1 year ago

Hi @thicccat688, glad to hear! I'd be happy to change that one thing, though I don't see your comment unfortunately... could you link me to it please?

thicccat688 commented 1 year ago

@alexreg You should be able to see it now.

alexreg commented 1 year ago

@thicccat688 Fixed that now. :-)

EDIT: I see you already merged. Cheers!

thicccat688 commented 1 year ago

@alexreg I'll publish the changes to PyPi now. Thanks again, and have a great day!

alexreg commented 1 year ago

@thicccat688 By the way, if you have any thoughts on how to make "slow mode" more configurable, I'm happy to hear them and make another PR. The random short delay seems to work well for me, but it might be too much for some other users, I'm not sure.

thicccat688 commented 1 year ago

@alexreg Hi. I tested your changes again today, and the API is saying default credentials aren't allowed. Do you have any idea what could have changed? If no defaults are available, I'll have to switch back to the old speech recognition API and keep the one you added as an alternative option you can pick if you have credentials.

alexreg commented 1 year ago

@thicccat688 Oh sorry. I meant to test with the default credentials (i.e. none specified), but forgot to. Would you like me to prepare a PR that reverts the default to the previous (old) Speech Recognition API but allows mine as an alternative? I could even add options for the other providers like Bing and IBM, since speech_recognition supports them out of the box, and thus it wouldn't require much code at all.

thicccat688 commented 1 year ago

@alexreg That sounds great! Make sure to let me know if you need any help.