Coder Social home page Coder Social logo

nocaptchaai / nocaptchaai-puppeteer Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 10.0 207 KB

Puppeteer package for NoCaptchaAI (hCaptcha solver) ⚡️

Home Page: https://noCaptchaAI.com

TypeScript 97.47% Shell 2.53%
captcha captcha-bypass captcha-solver hcaptcha hcaptcha-bypass hcaptcha-solver puppeteer recaptcha recaptcha-bypass recaptcha-solver

nocaptchaai-puppeteer's Introduction

noCaptchaAI Puppeteer

Logo


TypeScript   npm version   Discord   Telegram

About noCaptchaAi.com

Fastest solving 0.02s ~ 0.5s anywhere.

HCAPTCHA Solver CAPTCHA solver with Puppeteer. Cheapest plans, deployable api and dedicated support.

Free Solving Plan: 6000/month

Quickstart with demo

git clone https://github.com/noCaptchaAi/puppeteer-hcaptcha-solver
cd puppeteer-hcaptcha-solver
npm i
npm run start

⚙️ Install

  • Latest branch
git clone https://github.com/noCaptchaAi/nocaptchaai-puppeteer
  • npm:
npm install nocaptchaai-puppeteer
  • yarn:
yarn add nocaptchaai-puppeteer
  • pnpm:
pnpm add nocaptchaai-puppeteer

🧪 Example

Please take a look at here!

💬 Community

nocaptchaai-puppeteer's People

Contributors

404b avatar debpalash avatar lokilife avatar mokhajavi75 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nocaptchaai-puppeteer's Issues

Uncaught SyntaxError c:\Users\user\Dropbox\PC\Downloads\captcha\app.ts:1import { solveCaptcha } from "nocaptchaai-puppeteer";^^^^^^SyntaxError: Cannot use import statement outside a module

Hello,
Code : `ts
import { solveCaptcha } from "nocaptchaai-puppeteer";
import puppeteer from "puppeteer";

const URL = "https://accounts.hcaptcha.com/demo";

const API_KEY = "animalescrossingosda"; // <-- your API key here
const UID = "animalescrossingosda-6ab13ff2-c94c-6a36-3b5d-e0dd16e4e918"; // <-- your UID here

const main = async (): Promise => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();

await page.goto(URL);
await page.waitForNetworkIdle();

await solveCaptcha(page, API_KEY, UID, "free");

await page.screenshot({ path: "test.jpeg", type: "jpeg" });

await browser.close();
};

main();`
Error : Uncaught SyntaxError c:\Users\user\Dropbox\PC\Downloads\captcha\app.ts:1
import { solveCaptcha } from "nocaptchaai-puppeteer";
^^^^^^

SyntaxError: Cannot use import statement outside a module

doesn't work on discord

doesn't work on discord. got error: failed to find element matching selector ".h-captcha"

plugin does not click images from challenge if puppeteer minimized

the plugin does not click images from challenge if puppeteer window is minimized

this is actually a huge issue, because when running (multiple) instances on a remote desktop, only one window at the time is "active" and all others are treated like they are "minimized"
therefore plugin works very slow when multithreading on rdp

the bug is in general cause it doesnt do clicks when the window is minimized.
all other puppeteer stuff works fine even though windows are minimized, so this is an issue with this plugin.

6 seconds before submitting hcaptcha

admin said that 6 seconds should pass between clicking checkbox and submitting the clicked images, otherwise hcaptcha likely just asks for another image challenge.

plugin must make sure that 6 seconds have passed before submitting.

invisible hcaptcha image challenge triggers fatal exception EXCEPTION_ACCESS_VIOLATION

Upon clicking submit button with invisible hcaptcha, when it pops up image challenge, if i then call solveCaptcha it will always cause the following error. The image-challenge popup also breaks and visually shows the chrome error like if a tab crashed within the frame the challenge popup was.

Received fatal exception E
![acccessviolation](https://user-images.githubusercontent.com/117991528/201343822-3f6f8319-8eab-4b32-9710-7c1b775a9d84.JPG)
XCEPTION_ACCESS_VIOLATION
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: Received fatal exception EXCEPTION_ACCESS_VIOLATION

Backtrace:
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: Backtrace:

        GetHandleVerifier [0x00007FFF15679A13+28527139]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF126D04FF+6179695]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF121AA9D6+782406]
        GetHandleVerifier [0x00007FFF156646DB+28440299]
        GetHandleVerifier [0x00007FFF156644B6+28439750]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF124F4E63+4232403]
        GetMainTargetServices [0x00007FFF12F7C5A1+2210497]
        GetHandleVerifier [0x00007FFF13BC5C5F+527471]
        GetMainTargetServices [0x00007FFF12F7D706+2214950]
        GetMainTargetServices [0x00007FFF130348E6+2964998]
        GetMainTargetServices [0x00007FFF12F7EC38+2220376]
        GetMainTargetServices [0x00007FFF12E74367+1128583]
        RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B38F95+[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM:        GetHandleVerifier [0x00007FFF15679
![acccessviolation](https://user-images.githubusercontent.com/117991528/201343886-4a90d541-56eb-442b-8eac-92f0267af1da.JPG)
A13+28527139]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF126D04FF+6179695]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF121AA9D6+782406]
        GetHandleVerifier [0x00007FFF156646DB+28440299]
        GetHandleVerifier [0x00007FFF156644B6+28439750]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF124F4E63+4232403]
        GetMainTargetServices [0x00007FFF12F7C5A1+2210497]
        GetHandleVerifier [0x00007FFF13BC5C5F+527471]
        GetMainTargetServices [0x00007FFF12F7D706+2214950]
        GetMainTargetServices [0x00007FFF130348E6+2964998]
        GetMainTargetServices [0x00007FFF12F7EC38+2220376]
        GetMainTargetServices [0x00007FFF12E74367+1128583]
        RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B38F95+
887173]
        RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B38A25+885781]
        RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B2CC29+837145]
        RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B399DB+889803]
        GetMainTargetServices [0x00007FFF12E53F3D+996445]
        GetMainTargetServices [0x00007FFF139C5A22+12996418]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0B52B+12712859]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0C1FC+12716140]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0ADF2+12711010]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0AF1F+12711311]
        ChromeMain [0x00007FFF0FC6127C+476]
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM: 887173]
        RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B38A25+885781]
        RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B2CC29+837145]
        RelaunchChromeBrowserWithNewCommandLineIfNeeded [0x00007FFF13B399DB+889803]
        GetMainTargetServices [0x00007FFF12E53F3D+996445]
        GetMainTargetServices [0x00007FFF139C5A22+12996418]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0B52B+12712859]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0C1FC+12716140]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0ADF2+12711010]
        CrashForExceptionInNonABICompliantCodeRange [0x00007FFF12D0AF1F+12711311]
        ChromeMain [0x00007FFF0FC6127C+476]

        GetPakFileHashes [0x00007FF718F927A4+6052]
        GetPakFileHashes [0x00007FF718F91B3B+2875]
        GetHandleVerifier [0x00007FF7190FC072+981570]
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM:    GetPakFileHashes [0x00007FF718F927A4+6052]
        GetPakFileHashes [0x00007FF718F91B3B+2875]
        GetHandleVerifier [0x00007FF7190FC072+981570]

        BaseThreadInitThunk [0x00007FFF48E97034+20]
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM:    BaseThreadInitThunk [0x00007FFF48E97034+20]

        RtlUserThreadStart [0x00007FFF49822651+33]
[11/11/2022, 00:42:25] [puppeteer]: CHROMIUM:    RtlUserThreadStart [0x00007FF
```F49822651+33]

detect if ip is ratelimited by hcaptcha

hcaptcha sometimes throws error that there were too many recent requests from current network when trying to check checkbox.

please detect (correctly) so we can handle it or speedup process
i tried myself and did not succeed.

TypeError: page.waitForSelector is not a function

`/home/ymajine/Bureau/triage /PlutonBot/node_modules/nocaptchaai-puppeteer/lib/index.js:22
const outer = await page.waitForSelector('iframe[data-hcaptcha-response]');
^

TypeError: page.waitForSelector is not a function
at solveCaptcha (/home/ymajine/Bureau/triage /PlutonBot/node_modules/nocaptchaai-puppeteer/lib/index.js:22:30)
at main (/home/ymajine/Bureau/triage /PlutonBot/Modules/captchatest.js:17:9)

Node.js v18.12.1`

this is my code 👍

`const puppeteer = require ('puppeteer');
const {solveCaptcha} = require('nocaptchaai-puppeteer');

const URL = 'https://2captcha.com/demo/hcaptcha';

//**** get apikey here -> http://nocaptchaai.com *****
const API_KEY = 'replace by my api key '; // <-- your API key here
const UID = 'jesaispasmdr'; // <-- your UID here
const lang = 'en'; // desired language. 'en' = english, 'ru' = russian

const main = async ()=> {
const browser = await puppeteer.launch({ headless: false, args: [--lang=${lang}] });
const page = await browser.newPage();
await page.goto('https://2captcha.com/demo/hcaptcha');
await page.waitForNetworkIdle();

await solveCaptcha(URL, API_KEY, UID, 'free', true);
// params: 'free or pro', 5) debug -> true or false
console.log('passed')

await page.screenshot({ path: example/test.jpeg, type: 'jpeg' });

await browser.close();
};

main();`

language not detected

this aint working

    const language = await page.evaluate(() => document.documentElement.lang);

console.log(language) returns empty

target innerframe correctly

otherwise its not working for me on my site, also this way is more correct:

//const inner = await page.waitForSelector('iframe:not([data-hcaptcha-response])');
const inner = await page.$("iframe[title='Main content of the hCaptcha challenge']",);

if image-challenge-popup already exists, calling solveCaptcha will click checkbox again, therefore making image challenge disappear

if image-challenge-popup already exists, calling solveCaptcha will click checkbox again, therefore making image challenge disappear
i myself use solveCaptcha only if imagechallenge exists. also necessary for invisible captcha because there is no checkbox to be clicked.

Suggested Solution:

check if image challenge already exists or not. if not, click checkbox.

var challengecheck = (await innerFrame.evaluate(()=>document.querySelector("body .challenge"))) || "";
if (!challengecheck) {
await checkbox?.click();
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.