{"id":19411017,"url":"https://github.com/nopechallc/nopecha-python","last_synced_at":"2025-05-15T11:02:44.599Z","repository":{"id":147115282,"uuid":"618088402","full_name":"NopeCHALLC/nopecha-python","owner":"NopeCHALLC","description":"Automated CAPTCHA solver for Python.","archived":false,"fork":false,"pushed_at":"2024-08-20T18:21:00.000Z","size":44,"stargazers_count":1065,"open_issues_count":8,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T00:52:54.485Z","etag":null,"topics":["aws-waf-captcha","captcha","funcaptcha","funcaptcha-bypass","funcaptcha-solver","hcaptcha","hcaptcha-bypass","hcaptcha-solver","recaptcha","recaptcha-bypass","recaptcha-solver","text-captcha","turnstile-captcha-solver"],"latest_commit_sha":null,"homepage":"","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/NopeCHALLC.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-03-23T18:18:17.000Z","updated_at":"2025-04-14T11:44:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"75882134-a6cb-446d-9bd8-b955716693bd","html_url":"https://github.com/NopeCHALLC/nopecha-python","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/NopeCHALLC%2Fnopecha-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NopeCHALLC%2Fnopecha-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NopeCHALLC%2Fnopecha-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NopeCHALLC%2Fnopecha-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NopeCHALLC","download_url":"https://codeload.github.com/NopeCHALLC/nopecha-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328385,"owners_count":22052632,"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":["aws-waf-captcha","captcha","funcaptcha","funcaptcha-bypass","funcaptcha-solver","hcaptcha","hcaptcha-bypass","hcaptcha-solver","recaptcha","recaptcha-bypass","recaptcha-solver","text-captcha","turnstile-captcha-solver"],"created_at":"2024-11-10T12:18:47.464Z","updated_at":"2025-05-15T11:02:44.523Z","avatar_url":"https://github.com/NopeCHALLC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NopeCHA\n\n![PyPI - Version](https://img.shields.io/pypi/v/nopecha?label=PyPI\u0026link=https%3A%2F%2Fnopecha.com\u0026link=https%3A%2F%2Fnopecha.com%2Fpypi)\n![NPM Version](https://img.shields.io/npm/v/nopecha?label=NPM\u0026link=https%3A%2F%2Fnopecha.com\u0026link=https%3A%2F%2Fnopecha.com%2Fnpm)\n![GitHub Release](https://img.shields.io/github/v/release/NopeCHALLC/nopecha-extension?label=Extension%20Release\u0026color=4a4\u0026link=https%3A%2F%2Fnopecha.com\u0026link=https%3A%2F%2Fnopecha.com%2Fgithub)\n![Chrome Web Store Version](https://img.shields.io/chrome-web-store/v/dknlfmjaanfblgfdfebhijalfmhmjjjo?label=Chrome%20Web%20Store\u0026color=4a4\u0026link=https%3A%2F%2Fnopecha.com\u0026link=https%3A%2F%2Fnopecha.com%2Fchrome)\n![Mozilla Add-on Version](https://img.shields.io/amo/v/noptcha?label=Mozilla%20Add-on\u0026color=4a4\u0026link=https%3A%2F%2Fnopecha.com\u0026link=https%3A%2F%2Fnopecha.com%2Ffirefox)\n\nAPI bindings for the [NopeCHA](https://nopecha.com) CAPTCHA service.\n\n## Installation\n\nTo install from PyPI, run `python3 -m pip install nopecha`.\n\n## API Usage\n\nThis package provides API wrappers for the following http packages:\n\n- [`requests`](https://pypi.org/project/requests/) (sync)\n- [`aiohttp`](https://pypi.org/project/aiohttp/) (async)\n- [`httpx`](https://pypi.org/project/httpx/) (sync \u0026 async)\n- [`urllib`](https://docs.python.org/3/library/urllib.html) (sync, built-in)\n\nNote: You will need to install the http package you want to use separately\n(except for `urllib`, as it's built-in but not recommended).\n\n### Requests example\n\n```python\nfrom nopecha.api.requests import RequestsAPIClient\n\napi = RequestsAPIClient(\"YOUR_API_KEY\")\nsolution = api.solve_hcaptcha(\"b4c45857-0e23-48e6-9017-e28fff99ffb2\", \"https://nopecha.com/demo/hcaptcha#easy\")\n\nprint(\"token is\", solution[\"data\"])\n```\n\n### Async HTTPX example\n\n```python\nfrom nopecha.api.httpx import AsyncHTTPXAPIClient\n\nasync def main():\n    api = AsyncHTTPXAPIClient(\"YOUR_API_KEY\")\n    solution = await api.solve_hcaptcha(\"b4c45857-0e23-48e6-9017-e28fff99ffb2\", \"https://nopecha.com/demo/hcaptcha#easy\")\n    print(\"token is\", solution[\"data\"])\n\nasyncio.run(main())\n```\n\n## Extension builder\n\nThis package also provides a extension builder for\n[Automation builds](https://developers.nopecha.com/guides/extension_advanced/#automation-build)\nwhich includes:\n\n1. downloading the extension\n2. updating the extension\n3. updating the extension's manifest to include your settings\n\n### Example\n\n```python\nfrom nopecha.extension import build_chromium\n\n# will download the extension to the current working directory\noutput = build_chromium({\n    \"key\": \"YOUR_API_KEY\",\n})\n\n# custom output directory\nfrom pathlib import Path\noutput = build_chromium({\n    \"key\": \"YOUR_API_KEY\",\n}, Path(\"extension\"))\n```\n\nYou can plug the output path directly into your browser's extension manager to\nload the extension:\n\n```python\nimport undetected_chromedriver as uc\nfrom nopecha.extension import build_chromium\n\noutput = build_chromium({\n    \"key\": \"YOUR_API_KEY\",\n})\n\noptions = uc.ChromeOptions()\noptions.add_argument(f\"load-extension={output}\")\n```\n\n## Building\n\nTo build from source, you will need to install\n[`build`](https://packaging.python.org/en/latest/key_projects/#build)\n(`python3 -m pip install --upgrade build `).\n\nThen simply run `python3 -m build` to build the package.\n\n#### Uploading to PyPI\n\nTo upload to PyPI, you will need to install\n[`twine`](https://packaging.python.org/en/latest/key_projects/#twine)\n(`python3 -m pip install --upgrade twine`).\n\nThen simply run `python3 -m twine upload dist/*` to upload the package.\n\n## Migrate from v1\n\nIf you are migrating from v1, you will need to update your code to use the new\nclient classes.\n\nV1 was synchronous only, using the requests HTTP library. V2 supports both\nsynchronous and asynchronous code, and multiple HTTP libraries.\n\nTo migrate, you will need to:\n\n1. Install the http library you want to use (requests, aiohttp, httpx) or use\n   the built-in urllib.\n2. Replace `nopecha.api_key` with creating a client instance.\n\n```py\n# Before\nimport nopecha\n\nnopecha.api_key = \"YOUR_API_KEY\"\n\n# Now\nfrom nopecha.api.requests import RequestsAPIClient\n\nclient = RequestsAPIClient(\"YOUR_API_KEY\")\n```\n\n3. Replace\n   `nopecha.Token.solve()`/`nopecha.Recognition.solve()`/`nopecha.Balance.get()`\n   with the appropriate method on the client instance.\n\n```py\n# Before\nimport nopecha\nnopecha.api_key = \"...\"\n\nclicks = nopecha.Recognition.solve(\n    type='hcaptcha',\n    task='Please click each image containing a cat-shaped cookie.',\n    image_urls=[f\"https://nopecha.com/image/demo/hcaptcha/{i}.png\" for i in range(9)],\n)\nprint(clicks)\n\ntoken = nopecha.Token.solve(\n    type='hcaptcha',\n    sitekey='ab803303-ac41-41aa-9be1-7b4e01b91e2c',\n    url='https://nopecha.com/demo/hcaptcha',\n)\nprint(token)\n\nbalance = nopecha.Balance.get()\nprint(balance)\n\n# Now\nfrom nopecha.api.requests import RequestsAPIClient\n\nclient = RequestsAPIClient(\"YOUR_API_KEY\")\n\nclicks = client.recognize_hcaptcha(\n    'Please click each image containing a cat-shaped cookie.',\n    [f\"https://nopecha.com/image/demo/hcaptcha/{i}.png\" for i in range(9)],\n)\nprint(clicks)\n\ntoken = client.solve_hcaptcha(\n    'ab803303-ac41-41aa-9be1-7b4e01b91e2c',\n    'https://nopecha.com/demo/hcaptcha',\n)\nprint(token)\n\nbalance = client.status()\nprint(balance)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopechallc%2Fnopecha-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopechallc%2Fnopecha-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopechallc%2Fnopecha-python/lists"}