Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taking too much time #23

Closed
Ubnlqs opened this issue Dec 11, 2021 · 14 comments
Closed

taking too much time #23

Ubnlqs opened this issue Dec 11, 2021 · 14 comments
Assignees

Comments

@Ubnlqs
Copy link

Ubnlqs commented Dec 11, 2021

const solveCaptcha = require('hcaptcha-solver');

(async () => {
    try {
      const response = await solveCaptcha('https://2captcha.com/');
      console.log(response);
      // F0_eyJ0eXAiOiJKV1Q...
    } catch (error) {
      console.log(error);
    }
})();

it takes lot of time ( 40 seconds )
Can I fix it?

@Ubnlqs Ubnlqs added the bug Something isn't working label Dec 11, 2021
@aw1875
Copy link
Owner

aw1875 commented Dec 11, 2021

It's TensorFlow related. With Google's Cloud Vision it would finish around 5-10 seconds but Google recently changed their system so people have to play and I figured people wouldn't want to do that. If enough people are interested I can reintroduce Google's Vision again and have the option between that or TensorFlow.

@aw1875 aw1875 removed the bug Something isn't working label Dec 11, 2021
@JokersCat
Copy link

Oh that would be amazing I’m completely new in js and only know Python quite good.So some code looks simular to py so yeah I will try to use it I guess and thx for the work and please add google vision back 😂

@JokersCat
Copy link

I think people are interested to pay because there are websites where you have to solve a hcaptcha to get registered and this registered accounts can get soled for a bit 😅

@aw1875
Copy link
Owner

aw1875 commented Dec 11, 2021

@JokersCat Honestly, the main issue is that you can't use threading in Node. If threading was really possible I could definitely speed up the process by running all the image detection processes at once. I was thinking about maybe looking into trying to incorporate something like calling a C# class for this. Also, I'm almost finished finals so I will try to work on adding the option for Cloud Vision again after (or the C# class) I finish.

@JokersCat
Copy link

Oh okay I saw that you made something before in Python would it be possible to you to make maybe a Python library on that? 😅

@aw1875
Copy link
Owner

aw1875 commented Dec 11, 2021

@JokersCat this project was based off of this python repo initially. I haven't worked with Python in a very long time so I probably wouldn't attempt to make this into a Python library

@JokersCat
Copy link

Would you attempt it for money 🧐

@aw1875
Copy link
Owner

aw1875 commented Dec 12, 2021

@JokersCat take a look at this repo. I feel like this is what you’re looking for in Python. With some modifications it can work almost the same way as this repo.

@JokersCat
Copy link

Oh okay thx and do you got a tip for me how I could inject a hcaptcha token into a website? (with the browser console)

@aw1875
Copy link
Owner

aw1875 commented Dec 12, 2021

Ya for sure, its actually super easy. I'll write an example using pyppeteer (a Python version that tries to replicate puppeteer). Once you get your token (however you decide to do that) you would do something like this:

await page.evaluate(() => {
    document.querySelector('[name="h-captcha-response"]').value = "YOUR TOKEN";
});

I just want to note that you may have to look a little more into the documentation of pyppeteer to confirm this is accurate if you decide to use it over something else like selenium. But, regardless of what you choose the process should be relatively similar. You need to find the query selector with the name "h-captcha-response" on the page and set it's value to the returned token.

@JokersCat
Copy link

JokersCat commented Dec 13, 2021

Oh okay thank you I used selenium before.There you can use a command something like driver.execute_script or something like that.To execute a browser script

@JokersCat
Copy link

But that doesnt worked for me so idk :( I actually searched about this topic and found other people got the same issue but none of them got a solution :(

@aw1875
Copy link
Owner

aw1875 commented Dec 13, 2021

As long as your token is right you just need to set the value of the queryselector I sent above. There is nothing else to do once you get the token

@aw1875
Copy link
Owner

aw1875 commented Dec 14, 2021

I'm going to close this issue as it has been addressed 54c8451

@aw1875 aw1875 closed this as completed Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants