Vinyzu / DiscordGenerator

Dislock, the most advanced Discord Browser Generator. Powered by hCaptcha Solving AI.
GNU General Public License v3.0
210 stars 53 forks source link

Timeout exceeded while selecting hidden element #84

Open FeelsBadMan1 opened 1 year ago

FeelsBadMan1 commented 1 year ago

Hello, after some time when it can't load the captcha, the issue below happen (it don't show in which line tho) and every time this issue happen the code just stops (don't restart browser and continue again as it should) is there any solution?

Timeout 30000ms exceeded.
=========================== logs ===========================
  waiting for frame "xpath=//iframe[contains(@title,'content')] >> nth=0"
  selector resolved to hidden <iframe scrolling="no" frameborder="0" title="Main conte…></iframe>
waiting for selector "//iframe[contains(@title,'content')] >> nth=0 >> control=enter-frame >> //h2[@class='prompt-text']"
============================================================
FuckingToasters commented 1 year ago

Hello @FeelsBadMan1 , I looked in the script and i think i found what cause the error.

In the specific part where i've looked at it handeld a exception (except Exception as e: print(e)) but didn't raised the Exception, that's why you got Timeout 30000ms exceeded. without showing the line where the issue happend,

I changed it to raise e for debugging purposes and then noticed what the actual error is and in which line this error does happen.

Afterwards i implemented a check so whenever this error happen the script will restart the browser instead of doing nothing or open new ones without closing any other current open one.

I'll update my edited version on my github fork later (other issues are fixed within this fork too)

Vinyzu commented 1 year ago

@FuckingToasters please pull request :)

FuckingToasters commented 1 year ago

@FuckingToasters please pull request :)

The captcha solving in the new version with botright is found in botright/modules/hcaptcha.py. I've made a pull request for this here: https://github.com/Vinyzu/Botright/pull/5