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

[Question]: Doing wrong? #27

Closed
Oberonskii opened this issue Dec 23, 2021 · 21 comments
Closed

[Question]: Doing wrong? #27

Oberonskii opened this issue Dec 23, 2021 · 21 comments
Labels
question Further information is requested

Comments

@Oberonskii
Copy link

Okey... So it installed correctly now, but it it not really working. When it is solving, there is nothin in the console, only the Tensorflow warning... I will submit the code I am executing here
What am I doing wrong?

solve.txt

@Oberonskii Oberonskii added the question Further information is requested label Dec 23, 2021
@aw1875
Copy link
Owner

aw1875 commented Dec 23, 2021

Please read the documentation. The code you've taken from the documentation example is for automatically setting the value within the browser. You haven't added any sort of code to submit the page or notify you in the console to submit the page once completed. If you look at this part of the code

  // Your page is ready to submit.
  // Captcha solving should be the last function on your page so we
  // don't have to worry about the response token expiring.
  /**
   * Example:
   * await page.click("loginDiv > loginBtn");
   */

It explains it there. For your example using 2captcha's demo site you'd want to either add

console.log('Page is ready to submit');

to your code so you are notified to submit. Or, you want to add

await page.click('#root > div > main > div > section > form > button._2iYm2u0v9LWjjsuiyfKsv4._1z3RdCK9ek3YQYwshGZNjf._3zBeuZ3zVV-s2YdppESngy._28oc7jlCOdc1KAtktSUZvQ');

to automatically press the "Check" button after sovling.

@Oberonskii
Copy link
Author

Hello! I now added a line, where it is printing the token. That worked one time, but now it is stuck at the same point again as at the beginning.
Screenshot:
hcaptcha

@aw1875
Copy link
Owner

aw1875 commented Dec 23, 2021

The tensorflow warning is noted in the known issues part of the documentation. It has no impact on the functions of the program. Is that what you are talking about?

@Oberonskii
Copy link
Author

No. I mean that there is nothing more happening when I run the code/program

@aw1875
Copy link
Owner

aw1875 commented Dec 23, 2021

Try the token verison, does it return a token?

@Oberonskii
Copy link
Author

No. It doesnt...
I ran the code with the chrome tab over night, and got this in my console:

throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^

Error: Evaluation failed: StatusCodeError: 400 - {"c":{"type":"hsw","req":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzIjoxNiwidCI6InciLCJkIjoiYzNTOTdKNkNDaXdVbXRsbElHWVVuNXR4azliL3F0TVA2cldDM2JmSG03WWtUMFdoL1I4TXJGb04vcExDZEs4WXdidW92WFhuaEJtMXArcElaZXQrUFpvNDRwRlpoVzN3R3BzRkg2K2ZIRWttWkxwYzJaOVk5Nys5cXhVSkk4NmJIekN3bUFYSUxrVGN4TFRFTXMxOE84Z21LWTZURlN4NmtuUEpRL0MyenFObUJ3c1AzWm50dGcwb0NGYz1neFNNYjB3WkpZOFU2c01TIiwibCI6Imh0dHBzOi8vbmV3YXNzZXRzLmhjYXB0Y2hhLmNvbS9jLzU0MjNlMzI5IiwiZSI6MTY0MDI5OTkxNn0.SrXUnvOS0dxa2NZlx4Y4YmH1RVF-Efw-MWChHM0vRxo"},"pass":false,"error":"missing data"}
at new StatusCodeError (C:\Users\user\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Users\user\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (C:\Users\user\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Users\user\node_modules\request\request.js:185:22)
at Request.emit (node:events:390:28)
at Request. (C:\Users\user\node_modules\request\request.js:1154:10)
at Request.emit (node:events:390:28)
at IncomingMessage. (C:\Users\user\node_modules\request\request.js:1076:12)
at Object.onceWrapper (node:events:509:28)
at IncomingMessage.emit (node:events:402:35)
at ExecutionContext._evaluateInternal (C:\Users\user\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ExecutionContext.evaluate (C:\Users\user\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16)
at async hcaptcha (C:\Users\user\node_modules\puppeteer-hcaptcha\hcaptcha.js:325:17)
at async C:\Users\user\Desktop\hcaptcha\solve.js:40:11

Seems like there is a token in there, but its still returning an error

@aw1875
Copy link
Owner

aw1875 commented Dec 24, 2021

Thats not the token thats the request response that gets used multiple times through the solving process. Missing data could mean a few things, sometimes it just happens an you have to retry.

@Oberonskii
Copy link
Author

Oh, wow. That means that it never worked for me… Tried about 20 times

@aw1875
Copy link
Owner

aw1875 commented Dec 24, 2021

Interesting, something is being left out of the request somehow in that case. I can take a look at it on a different computer later today and see if I can replicate the issue

@Oberonskii
Copy link
Author

Would be very thankful. Thank you for the help

@Oberonskii
Copy link
Author

How is it doing?

@aw1875
Copy link
Owner

aw1875 commented Dec 25, 2021

Took a look at it. Looks like I'm getting the same issue on multiple computers. It seems either hCaptcha has modified their requests or something is breaking within the code (doesn't seem like it though as I walked through it and the request looked fine). I will try to break down hCaptchas responses sometime next week when I have more time to see if I can figure out what is wrong.

@Oberonskii
Copy link
Author

Okey, thanks for the help

@aw1875 aw1875 mentioned this issue Dec 27, 2021
@aw1875
Copy link
Owner

aw1875 commented Dec 27, 2021

Very odd but I just tried it again without making any modifications and it succeeded on the second attempt (failed responses do happen).

image

Not entirely sure what the issue is for other's besides maybe the part that ghost-cursor has not yet merged my pull request with the source code from my forked version (it realistically shouldn't matter but that could definitely be an issue). I may have to fix up some things with my pr as I noticed that yarn.lock is conflicting so that could be the reason they haven't accepted it yet.

Edit: It looks like the issue is only present with the hCaptchaToken method.

Edit 2: I made one small change to the request and it seems to work perfectly fine now, even more odd:
image

@Oberonskii
Copy link
Author

Alright 👍

@aw1875
Copy link
Owner

aw1875 commented Dec 27, 2021

@Oberonskii I pushed the changes so let me know if it works now or you can close yourself.

@Oberonskii
Copy link
Author

I still have the same problem…

@aw1875
Copy link
Owner

aw1875 commented Dec 28, 2021

@Oberonskii did you update to the newest version?

@Oberonskii
Copy link
Author

I reinstalled the package with npm

@slpkbt
Copy link

slpkbt commented Jan 1, 2022

same issue

@aw1875
Copy link
Owner

aw1875 commented May 25, 2022

Haven't heard anything about this for a few months so will be closing this issue. You can open a new issue if there is anything I can fix on my end.

@aw1875 aw1875 closed this as completed May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants