Name | captchai JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | Captchai is a python library for solving captchas using AI |
upload_time | 2025-01-17 11:02:14 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | MIT License Copyright (c) 2024 Captchai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
captcha
captcha solver
captcha solver python
captcha solver python library
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 🤖 CaptchAI
<div align="center">
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://github.com/astral-sh/ruff)
[]()
**Solve AWS WAF CAPTCHAs using Modern AI! 🚀**
*Using powerful AI models like Groq and Moondream to solve AWS WAF CAPTCHAs quickly and accurately*
*A joint development effort by [LaProp](https://laprop.co) and [XAhai](https://xahai.co)*
> ⚠️ **Alpha Status Notice**: This library is currently in alpha stage. Many features are still under development,
> requiring thorough testing and integration. Expect frequent updates and potential breaking changes.
> We welcome feedback and contributions to help improve stability and functionality!
[Features](#-features) •
[Installation](#-installation) •
[Configuration](#%EF%B8%8F-configuration) •
[Quick Start](#-quick-start) •
[Documentation](#-documentation) •
[Contributing](#-contributing)
</div>
## 🌟 Features
- 🧠 **Modern AI Models**
- Groq LLM for smart solving
- Moondream for image analysis
- High accuracy rates
- 🛡️ **AWS WAF CAPTCHA Support**
- Built for AWS WAF challenges
- Solves image puzzles
- Handles audio challenges
- ⚡ **High Performance**
- Quick processing
- Smart backup options
- Reliable results
- 🛠️ **Easy to Use**
- Simple API
- Easy setup
- Built to extend
- Full Python typing
> **Note**: Currently, CaptchAI only works with AWS WAF CAPTCHAs. We plan to add support for other CAPTCHAs in the future.
## 📦 Installation
```bash
pip install captchai
```
## ⚙️ Configuration
```python
from captchai.core.models.config import CaptchaGlobalConfig, AWSProviderConfig, AvailableResolvers
config = CaptchaGlobalConfig(
groq_api_key="your-groq-api-key",
moondream_api_key="your-moondream-api-key",
aws_provider_config=AWSProviderConfig(
image_size=(640, 640), # Customize image size
grid_size=3, # Grid dimensions
resolver=AvailableResolvers.GROQ_IMAGE_ONE_SHOOT,
# Fallback resolvers for resilience
list_resolver_image_fallback=[
AvailableResolvers.MOONDREAM_IMAGE_ONE_SHOOT,
AvailableResolvers.GROQ_IMAGE_ONE_SHOOT,
AvailableResolvers.GROQ_IMAGE_MULTI_SHOOT,
AvailableResolvers.MOONDREAM_IMAGE_MULTI_SHOOT
]
)
)
```
## 🎯 Available Resolvers
### 🖼️ Image Resolvers
- `GROQ_IMAGE_ONE_SHOOT`: Single-shot solving with Groq
- `GROQ_IMAGE_MULTI_SHOOT`: Multi-shot approach with Groq
- `MOONDREAM_IMAGE_ONE_SHOOT`: Quick Moondream vision model
- `MOONDREAM_IMAGE_MULTI_SHOOT`: Advanced Moondream processing
### 🎵 Audio Resolvers
- `GROQ_AUDIO`: Advanced audio CAPTCHA processing
## 🚀 Quick Start
Here's a complete example of how to use Captchai to solve different types of CAPTCHAs:
```python
from captchai import CaptchaSolver
from captchai.core.models.config import (
CaptchaGlobalConfig,
AWSProviderConfig,
AvailableResolvers
)
import base64
def solve_captcha_example():
# 1. Configure the solver
config = CaptchaGlobalConfig(
groq_api_key="your-groq-api-key",
moondream_api_key="your-moondream-api-key",
aws_provider_config=AWSProviderConfig(
resolver=AvailableResolvers.GROQ_IMAGE_ONE_SHOOT,
grid_size=3,
image_size=(640, 640)
)
)
# 2. Initialize the solver
solver = CaptchaSolver(config)
# 3. Solve different types of CAPTCHAs
# Image CAPTCHA (using base64 string)
with open("path/to/captcha.png", "rb") as image_file:
image_base64 = base64.b64encode(image_file.read()).decode('utf-8')
# For image CAPTCHAs, query is required - it specifies what type of object to identify
image_result = solver.solve_aws_captcha_image(
data=image_base64,
query="bucket" # Required: Specify the type of object to identify
)
print(f"Image CAPTCHA Solution: {image_result}")
# Audio CAPTCHA (using base64 string)
with open("path/to/audio.mp3", "rb") as audio_file:
audio_base64 = base64.b64encode(audio_file.read()).decode('utf-8')
# For audio CAPTCHAs, query is optional
audio_result = solver.solve_aws_captcha(
data=audio_base64
)
print(f"Audio CAPTCHA Solution: {audio_result}")
if __name__ == "__main__":
solve_captcha_example()
```
> **Note**: For image CAPTCHAs, the `query` parameter is required - it specifies what type of object to identify (e.g., "Select all images with traffic lights", "Select all squares with buses"). For audio CAPTCHAs, the `query` parameter is optional.
## 📋 Requirements
- Python 3.12+
- Dependencies:
- groq >= 0.15.0
- moondream >= 0.0.6
- pydantic >= 2.10.5
- pydub >= 0.25.1
- pytest >= 8.3.4
## 📝 TODO List
- [x] **Core Features**
- [x] Groq LLM integration
- [x] Moondream vision model integration
- [x] AWS WAF CAPTCHA image solving
- [x] AWS WAF CAPTCHA audio solving
- [x] Fallback resolver system
- [ ] **Direct AWS Integration**
- [ ] Handle AWS CAPTCHA request/response flow directly
- [ ] Implement automatic token extraction and submission
- [ ] **Browser Automation**
- [ ] Selenium integration for automated CAPTCHA solving
- [ ] Playwright integration
- [ ] Browser extension support
- [ ] **Future Enhancements**
- [ ] Support for additional CAPTCHA providers
- [ ] More AI model options
- [ ] Performance optimizations
- [ ] Improved error handling and retries
- [ ] Comprehensive logging system
## 🤝 Contributing
We welcome your contributions! We want to make it easy for you to help improve Captchai. Check out our [Contributing Guidelines](CONTRIBUTING.md) to get started.
1. Fork the repo
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## 📝 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ⚠️ Disclaimer
**IMPORTANT: FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY**
This library is for **research and educational purposes only**. It helps study and understand how AI can solve CAPTCHA challenges.
By using this library, you agree that:
1. This tool is only for research, testing, and learning
2. Using this library to bypass CAPTCHAs on real websites may break their terms of service
3. The developers and contributors are NOT responsible for:
- Any misuse of the library
- Breaking any website's terms of service
- Any legal issues from using this library
- Any problems or losses from using this library
4. You are responsible for using this library in a way that follows all laws, rules, and terms of service
**DO NOT** use this library to:
- Bypass security on real websites
- Break any website's terms of service
- Do any kind of automated abuse or spam
## 🌟 Show Your Support
Give a ⭐️ if this project helped you!
---
<div align="center">
Made with ❤️ by the xAhai and LaProp Team
</div>
Raw data
{
"_id": null,
"home_page": null,
"name": "captchai",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "captcha, captcha solver, captcha solver python, captcha solver python library",
"author": null,
"author_email": "Alejandro Jaramillo <me@alejo.co>, xAhai <info@xahai.com>, Alejandro Jaramillo xAhai <alejandro@xahai.co>, Alejandro Jaramillo LaProp <alejandro.jaramillo@laprop.co>, Alejandro Jaramillo TBLabs <alejandro.jaramillo@tblabs.co>",
"download_url": "https://files.pythonhosted.org/packages/35/d1/290ba80737ada1c34960b6a67da4d8e69d99de0289e616f94a09a2b0aded/captchai-0.0.1.tar.gz",
"platform": null,
"description": "# \ud83e\udd16 CaptchAI\n\n<div align=\"center\">\n\n[](https://www.python.org/downloads/)\n[](LICENSE)\n[](https://github.com/astral-sh/ruff)\n[]()\n\n**Solve AWS WAF CAPTCHAs using Modern AI! \ud83d\ude80**\n\n*Using powerful AI models like Groq and Moondream to solve AWS WAF CAPTCHAs quickly and accurately*\n\n*A joint development effort by [LaProp](https://laprop.co) and [XAhai](https://xahai.co)*\n\n> \u26a0\ufe0f **Alpha Status Notice**: This library is currently in alpha stage. Many features are still under development, \n> requiring thorough testing and integration. Expect frequent updates and potential breaking changes.\n> We welcome feedback and contributions to help improve stability and functionality!\n\n[Features](#-features) \u2022\n[Installation](#-installation) \u2022\n[Configuration](#%EF%B8%8F-configuration) \u2022\n[Quick Start](#-quick-start) \u2022\n[Documentation](#-documentation) \u2022\n[Contributing](#-contributing)\n\n</div>\n\n## \ud83c\udf1f Features\n\n- \ud83e\udde0 **Modern AI Models**\n - Groq LLM for smart solving\n - Moondream for image analysis\n - High accuracy rates\n \n- \ud83d\udee1\ufe0f **AWS WAF CAPTCHA Support**\n - Built for AWS WAF challenges\n - Solves image puzzles\n - Handles audio challenges\n \n- \u26a1 **High Performance**\n - Quick processing\n - Smart backup options\n - Reliable results\n \n- \ud83d\udee0\ufe0f **Easy to Use**\n - Simple API\n - Easy setup\n - Built to extend\n - Full Python typing\n\n> **Note**: Currently, CaptchAI only works with AWS WAF CAPTCHAs. We plan to add support for other CAPTCHAs in the future.\n\n## \ud83d\udce6 Installation\n\n```bash\npip install captchai\n```\n\n## \u2699\ufe0f Configuration\n\n```python\nfrom captchai.core.models.config import CaptchaGlobalConfig, AWSProviderConfig, AvailableResolvers\n\nconfig = CaptchaGlobalConfig(\n groq_api_key=\"your-groq-api-key\",\n moondream_api_key=\"your-moondream-api-key\",\n aws_provider_config=AWSProviderConfig(\n image_size=(640, 640), # Customize image size\n grid_size=3, # Grid dimensions\n resolver=AvailableResolvers.GROQ_IMAGE_ONE_SHOOT,\n # Fallback resolvers for resilience\n list_resolver_image_fallback=[\n AvailableResolvers.MOONDREAM_IMAGE_ONE_SHOOT,\n AvailableResolvers.GROQ_IMAGE_ONE_SHOOT,\n AvailableResolvers.GROQ_IMAGE_MULTI_SHOOT,\n AvailableResolvers.MOONDREAM_IMAGE_MULTI_SHOOT\n ]\n )\n)\n```\n\n## \ud83c\udfaf Available Resolvers\n\n### \ud83d\uddbc\ufe0f Image Resolvers\n- `GROQ_IMAGE_ONE_SHOOT`: Single-shot solving with Groq\n- `GROQ_IMAGE_MULTI_SHOOT`: Multi-shot approach with Groq\n- `MOONDREAM_IMAGE_ONE_SHOOT`: Quick Moondream vision model\n- `MOONDREAM_IMAGE_MULTI_SHOOT`: Advanced Moondream processing\n\n### \ud83c\udfb5 Audio Resolvers\n- `GROQ_AUDIO`: Advanced audio CAPTCHA processing\n\n## \ud83d\ude80 Quick Start\n\nHere's a complete example of how to use Captchai to solve different types of CAPTCHAs:\n\n```python\nfrom captchai import CaptchaSolver\nfrom captchai.core.models.config import (\n CaptchaGlobalConfig,\n AWSProviderConfig,\n AvailableResolvers\n)\nimport base64\n\ndef solve_captcha_example():\n # 1. Configure the solver\n config = CaptchaGlobalConfig(\n groq_api_key=\"your-groq-api-key\",\n moondream_api_key=\"your-moondream-api-key\",\n aws_provider_config=AWSProviderConfig(\n resolver=AvailableResolvers.GROQ_IMAGE_ONE_SHOOT,\n grid_size=3,\n image_size=(640, 640)\n )\n )\n\n # 2. Initialize the solver\n solver = CaptchaSolver(config)\n\n # 3. Solve different types of CAPTCHAs\n \n # Image CAPTCHA (using base64 string)\n with open(\"path/to/captcha.png\", \"rb\") as image_file:\n image_base64 = base64.b64encode(image_file.read()).decode('utf-8')\n \n # For image CAPTCHAs, query is required - it specifies what type of object to identify\n image_result = solver.solve_aws_captcha_image(\n data=image_base64,\n query=\"bucket\" # Required: Specify the type of object to identify\n )\n print(f\"Image CAPTCHA Solution: {image_result}\")\n\n # Audio CAPTCHA (using base64 string)\n with open(\"path/to/audio.mp3\", \"rb\") as audio_file:\n audio_base64 = base64.b64encode(audio_file.read()).decode('utf-8')\n \n # For audio CAPTCHAs, query is optional\n audio_result = solver.solve_aws_captcha(\n data=audio_base64\n )\n print(f\"Audio CAPTCHA Solution: {audio_result}\")\n\nif __name__ == \"__main__\":\n solve_captcha_example()\n```\n\n> **Note**: For image CAPTCHAs, the `query` parameter is required - it specifies what type of object to identify (e.g., \"Select all images with traffic lights\", \"Select all squares with buses\"). For audio CAPTCHAs, the `query` parameter is optional.\n\n## \ud83d\udccb Requirements\n\n- Python 3.12+\n- Dependencies:\n - groq >= 0.15.0\n - moondream >= 0.0.6\n - pydantic >= 2.10.5\n - pydub >= 0.25.1\n - pytest >= 8.3.4\n\n## \ud83d\udcdd TODO List\n\n- [x] **Core Features**\n - [x] Groq LLM integration\n - [x] Moondream vision model integration\n - [x] AWS WAF CAPTCHA image solving\n - [x] AWS WAF CAPTCHA audio solving\n - [x] Fallback resolver system\n\n- [ ] **Direct AWS Integration**\n - [ ] Handle AWS CAPTCHA request/response flow directly\n - [ ] Implement automatic token extraction and submission\n\n- [ ] **Browser Automation**\n - [ ] Selenium integration for automated CAPTCHA solving\n - [ ] Playwright integration\n - [ ] Browser extension support\n\n- [ ] **Future Enhancements**\n - [ ] Support for additional CAPTCHA providers\n - [ ] More AI model options\n - [ ] Performance optimizations\n - [ ] Improved error handling and retries\n - [ ] Comprehensive logging system\n\n## \ud83e\udd1d Contributing\n\nWe welcome your contributions! We want to make it easy for you to help improve Captchai. Check out our [Contributing Guidelines](CONTRIBUTING.md) to get started.\n\n1. Fork the repo\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## \ud83d\udcdd License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \u26a0\ufe0f Disclaimer\n\n**IMPORTANT: FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY**\n\nThis library is for **research and educational purposes only**. It helps study and understand how AI can solve CAPTCHA challenges.\n\nBy using this library, you agree that:\n\n1. This tool is only for research, testing, and learning\n2. Using this library to bypass CAPTCHAs on real websites may break their terms of service\n3. The developers and contributors are NOT responsible for:\n - Any misuse of the library\n - Breaking any website's terms of service\n - Any legal issues from using this library\n - Any problems or losses from using this library\n4. You are responsible for using this library in a way that follows all laws, rules, and terms of service\n\n**DO NOT** use this library to:\n- Bypass security on real websites\n- Break any website's terms of service\n- Do any kind of automated abuse or spam\n\n## \ud83c\udf1f Show Your Support\n\nGive a \u2b50\ufe0f if this project helped you!\n\n---\n\n<div align=\"center\">\nMade with \u2764\ufe0f by the xAhai and LaProp Team\n</div>",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Captchai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Captchai is a python library for solving captchas using AI",
"version": "0.0.1",
"project_urls": null,
"split_keywords": [
"captcha",
" captcha solver",
" captcha solver python",
" captcha solver python library"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "546d667f705924cfea2cfff9c6e0c0516ac91e133b3219fdd6dc05ecbe41927e",
"md5": "b9ef2e1148f09836a269564299de5181",
"sha256": "cba5a31e41a061b5df7c38401835a86140b3b23cc77280c51a7ef6e491e07445"
},
"downloads": -1,
"filename": "captchai-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b9ef2e1148f09836a269564299de5181",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 13402,
"upload_time": "2025-01-17T11:02:02",
"upload_time_iso_8601": "2025-01-17T11:02:02.100739Z",
"url": "https://files.pythonhosted.org/packages/54/6d/667f705924cfea2cfff9c6e0c0516ac91e133b3219fdd6dc05ecbe41927e/captchai-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "35d1290ba80737ada1c34960b6a67da4d8e69d99de0289e616f94a09a2b0aded",
"md5": "b8b1dafe005182d68db6c934bf4659d2",
"sha256": "87f4cb2782004b2ccb2240cb8904b907707f936959cd15b24788828231d6f723"
},
"downloads": -1,
"filename": "captchai-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "b8b1dafe005182d68db6c934bf4659d2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 11545421,
"upload_time": "2025-01-17T11:02:14",
"upload_time_iso_8601": "2025-01-17T11:02:14.109850Z",
"url": "https://files.pythonhosted.org/packages/35/d1/290ba80737ada1c34960b6a67da4d8e69d99de0289e616f94a09a2b0aded/captchai-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-17 11:02:14",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "captchai"
}