sayem314 / hooman

http interceptor to hoomanize cloudflare requests
https://www.npmjs.com/package/hooman
MIT License
146 stars 18 forks source link

UnhandledPromiseRejectionWarning #4

Closed andress134 closed 4 years ago

andress134 commented 4 years ago

I get error

node:30584) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 611)

// FIXED

sayem314 commented 4 years ago

The issue was with cloudflareRetry and I have fixed it on v1.1.1 https://github.com/sayem314/hooman/commit/d1f85cc988dd1de5c1683ba99fff2fd9e06af55e

Please update and run this example to test:

const got = require(".");

function send_req(target) {
  return new Promise((resolve, reject) => {
    got(target, {
      cloudflareRetry: 10
    })
      .then(response => {
        console.log(response.body);
        resolve(response);
      })
      .catch(error => {
        console.log(error.message);
        return reject(error);
      });
  });
}

send_req("https://www.apotea.se/");

Also, note that you should specify interval delay in your example setInterval code.

andress134 commented 4 years ago

The issue was with cloudflareRetry and I have fixed it on v1.1.1 d1f85cc

Please update and run this example to test:

const got = require(".");

function send_req(target) {
  return new Promise((resolve, reject) => {
    got(target, {
      cloudflareRetry: 10
    })
      .then(response => {
        console.log(response.body);
        resolve(response);
      })
      .catch(error => {
        console.log(error.message);
        return reject(error);
      });
  });
}

send_req("https://www.apotea.se/");

Also, note that you should specify interval delay in your example setInterval code.

Response code 503 (Service Unavailable) (node:26370) UnhandledPromiseRejectionWarning: HTTPError: Response code 503 (Service Unavailable) at PromisableRequest.<anonymous> (/root/node_modules/got/dist/source/as-promise/index.js:124:28) at processTicksAndRejections (internal/process/task_queues.js:97:5) (Usenode --trace-warnings ...to show where the warning was created) (node:26370) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:26370) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

andress134 commented 4 years ago

now work bypass, but spamming me with this

`body, html {width: 100%; height: 100%; margin: 0; padding: 0} .row-container {display: flex; width: 100%; height: 100%; flex-direction: column; background-color: blue; overflow: hidden;} .first-row {background-color: lime; } .second-row { flex-grow: 1; border: none; margin: 0; padding: 0; }

Response code 403 (Forbidden) Response code 403 (Forbidden) Response code 403 (Forbidden) Response code 403 (Forbidden) Response code 403 (Forbidden)

Response code 405 (Method Not Allowed) Response code 405 (Method Not Allowed) Response code 405 (Method Not Allowed) Response code 405 (Method Not Allowed)

`

/ fixed

sayem314 commented 4 years ago

403 === captch

hooman doesn't handle captcha

sayem314 commented 4 years ago

You can now solve captchas. Take a look at readme.

andress134 commented 4 years ago

You can now solve captchas. Take a look at readme.

What is wrong : https://pastebin.com/raw/2JuBBnBr if u can help me we can remove proxy func and work just with 1 ip (my vps) ?

sayem314 commented 4 years ago

Code seems to be OK. Not sure what's wrong. Note that captcha cannot be solved on all sites.

andress134 commented 4 years ago

tested on 2 websites with hcaptcha

https://shawty.club/ https://exitus.xyz

sayem314 commented 4 years ago

image

image

They both work fine. Please verify your side of the code.

andress134 commented 4 years ago

image

image

They both work fine. Please verify your side of the code.

with my changes https://pastebin.com/raw/eMzuTX7y my 2captcha balance is going, but don't bypass, just spam my vps with this

(node:10255) UnhandledPromiseRejectionWarning: HTTPError: Response code 403 (Forbidden) at PromisableRequest.<anonymous> (/root/node_modules/got/dist/source/as-promise/index.js:124:28) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:10255) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 170)

//edit, about donation, can u add also your btc adress for donate?