{"id":20496315,"url":"https://github.com/dore51/puppeteer-recaptcha-solver","last_synced_at":"2025-04-13T18:21:10.238Z","repository":{"id":65186351,"uuid":"564670076","full_name":"dore51/puppeteer-recaptcha-solver","owner":"dore51","description":"Puppeteer Recaptcha solver","archived":false,"fork":false,"pushed_at":"2024-01-10T08:31:15.000Z","size":760,"stargazers_count":10,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T09:04:26.477Z","etag":null,"topics":["captcha","puppeteer","puppeteer-captcha","puppeteer-recaptcha","recaptcha","recaptcha-solver"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/puppeteer-recaptcha-solver","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dore51.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-11T08:12:26.000Z","updated_at":"2024-12-23T23:10:36.000Z","dependencies_parsed_at":"2024-11-15T18:16:47.410Z","dependency_job_id":null,"html_url":"https://github.com/dore51/puppeteer-recaptcha-solver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dore51%2Fpuppeteer-recaptcha-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dore51%2Fpuppeteer-recaptcha-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dore51%2Fpuppeteer-recaptcha-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dore51%2Fpuppeteer-recaptcha-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dore51","download_url":"https://codeload.github.com/dore51/puppeteer-recaptcha-solver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351384,"owners_count":21089270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","puppeteer","puppeteer-captcha","puppeteer-recaptcha","recaptcha","recaptcha-solver"],"created_at":"2024-11-15T18:06:29.446Z","updated_at":"2025-04-13T18:21:10.212Z","avatar_url":"https://github.com/dore51.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# puppeteer-recaptcha-solver\n\n\u003e Google Recapctha v2 solver with puppeteer. You can simply use it in your project by passing to the constructor your `Page` object.\n\u003e The solver is using SpeechToText recognition, you can use one of our integrated solvers with your API key or to provide your own solving function.\n\u003e You can also integrate your own logger.\n\n#### Disclaimer\n\n\u003e This is an academic project, it is not intended to be used in production. It is not\n\u003e recommended to use this project for any other purpose than\n\u003e educational. The author is not responsible for any misuse of this\n\u003e project.\n\n## Demo\n\nhttps://user-images.githubusercontent.com/63049090/209352713-c3263dc8-0c37-4786-b28f-0af997b3b60e.mp4\n\n## Table of contents\n\n- [Puppeteer Recaptcha Solver](#puppeteer-recaptcha-solver)\n  - [Prerequisites](#prerequisites)\n  - [Table of contents](#table-of-contents)\n  - [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [API](#api)\n    - [Constructor](#constructor)\n    - [Solve](#solve)\n    - [General Types](#general-types)\n      - [Examples](#examples)\n        - [Default Logger](#default-logger)\n        - [WitAI Transcriber](#witai-transcriber)\n        - [Google SpeechToText Transcriber](#google-speechtotext-transcriber)\n  - [Contributing](#contributing)\n  - [Built With](#built-with)\n  - [Authors](#authors)\n  - [License](#license)\n\n## Prerequisites\n\nThis project requires NodeJS (version 8 or later) and NPM.\n[Node](http://nodejs.org/) and [NPM](https://npmjs.org/) are really easy to install.\n\n## Getting Started\n\nThese instructions will help to you install the package in your project, set it and use it.\nSee Contributing for notes on how to help and contribute this project.\n\n## Installation\n\n**BEFORE YOU INSTALL:** please read the [prerequisites](#prerequisites)\n\n\nTo install and set up the library, run:\n\n```sh\n$ npm install puppeteer-recaptcha-solver\n```\n\n# Usage\n\nTo use, simply create the object and execute the `solve` command.\n\nExample:\n\n```ts\n(async () =\u003e {\n    const browser = await puppeteer.launch({\n        headless: false,\n    });\n    const page = await browser.newPage();\n\n    const solver = new ReCaptchaSolver({\n        page,\n        maxRetries: 3,\n        transcriber: Transcribers.witAI,\n        apiKey: 'YOUR_API_KEY'\n    });\n\n    await page.goto(\n        'https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php'\n    );\n\n    const solved = await solver.solve();\n\n    console.log('Captcha solved: ', solved);\n    await page.screenshot({ path: 'example/example.png' });\n    await browser.close();\n})();\n```\n\n## API\n\n### Constructor\n\n```ts\n const solver = new ReCaptchaSolver({\n      page,\n      log,\n      maxRetries: 3,\n      transcriber: Transcribers.witAI,\n      apiKey: 'YOUR_API_KEY'\n});\n```\n\nA constructor to the object.\n\n#### Fields\n\nSupported options for the `constructor` field are listed below.\n\n| Field | Type        | Default value | Required | Description                                                                                                                                                                                                                                   |\n| --- |-------------| --- | --- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| page | Page        |  | Yes | puppeteer page object                                                                                                                                                                                                                         |\n| log | Logger      | `console.log` | No | A logger that the solver will use. You can also use the default logger or `noopLogger` to disable the logs                                                                                                                                    |  \n| transcriber | Transcriber | witAI | No | A transcriber that the solver will use to transcriber the audio to text. You can can choose between witAI or googleSpeechToText by passing `Transcribers.witAI` or `Transcribers.googeSpeechToText` or passing you own `Transcriber` function. |\n| maxRetries | number      | 3 | No | Total number of retries until the captcha is solved                                                                                                                                                                                           |\n| apiKey | string      | | No | API key to your transcribe service                                                                                                                                                                                                            | \n\n\n### Solve\n\n```ts\nconst solved: boolean = await solver.solve();\n```\n\nA command that will start the solving process.\nReturns a `Promise\u003cboolean\u003e` to indicate if the captcha successfully solved.\n\n# General Types\n\n| Type        | Signature                                                                                              | Description                                          |\n|-------------|--------------------------------------------------------------------------------------------------------|------------------------------------------------------|\n| Logger      | \u003cpre\u003einterface Logger {\u003cbr\u003e  log(message: string): void \\| Promise\\\u003cvoid\\\u003e;\u003cbr\u003e  error(message: string): void \\| Promise\\\u003cvoid\\\u003e;\u003cbr\u003e  warn(message: string): void \\| Promise\\\u003cvoid\\\u003e;\u003cbr\u003e  info(message: string): void \\| Promise\\\u003cvoid\\\u003e;\u003cbr\u003e  debug(message: string): void \\| Promise\\\u003cvoid\\\u003e;\u003cbr\u003e}\u003c/pre\u003e | A logger object that the solver will use. |\n| Transcriber | \u003cpre\u003etype Transcriber = (\u003cbr\u003e  audioBuffer: ArrayBuffer,\u003cbr\u003e  apiKey?: string\u003cbr\u003e) =\u003e Promise\\\u003cstring \\| null\\\u003e;\u003c/pre\u003e                                        | A transcribe function that gets an `ArrayBuffer` and should return the text |\n\n\n## Examples\n\n### default Logger\n\n```ts\nconst defaultLogger: Logger = {\n    log: (message: string) =\u003e console.log('[LOG]', message),\n    error: (message: string) =\u003e console.error('[ERROR]', message),\n    warn: (message: string) =\u003e console.warn('[WARN]', message),\n    info: (message: string) =\u003e console.info('[INFO]', message),\n    debug: (message: string) =\u003e console.debug('[DEBUG]', message),\n};\n```\n\n### witAI Transcriber\n\n```ts\nconst witAI: Transcriber = async (\n    audioBuffer: ArrayBuffer,\n    apiKey?: string\n) =\u003e {\n    if (!apiKey) {\n        throw new Error('witAI transcriber requires API key');\n    }\n\n    const { data } = await axios.post\u003cstring\u003e(\n        'https://api.wit.ai/speech?v=20220622',\n        audioBuffer,\n        {\n            headers: {\n                Authorization: `Bearer ${apiKey}`,\n                'Content-Type': 'audio/mpeg3',\n            },\n        }\n    );\n\n    const parsed =\n        typeof data === 'string'\n            ? JSON.parse(data.split('\\r\\n').slice(-1)[0] || '{}')\n            : data;\n\n    return parsed?.text;\n}\n```\n\n### Google SpeechToText Transcriber\n\n```ts\nconst googleSpeechToText: Transcriber = async (\n    audioBuffer: ArrayBuffer,\n    apiKey?: string\n) =\u003e {\n    if (!apiKey) {\n        throw new Error('googleSpeechToText transcriber requires API key');\n    }\n\n    const { data } = await axios.post\u003cstring\u003e(\n        `https://speech.googleapis.com/v1p1beta1/speech:recognize?key=${apiKey}`,\n        {\n            config: {\n                encoding: 'MP3',\n                sampleRateHertz: 16000,\n                languageCode: 'en-US',\n            },\n            audio: {\n                content: Buffer.from(audioBuffer).toString('base64'),\n            },\n        }\n    );\n\n    const parsed =\n        typeof data === 'string'\n            ? JSON.parse(data.split('\\r\\n').slice(-1)[0] || '{}')\n            : data;\n\n    return parsed?.results?.[0]?.alternatives?.[0]?.transcript;\n};\n```\n\n\n## Contributing\n\nStart with cloning this repo on your local machine:\n\n```sh\n$ git clone https://github.com/dore51/puppeteer-captcha-solver.git\n$ cd puppeteer-captcha-solver\n```\n\nTo install and set up the library, run:\n\n```sh\n$ npm install\n```\n\n### To check that everything works\n\n```sh\n$ npm run example\n```\n\n### Running the tests\n\n```sh\n$ npm test\n```\n\n### Building a distribution version\n\n```sh\n$ npm run build\n```\n\nThis task will create a distribution version of the project\ninside your local `lib/` folder\n\n### publishing the distribution version\n\n```sh\n$ npm publish\n```\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n1.  Fork it!\n2.  Create your feature branch: `git checkout -b my-new-feature`\n3.  Add your changes: `git add .`\n4.  Commit your changes: `git commit -am 'Add some feature'`\n5.  Push to the branch: `git push origin my-new-feature`\n6.  Submit a pull request :sunglasses:\n\n\n## Built With\n\nThis package has the following dependencies:\n\n* [Axios](https://github.com/axios/axios): A promise-based HTTP client for the browser and Node.js. Axios is used to make HTTP requests in the package.\n\nThe following dependencies are only required for development and testing purposes:\n\n* [Node.js](https://nodejs.org/en/): A JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js is required to run the package.\n* [Puppeteer](https://github.com/puppeteer/puppeteer): A Node library that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer is used to automate and control the browser in order to solve the reCAPTCHA challenge.\n* [Prettier](https://prettier.io/): A code formatter that enforces a consistent style across the codebase.\n* [Jest](https://github.com/facebook/jest): A testing framework for JavaScript. \n* [puppeteer-screen-recorder](https://github.com/checkly/puppeteer-screen-recorder): A utility for recording screencasts of a Puppeteer page. \n* [TSLint](https://palantir.github.io/tslint/): A static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors.\n\n## Authors\n\n* **Dor Eitan** - [Github](https://github.com/dore51)\n\nSee also the list of [contributors](https://github.com/dore51/puppeteer-recptcha-solver/contributors) who participated in this project.\n\n## License\n\n[MIT License](https://andreasonny.mit-license.org/2019) © Dor Eitan\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdore51%2Fpuppeteer-recaptcha-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdore51%2Fpuppeteer-recaptcha-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdore51%2Fpuppeteer-recaptcha-solver/lists"}