{"id":16885000,"url":"https://github.com/ad-m/python-anticaptcha","last_synced_at":"2025-04-04T18:07:03.175Z","repository":{"id":22272245,"uuid":"95789669","full_name":"ad-m/python-anticaptcha","owner":"ad-m","description":"Client library for solve captchas with Anticaptcha.com support.","archived":false,"fork":false,"pushed_at":"2022-03-28T03:51:34.000Z","size":594,"stargazers_count":224,"open_issues_count":27,"forks_count":51,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-02T05:55:49.137Z","etag":null,"topics":["captcha","captcha-recaptcha","captcha-solving","python","recaptcha"],"latest_commit_sha":null,"homepage":"http://python-anticaptcha.readthedocs.io/en/latest/","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/ad-m.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-29T15:05:36.000Z","updated_at":"2025-03-07T01:32:52.000Z","dependencies_parsed_at":"2022-08-07T10:15:25.438Z","dependency_job_id":null,"html_url":"https://github.com/ad-m/python-anticaptcha","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-m%2Fpython-anticaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-m%2Fpython-anticaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-m%2Fpython-anticaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-m%2Fpython-anticaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ad-m","download_url":"https://codeload.github.com/ad-m/python-anticaptcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"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","captcha-recaptcha","captcha-solving","python","recaptcha"],"created_at":"2024-10-13T16:32:49.792Z","updated_at":"2025-04-04T18:07:03.144Z","avatar_url":"https://github.com/ad-m.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"python-anticaptcha\n==================\n\n.. image:: https://github.com/ad-m/python-anticaptcha/workflows/Python%20package/badge.svg\n  :target: https://github.com/ad-m/python-anticaptcha/actions?workflow=Python+package\n\n.. image:: https://img.shields.io/pypi/v/python-anticaptcha.svg\n  :target: https://pypi.org/project/python-anticaptcha/\n  :alt: Python package\n\n.. image:: https://badges.gitter.im/python-anticaptcha/Lobby.svg\n  :target: https://gitter.im/python-anticaptcha/Lobby?utm_source=share-link\u0026utm_medium=link\u0026utm_campaign=share-link\n  :alt: Join the chat at https://gitter.im/python-anticaptcha/Lobby\n\n.. image:: https://img.shields.io/pypi/pyversions/python-anticaptcha.svg\n  :target: https://github.com/ad-m/python-anticaptcha/blob/master/setup.py\n  :alt: Python compatibility\n\n.. introduction-start\n\nClient library for solve captchas with `Anticaptcha.com support`_.\nThe library supports both Python 2.7 and Python 3.\n\nThe library is cyclically and automatically tested for proper operation. We are constantly making the best efforts for its effective operation.\n\nIn case of any problems with integration - `read the documentation`_, `create an issue`_, use `Gitter`_ or contact privately.\n\n.. _read the documentation: http://python-anticaptcha.readthedocs.io/en/latest/\n.. _Anticaptcha.com support: http://getcaptchasolution.com/i1hvnzdymd\n.. _create an issue: https://github.com/ad-m/python-anticaptcha/issues/new\n.. _Gitter: https://gitter.im/python-anticaptcha/Lobby\n\n.. introduction-end\n\n\nGetting Started\n---------------\n\n.. getting-started-start\n\nInstall as standard Python package using::\n\n    pip install python-anticaptcha\n\n.. getting-started-end\n\n\nUsage\n-----\n\n.. usage-start\n\nTo use this library do you need `Anticaptcha.com`_ API key.\n\nSolve recaptcha\n###############\n\nExample snippet for Recaptcha:\n\n.. code:: python\n\n    from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask\n\n    api_key = '174faff8fbc769e94a5862391ecfd010'\n    site_key = '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-'  # grab from site\n    url = 'https://www.google.com/recaptcha/api2/demo'\n\n    client = AnticaptchaClient(api_key)\n    task = NoCaptchaTaskProxylessTask(url, site_key)\n    job = client.createTask(task)\n    job.join()\n    print job.get_solution_response()\n\nThe full integration example is available in file ``examples/recaptcha.py``.\n\nIf you only process few page many times to increase reliability, you can specify\nwhether the captcha is visible or not. This parameter is not required, as is the\nsystem detects invisible sitekeys automatically, and needs several recursive\nmeasures for automated training and analysis. For provide that pass\n``is_invisible`` parameter to ``NoCaptchaTaskProxylessTask`` or ``NoCaptchaTask`` eg.:\n\n.. code:: python\n\n    from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask\n\n    api_key = '174faff8fbc769e94a5862391ecfd010'\n    site_key = '6Lc-0DYUAAAAAOPM3RGobCfKjIE5STmzvZfHbbNx'  # grab from site\n    url = 'https://losangeles.craigslist.org/lac/kid/d/housekeeper-sitting-pet-care/6720136191.html'\n\n    client = AnticaptchaClient(api_key)\n    task = NoCaptchaTaskProxylessTask(url, site_key, is_invisible=True)\n    job = client.createTask(task)\n    job.join()\n    print job.get_solution_response()\n\n\nSolve text captcha\n##################\n\nExample snippet for text captcha:\n\n.. code:: python\n\n    from python_anticaptcha import AnticaptchaClient, ImageToTextTask\n\n    api_key = '174faff8fbc769e94a5862391ecfd010'\n    captcha_fp = open('examples/captcha_ms.jpeg', 'rb')\n    client = AnticaptchaClient(api_key)\n    task = ImageToTextTask(captcha_fp)\n    job = client.createTask(task)\n    job.join()\n    print job.get_captcha_text()\n\nSolve funcaptcha\n################\n\nExample snippet for funcaptcha:\n\n.. code:: python\n\n    from python_anticaptcha import AnticaptchaClient, FunCaptchaTask, Proxy\n    UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 ' \\\n         '(KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'\n\n    api_key = '174faff8fbc769e94a5862391ecfd010'\n    site_key = 'DE0B0BB7-1EE4-4D70-1853-31B835D4506B'  # grab from site\n    url = 'https://www.google.com/recaptcha/api2/demo'\n    proxy = Proxy.parse_url(\"socks5://login:password@123.123.123.123\")\n\n    client = AnticaptchaClient(api_key)\n    task = FunCaptchaTask(url, site_key, proxy=proxy, user_agent=user_agent)\n    job = client.createTask(task)\n    job.join()\n    print job.get_token_response()\n\nReport incorrect image\n######################\n\nExample snippet for reporting an incorrect image task:\n\n.. code:: python\n\n    from python_anticaptcha import AnticaptchaClient, ImageToTextTask\n\n    api_key = '174faff8fbc769e94a5862391ecfd010'\n    captcha_fp = open('examples/captcha_ms.jpeg', 'rb')\n    client = AnticaptchaClient(api_key)\n    task = ImageToTextTask(captcha_fp)\n    job = client.createTask(task)\n    job.join()\n    print job.get_captcha_text()\n    job.report_incorrect()\n\nSetup proxy\n###########\n\nThe library is not responsible for managing the proxy server. However, we point to\nthe possibility of simply launching such a server by:\n\n.. code::\n\n    pip install mitmproxy\n    mitmweb -p 9190 -b 0.0.0.0 --ignore '.' --socks\n\nNext to in your application use something like:\n\n.. code:: python\n\n    proxy = Proxy.parse_url(\"socks5://123.123.123.123:9190\")\n\nWe recommend entering IP-based access control for incoming addresses to proxy. IP address required by\n`Anticaptcha.com`_ is:\n\n.. code::\n\n    69.65.41.21\n    209.212.146.168\n\n.. _Anticaptcha.com: http://getcaptchasolution.com/p9bwplkicx\n\nError handling\n##############\n\nIn the event of an application error, the AnticaptchaException exception is thrown. To handle the exception, do the following:\n\n.. code:: python\n\n    from python_anticaptcha import AnticatpchaException, ImageToTextTask\n\n    try:\n        # any actions\n    except AnticatpchaException as e:\n        if e.error_code == 'ERROR_ZERO_BALANCE':\n            notify_about_no_funds(e.error_id, e.error_code, e.error_description)\n        else:\n            raise\n\n.. usage-end\n\nVersioning\n----------\n\nWe use `SemVer`_ for versioning. For the versions available, see the\n`tags on this repository`_.\n\nAuthors\n-------\n\n-  **Adam Dobrawy** - *Initial work* - `ad-m`_\n\nSee also the list of `contributors`_ who participated in this project.\n\nLicense\n-------\n\nThis project is licensed under the MIT License - see the `LICENSE.md`_\nfile for details\n\n.. _SemVer: http://semver.org/\n.. _tags on this repository: https://github.com/ad-m/python-anticaptcha/tags\n.. _ad-m: https://github.com/ad-m\n.. _contributors: https://github.com/ad-m/python-anticaptcha/contributors\n.. _LICENSE.md: LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-m%2Fpython-anticaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad-m%2Fpython-anticaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-m%2Fpython-anticaptcha/lists"}