{"id":13467542,"url":"https://github.com/a-maliarov/amazoncaptcha","last_synced_at":"2025-03-26T03:30:36.422Z","repository":{"id":38147882,"uuid":"263371351","full_name":"a-maliarov/amazoncaptcha","owner":"a-maliarov","description":"Pure Python, lightweight, Pillow-based solver for Amazon's text captcha.","archived":false,"fork":false,"pushed_at":"2024-06-05T12:15:08.000Z","size":84952,"stargazers_count":445,"open_issues_count":13,"forks_count":80,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-29T21:55:10.376Z","etag":null,"topics":["amazon","amazon-captcha","amazon-scraper","amazoncaptcha","captcha","captcha-solver","data-extraction","pillow","python3","training-data"],"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/a-maliarov.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/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":"2020-05-12T15:09:04.000Z","updated_at":"2024-10-29T21:06:27.000Z","dependencies_parsed_at":"2024-04-25T04:48:25.753Z","dependency_job_id":null,"html_url":"https://github.com/a-maliarov/amazoncaptcha","commit_stats":{"total_commits":484,"total_committers":7,"mean_commits":69.14285714285714,"dds":0.5103305785123967,"last_synced_commit":"71b1daa95b7300b90be31cd757427b458d5f8d6c"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-maliarov%2Famazoncaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-maliarov%2Famazoncaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-maliarov%2Famazoncaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-maliarov%2Famazoncaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-maliarov","download_url":"https://codeload.github.com/a-maliarov/amazoncaptcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245584342,"owners_count":20639542,"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":["amazon","amazon-captcha","amazon-scraper","amazoncaptcha","captcha","captcha-solver","data-extraction","pillow","python3","training-data"],"created_at":"2024-07-31T15:00:57.685Z","updated_at":"2025-03-26T03:30:35.594Z","avatar_url":"https://github.com/a-maliarov.png","language":"Python","funding_links":["https://www.buymeacoffee.com/amaliarov"],"categories":["Python"],"sub_categories":[],"readme":"```python\r\n  ______                                  ______                      __              __                \r\n /      \\                                /      \\                    |  \\            |  \\               \r\n|  ▓▓▓▓▓▓\\______ ____  ________ _______ |  ▓▓▓▓▓▓\\ ______   ______  _| ▓▓_    _______| ▓▓____   ______  \r\n| ▓▓__| ▓▓      \\    \\|        \\       \\| ▓▓   \\▓▓|      \\ /      \\|   ▓▓ \\  /       \\ ▓▓    \\ |      \\\r\n| ▓▓    ▓▓ ▓▓▓▓▓▓\\▓▓▓▓\\\\▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓\\ ▓▓       \\▓▓▓▓▓▓\\  ▓▓▓▓▓▓\\\\▓▓▓▓▓▓ |  ▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓\\ \\▓▓▓▓▓▓\\\r\n| ▓▓▓▓▓▓▓▓ ▓▓ | ▓▓ | ▓▓ /    ▓▓| ▓▓  | ▓▓ ▓▓   __ /      ▓▓ ▓▓  | ▓▓ | ▓▓ __| ▓▓     | ▓▓  | ▓▓/      ▓▓\r\n| ▓▓  | ▓▓ ▓▓ | ▓▓ | ▓▓/  ▓▓▓▓_| ▓▓  | ▓▓ ▓▓__/  \\  ▓▓▓▓▓▓▓ ▓▓__/ ▓▓ | ▓▓|  \\ ▓▓_____| ▓▓  | ▓▓  ▓▓▓▓▓▓▓\r\n| ▓▓  | ▓▓ ▓▓ | ▓▓ | ▓▓  ▓▓    \\ ▓▓  | ▓▓\\▓▓    ▓▓\\▓▓    ▓▓ ▓▓    ▓▓  \\▓▓  ▓▓\\▓▓     \\ ▓▓  | ▓▓\\▓▓    ▓▓\r\n \\▓▓   \\▓▓\\▓▓  \\▓▓  \\▓▓\\▓▓▓▓▓▓▓▓\\▓▓   \\▓▓ \\▓▓▓▓▓▓  \\▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓    \\▓▓▓▓  \\▓▓▓▓▓▓▓\\▓▓   \\▓▓ \\▓▓▓▓▓▓▓\r\n                                                          | ▓▓                                          \r\n  \u003e\u003e\u003esolution                                             | ▓▓                            Response 0.24s\r\n  \"AmznCaptcha\"                                            \\▓▓                            Accuracy 99.9%\r\n```\r\nThe motivation behind the creation of this library is taking its start from the genuinely simple idea: \"**I don't want to use pytesseract or some other non-amazon-specific OCR services, nor do I want to install some executables to just solve a captcha. I desire to get a solution with 2 lines of code without any heavy add-ons, using a pure Python.**\"\r\n\r\n---\r\nPure Python, lightweight, [Pillow](https://github.com/python-pillow/Pillow)-based solver for [Amazon's text captcha](https://www.amazon.com/errors/validateCaptcha).\r\n\r\n[![Accuracy](https://img.shields.io/badge/success%20rate-99.9%25-success)](https://github.com/a-maliarov/amazoncaptcha/blob/master/ext/accuracy.log)\r\n![Timing](https://img.shields.io/badge/response%20time-0.2s-success)\r\n[![Size](https://img.shields.io/badge/wheel%20size-0.9%20MB-informational)](https://pypi.org/project/amazoncaptcha/)\r\n[![Version](https://img.shields.io/pypi/v/amazoncaptcha?color=informational)](https://pypi.org/project/amazoncaptcha/)\r\n[![Python version](https://img.shields.io/badge/python-3.7%2B-informational)](https://pypi.org/project/amazoncaptcha/)\r\n[![Downloads](https://img.shields.io/pypi/dm/amazoncaptcha?color=success)](https://pypi.org/project/amazoncaptcha/)\r\n\r\n## Recent News\r\n+ *May 5, 2023*: tested and approved compatibility with Pillow 9.5.0\r\n+ *January 25, 2022*: tested and approved compatibility with Python 3.10\r\n+ *January 25, 2022*: dropped support for Python 3.6\r\n\r\n## Installation\r\nYou can simply install the library from [PyPi](https://pypi.org/project/amazoncaptcha/) using **pip**. For more methods check the [docs](https://amazoncaptcha.readthedocs.io/en/latest/installation.html).\r\n```bash\r\npip install amazoncaptcha\r\n```\r\n\r\n## Quick Snippet\r\nAn example of the constructor usage. Scroll a bit down to see some tasty class methods. **For consistency across different devices, it is highly recommended to use `fromlink` class method**.\r\n```python\r\nfrom amazoncaptcha import AmazonCaptcha\r\n\r\ncaptcha = AmazonCaptcha('captcha.jpg')\r\nsolution = captcha.solve()\r\n\r\n# Or: solution = AmazonCaptcha('captcha.jpg').solve()\r\n```\r\n\r\n## Status\r\n[![Status](https://img.shields.io/pypi/status/amazoncaptcha)](https://pypi.org/project/amazoncaptcha/)\r\n[![Build Status](https://img.shields.io/circleci/build/github/a-maliarov/amazoncaptcha)](https://app.circleci.com/pipelines/github/a-maliarov/amazoncaptcha)\r\n[![Documentation Status](https://readthedocs.org/projects/amazoncaptcha/badge/?version=latest)](https://amazoncaptcha.readthedocs.io/en/latest/)\r\n[![Code Coverage](https://img.shields.io/codecov/c/gh/a-maliarov/amazoncaptcha?label=code%20coverage)](https://codecov.io/gh/a-maliarov/amazoncaptcha)\r\n[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/a-maliarov/amazoncaptcha/master)](https://www.codefactor.io/repository/github/a-maliarov/amazoncaptcha/overview/master)\r\n\r\n## Usage and Class Methods\r\nBrowsing Amazon using `selenium` and stuck on captcha? The class method below will do all the dirty work of extracting an image from the webpage for you. Practically, it takes a screenshot from your webdriver, crops the captcha and stores it into bytes array which is then used to create an `AmazonCaptcha` instance. This also means avoiding any local savings. **For consistency across different devices, it is highly recommended to use `fromlink` class method instead of `fromdriver`**.\r\n```python\r\nfrom amazoncaptcha import AmazonCaptcha\r\nfrom selenium import webdriver\r\n\r\ndriver = webdriver.Chrome() # This is a simplified example\r\ndriver.get('https://www.amazon.com/errors/validateCaptcha')\r\n\r\ncaptcha = AmazonCaptcha.fromdriver(driver)\r\nsolution = captcha.solve()\r\n```\r\n\r\nIf you are not using `selenium` or the previous method is not just the case for you, it is possible to use a captcha link directly. This class method will request the url, check the content type and store the response content into bytes array to create an instance of `AmazonCaptcha`.\r\n```python\r\nfrom amazoncaptcha import AmazonCaptcha\r\n\r\nlink = 'https://images-na.ssl-images-amazon.com/captcha/usvmgloq/Captcha_kwrrnqwkph.jpg'\r\n\r\ncaptcha = AmazonCaptcha.fromlink(link)\r\nsolution = captcha.solve()\r\n```\r\n\r\nIn addition, if you are a machine learning or neural network developer and are looking for some training data, check [this](https://github.com/a-maliarov/amazon-captcha-database) repository, which was created to store images and other non-script data for the solver.\r\n\r\n## Help the Development\r\nIf you are willing to help the development, consider setting `keep_logs` argument of the `solve` method to `True`. Here is the example, if you are using `fromdriver` class method. If set to `True`, all the links of the unsolved captcha will be stored so that later you can [open the issue and send the logs](https://github.com/a-maliarov/amazoncaptcha/issues/new?assignees=a-maliarov\u0026labels=training+data\u0026template=send_logs.md\u0026title=Add+training+data).\r\n```python\r\nfrom amazoncaptcha import AmazonCaptcha\r\nfrom selenium import webdriver\r\n\r\ndriver = webdriver.Chrome() # This is a simplified example\r\ndriver.get('https://www.amazon.com/errors/validateCaptcha')\r\n\r\ncaptcha = AmazonCaptcha.fromdriver(driver)\r\nsolution = captcha.solve(keep_logs=True)\r\n```\r\n\r\nIf you have any suggestions or ideas of additional instances and methods, which you would like to see in this library, please, feel free to contact the owner via email or fork'n'pull to repository. Any contribution is highly appreciated!\r\n\r\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/amaliarov)\r\n\r\n## Additional\r\n+ If you want to see the [**History of Changes**](https://github.com/a-maliarov/amazoncaptcha/blob/master/HISTORY.md), [**Code of Conduct**](https://github.com/a-maliarov/amazoncaptcha/blob/master/.github/CODE_OF_CONDUCT.md), [**Contributing Policy**](https://github.com/a-maliarov/amazoncaptcha/blob/master/.github/CONTRIBUTING.md), or [**License**](https://github.com/a-maliarov/amazoncaptcha/blob/master/LICENSE), use these inline links to navigate based on your needs.\r\n+ If you are facing any errors, please, report your situation via an issue.\r\n+ This project is for educational and research purposes only. Any actions and/or activities related to the material contained on this GitHub Repository is solely your responsibility. The author will not be held responsible in the event any criminal charges be brought against any individuals misusing the information in this GitHub Repository to break the law.\r\n+ Amazon is the registered trademark of Amazon.com, Inc. Amazon name used in this project is for identification purposes only. The project is not associated in any way with Amazon.com, Inc. and is not an official solution of Amazon.com, Inc.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-maliarov%2Famazoncaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-maliarov%2Famazoncaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-maliarov%2Famazoncaptcha/lists"}