{"id":15012845,"url":"https://github.com/xewdy444/playwright-recaptcha","last_synced_at":"2025-05-15T02:05:14.437Z","repository":{"id":65350809,"uuid":"590712876","full_name":"Xewdy444/Playwright-reCAPTCHA","owner":"Xewdy444","description":"A Python library for solving reCAPTCHA v2 and v3 with Playwright","archived":false,"fork":false,"pushed_at":"2025-04-03T16:58:47.000Z","size":444,"stargazers_count":330,"open_issues_count":9,"forks_count":42,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-14T03:09:51.411Z","etag":null,"topics":["asyncio","library","playwright","recaptcha","solver","speech-to-text"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/playwright-recaptcha/","language":"Python","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/Xewdy444.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2023-01-19T02:39:58.000Z","updated_at":"2025-04-13T07:57:48.000Z","dependencies_parsed_at":"2023-12-25T10:48:54.401Z","dependency_job_id":"5790bccc-19e5-43d6-822b-bb438e9f5f20","html_url":"https://github.com/Xewdy444/Playwright-reCAPTCHA","commit_stats":{"total_commits":306,"total_committers":8,"mean_commits":38.25,"dds":"0.43790849673202614","last_synced_commit":"f98f0fa97ba42f71a27e4d138ea2930fa05b14f9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xewdy444%2FPlaywright-reCAPTCHA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xewdy444%2FPlaywright-reCAPTCHA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xewdy444%2FPlaywright-reCAPTCHA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xewdy444%2FPlaywright-reCAPTCHA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xewdy444","download_url":"https://codeload.github.com/Xewdy444/Playwright-reCAPTCHA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813795,"owners_count":21165634,"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":["asyncio","library","playwright","recaptcha","solver","speech-to-text"],"created_at":"2024-09-24T19:43:19.020Z","updated_at":"2025-04-14T03:09:55.713Z","avatar_url":"https://github.com/Xewdy444.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Python](https://img.shields.io/pypi/pyversions/playwright-recaptcha.svg)](https://www.python.org/downloads/)\n[![PyPI](https://img.shields.io/pypi/v/playwright-recaptcha.svg)](https://pypi.org/project/playwright-recaptcha/)\n[![Downloads](https://img.shields.io/pypi/dm/playwright-recaptcha.svg)](https://pypi.org/project/playwright-recaptcha/)\n[![License](https://img.shields.io/badge/license-MIT-red)](https://github.com/Xewdy444/Playwright-reCAPTCHA/blob/main/LICENSE)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://www.capsolver.com/?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003e\n    \u003cimg src=\"https://images2.imgbox.com/b7/cd/gC6eMlv2_o.jpg\" width=\"75%\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e \n  \u003ca href=\"https://www.capsolver.com/?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003eCapsolver.com\u003c/a\u003e is an AI-powered service that specializes in solving various types of captchas automatically. It supports captchas such as \u003ca href=\"https://docs.capsolver.com/guide/captcha/ReCaptchaV2.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003ereCAPTCHA V2\u003c/a\u003e, \u003ca href=\"https://docs.capsolver.com/guide/captcha/ReCaptchaV3.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003ereCAPTCHA V3\u003c/a\u003e, \u003ca href=\"https://docs.capsolver.com/guide/captcha/HCaptcha.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003ehCaptcha\u003c/a\u003e, \u003ca href=\"https://docs.capsolver.com/guide/captcha/FunCaptcha.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003eFunCaptcha\u003c/a\u003e, \u003ca href=\"https://docs.capsolver.com/guide/antibots/datadome.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003eDataDome\u003c/a\u003e, \u003ca href=\"https://docs.capsolver.com/guide/captcha/awsWaf.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003eAWS Captcha\u003c/a\u003e, \u003ca href=\"https://docs.capsolver.com/guide/captcha/Geetest.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003eGeetest\u003c/a\u003e, and Cloudflare \u003ca href=\"https://docs.capsolver.com/guide/antibots/cloudflare_turnstile.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003eCaptcha\u003c/a\u003e / \u003ca href=\"https://docs.capsolver.com/guide/antibots/cloudflare_challenge.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003eChallenge 5s\u003c/a\u003e, \u003ca href=\"https://docs.capsolver.com/guide/antibots/imperva.html?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003eImperva / Incapsula\u003c/a\u003e, among others.\nFor developers, Capsolver offers API integration options detailed in their \u003ca href=\"https://docs.capsolver.com/?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA\"\u003edocumentation\u003c/a\u003e, facilitating the integration of captcha solving into applications. They also provide browser extensions for \u003ca href=\"https://chromewebstore.google.com/detail/captcha-solver-auto-captc/pgojnojmmhpofjgdmaebadhbocahppod\"\u003eChrome\u003c/a\u003e and \u003ca href=\"https://addons.mozilla.org/es/firefox/addon/capsolver-captcha-solver/\"\u003eFirefox\u003c/a\u003e, making it easy to use their service directly within a browser. Different pricing packages are available to accommodate varying needs, ensuring flexibility for users.\n\u003c/div\u003e\n\n---\n\n# Playwright-reCAPTCHA\nA Python library for solving reCAPTCHA v2 and v3 with Playwright.\n\n## Solving reCAPTCHA v2\nreCAPTCHA v2 is solved by using the following methods:\n\n- Solving the audio challenge by transcribing the audio using the Google speech recognition API and entering the text as the response.\n- Solving the image challenge using the [CapSolver](https://www.capsolver.com/?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA) API for image classification.\n\n## Solving reCAPTCHA v3\nThe solving of reCAPTCHA v3 is done by the browser itself, so this library simply waits for the browser to make a POST request to https://www.google.com/recaptcha/api2/reload or https://www.google.com/recaptcha/enterprise/reload and parses the response to get the `g-recaptcha-response` token.\n\n---\n\nAll solvers return the `g-recaptcha-response` token, which is required for form submissions. If you are unsure about the version of reCAPTCHA being used, you can check out [this blog post](https://www.capsolver.com/blog/reCAPTCHA/identify-what-recaptcha-version-is-being-used) for more information.\n\n## Installation\n    pip install playwright-recaptcha\n\nThis library requires FFmpeg to be installed on your system for the transcription of reCAPTCHA v2 audio challenges.\n\n|   OS    |        Command         |\n| :-----: | :--------------------: |\n| Debian  | apt-get install ffmpeg |\n|  MacOS  |  brew install ffmpeg   |\n| Windows | winget install ffmpeg  |\n\nYou can also download the latest static build from [here](https://ffmpeg.org/download.html).\n\n\u003e **Note**\n\u003e Make sure to have the ffmpeg and ffprobe binaries in your system's PATH so that pydub can find them.\n\n## Supported Languages\n- Chinese (zh-CN)\n- Dutch (nl)\n- English (en)\n- French (fr)\n- German (de)\n- Italian (it)\n- Portuguese (pt)\n- Russian (ru)\n- Spanish (es)\n\nIf you would like to request support for a new language, please open an issue. You can also open a pull request if you would like to contribute.\n\n## reCAPTCHA v2 Example\nFor more reCAPTCHA v2 examples, see the [examples folder](https://github.com/Xewdy444/Playwright-reCAPTCHA/tree/main/examples/recaptchav2).\n\n```python\nfrom playwright.sync_api import sync_playwright\nfrom playwright_recaptcha import recaptchav2\n\nwith sync_playwright() as playwright:\n    browser = playwright.firefox.launch()\n    page = browser.new_page()\n    page.goto(\"https://www.google.com/recaptcha/api2/demo\")\n\n    with recaptchav2.SyncSolver(page) as solver:\n        token = solver.solve_recaptcha(wait=True)\n        print(token)\n```\n\nBy default, the audio challenge will be solved. If you would like to solve the image challenge, you can set the `CAPSOLVER_API_KEY` environment variable to your [CapSolver](https://www.capsolver.com/?utm_source=github\u0026utm_medium=banner_github\u0026utm_campaign=Playwright-reCAPTCHA) API key. You can also pass the API key as an argument to `recaptchav2.SyncSolver()` with `capsolver_api_key=\"your_api_key\"`. Then, set `image_challenge=True` in `solver.solve_recaptcha()`.\n\n```python\nwith recaptchav2.SyncSolver(page, capsolver_api_key=\"your_api_key\") as solver:\n    token = solver.solve_recaptcha(wait=True, image_challenge=True)\n    print(token)\n```\n\n## reCAPTCHA v3 Example\nFor more reCAPTCHA v3 examples, see the [examples folder](https://github.com/Xewdy444/Playwright-reCAPTCHA/tree/main/examples/recaptchav3).\n\n```python\nfrom playwright.sync_api import sync_playwright\nfrom playwright_recaptcha import recaptchav3\n\nwith sync_playwright() as playwright:\n    browser = playwright.firefox.launch()\n    page = browser.new_page()\n\n    with recaptchav3.SyncSolver(page) as solver:\n        page.goto(\"https://antcpt.com/score_detector/\")\n        token = solver.solve_recaptcha()\n        print(token)\n```\n\nIt is best to initialize the solver before navigating to the page with the reCAPTCHA v3 challenge. This is because the solver adds a listener for the POST request to https://www.google.com/recaptcha/api2/reload or https://www.google.com/recaptcha/enterprise/reload and if the request is made before the listener is added, the `g-recaptcha-response` token will not be captured.\n\n\n## Disclaimer\nThis library is intended for use in automated testing and development environments only and should not be used for any illegal or malicious purposes. Any use of this library for activities that violate the terms of service of any website or service is strictly prohibited. The contributors of this library will not be held liable for any damages or legal issues that may arise from the use of this library. By using this library, you agree to these terms and take full responsibility for your actions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxewdy444%2Fplaywright-recaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxewdy444%2Fplaywright-recaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxewdy444%2Fplaywright-recaptcha/lists"}