# CloudflareBypasser
A professional Python library for bypassing Cloudflare protection mechanisms without relying on external paid services, with optional support for captcha solving APIs.
## Features
- **Free operation** - Uses proprietary techniques without external services
- **Optional API support** - Integration with 2captcha, anticaptcha, capmonster, and others
- **Human behavior simulation** - Advanced behavioral patterns
- **Fingerprint spoofing** - Browser fingerprint randomization
- **Multiple strategies** - Various bypass techniques with automatic fallbacks
- **Robust architecture** - Built-in retry mechanisms and error handling
- **Simple API** - Clean and intuitive interface
## Installation
```bash
# Basic installation
pip install cloudflare-bypasser
# With advanced dependencies
pip install cloudflare-bypasser[advanced]
# With machine learning support
pip install cloudflare-bypasser[ml]
# Complete installation
pip install cloudflare-bypasser[advanced,ml]
```
## Quick Start
### Basic Usage (Free)
```python
from cloudflare_bypass import CloudflareBypasser
# Simple usage
with CloudflareBypasser() as bypasser:
success = bypasser.bypass_url("https://example.com")
if success:
print("Bypass successful")
print(f"Title: {bypasser.get_title()}")
print(f"URL: {bypasser.get_current_url()}")
```
### With API Key (More Reliable)
```python
from cloudflare_bypass import CloudflareBypasser
# With captcha service
bypasser = CloudflareBypasser(
captcha_service="2captcha", # or "anticaptcha", "capmonster"
api_key="your_api_key_here"
)
with bypasser:
success = bypasser.bypass_url("https://protected-site.com")
if success:
page_source = bypasser.get_page_source()
# Continue with your logic
```
### Advanced Configuration
```python
from cloudflare_bypass import CloudflareBypasser, BypassConfig, BypassMode
# Custom configuration
config = BypassConfig(
mode=BypassMode.STEALTH,
headless=True,
simulate_human=True,
enable_fingerprint_spoofing=True,
captcha_service="anticaptcha",
api_key="your_api_key",
timeout=90,
max_retries=3
)
with CloudflareBypasser(config=config) as bypasser:
success = bypasser.bypass_url("https://difficult-site.com")
```
### Predefined Configurations
```python
from cloudflare_bypass import CloudflareBypasser, STEALTH_CONFIG, FAST_CONFIG
# Stealth mode
with CloudflareBypasser(config=STEALTH_CONFIG) as bypasser:
success = bypasser.bypass_url("https://example.com")
# Fast mode
with CloudflareBypasser(config=FAST_CONFIG) as bypasser:
success = bypasser.bypass_url("https://example.com")
```
## Advanced Examples
### Processing Multiple URLs
```python
from cloudflare_bypass import CloudflareBypasser
urls = [
"https://site1.com",
"https://site2.com",
"https://site3.com"
]
with CloudflareBypasser(captcha_service="2captcha", api_key="key") as bypasser:
for url in urls:
print(f"Processing: {url}")
if bypasser.bypass_url(url):
print(f"Success: {bypasser.get_title()}")
else:
print(f"Failed: {url}")
```
### Using Proxy
```python
config = BypassConfig(
proxy="http://proxy:port",
proxy_auth={"username": "user", "password": "pass"},
captcha_service="capmonster",
api_key="your_key"
)
with CloudflareBypasser(config=config) as bypasser:
success = bypasser.bypass_url("https://example.com")
```
### Error Handling
```python
from cloudflare_bypass import CloudflareBypasser, CloudflareBypassError, DriverError
try:
with CloudflareBypasser() as bypasser:
success = bypasser.bypass_url("https://example.com")
if success:
element = bypasser.find_element("css selector", ".some-class")
except DriverError as e:
print(f"Driver error: {e}")
except CloudflareBypassError as e:
print(f"Bypass error: {e}")
except Exception as e:
print(f"General error: {e}")
```
## Configuration
### Supported Captcha Services
| Service | Approximate Cost | Speed | Accuracy |
|---------|------------------|-------|----------|
| 2captcha | $2.99/1k | Medium | High |
| anticaptcha | $2.00/1k | High | Very High |
| capmonster | $1.60/1k | Very High | High |
| deathbycaptcha | $1.39/1k | Medium | Medium |
### Bypass Modes
- **AUTO**: Automatically detects the best method
- **STEALTH**: Stealth mode with advanced techniques
- **AGGRESSIVE**: Aggressive mode for difficult cases
- **MINIMAL**: Fast mode for simple cases
## Performance
| Challenge Type | Success Rate | Average Time |
|----------------|--------------|--------------|
| JS Challenge | 85-95% | 5-15s |
| Simple Turnstile | 70-85% | 10-30s |
| Complex Turnstile | 40-60% | 30-60s |
| With API Service | 95-99% | 15-45s |
## Command Line Interface
```bash
# Basic bypass
cloudflare-bypasser bypass "https://example.com"
# With configuration
cloudflare-bypasser bypass "https://example.com" --mode stealth --headless
# With API key
cloudflare-bypasser bypass "https://example.com" --captcha-service 2captcha --api-key "your_key"
# Save results
cloudflare-bypasser bypass "https://example.com" --output page.html --screenshot shot.png
# Show package info
cloudflare-bypasser info
# Run tests
cloudflare-bypasser test
```
## Development
### Development Installation
```bash
git clone https://github.com/yourusername/cloudflare-bypass.git
cd cloudflare-bypass
pip install -e .[dev,advanced,ml]
```
### Running Tests
```bash
pytest tests/
pytest --cov=cloudflare_bypass tests/
```
### Code Quality
```bash
black cloudflare_bypass/
flake8 cloudflare_bypass/
mypy cloudflare_bypass/
```
## Legal Considerations
- Research and testing purposes
- Automation of your own websites
- Educational purposes
- Respect terms of service
- No malicious activities
- No unauthorized scraping
**Use this library responsibly and respect website terms of service.**
## Contributing
Contributions are welcome. Please:
1. Fork the project
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Open a Pull Request
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Support
- Documentation: https://cloudflarebypass.readthedocs.io/
- Issues: https://github.com/yourusername/cloudflare-bypass/issues
- Discussions: https://github.com/yourusername/cloudflare-bypass/discussions
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for a complete list of changes and version history.
Raw data
{
"_id": null,
"home_page": "https://github.com/cloudflarebypass/cloudflare-bypass",
"name": "cloudflare-bypasser",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "CloudflareBypass Team <dev@cloudflarebypass.com>",
"keywords": "cloudflare, bypass, captcha, selenium, automation, web-scraping, bot-detection, turnstile, challenge",
"author": "CloudflareBypass Team",
"author_email": "CloudflareBypass Team <dev@cloudflarebypass.com>",
"download_url": "https://files.pythonhosted.org/packages/18/eb/7e9e4c6eae2ca50f66a87576b128147c25ab160c70cc5cd230304d58f3e3/cloudflare_bypasser-1.0.0.tar.gz",
"platform": null,
"description": "# CloudflareBypasser\n\nA professional Python library for bypassing Cloudflare protection mechanisms without relying on external paid services, with optional support for captcha solving APIs.\n\n## Features\n\n- **Free operation** - Uses proprietary techniques without external services\n- **Optional API support** - Integration with 2captcha, anticaptcha, capmonster, and others\n- **Human behavior simulation** - Advanced behavioral patterns\n- **Fingerprint spoofing** - Browser fingerprint randomization\n- **Multiple strategies** - Various bypass techniques with automatic fallbacks\n- **Robust architecture** - Built-in retry mechanisms and error handling\n- **Simple API** - Clean and intuitive interface\n\n## Installation\n\n```bash\n# Basic installation\npip install cloudflare-bypasser\n\n# With advanced dependencies\npip install cloudflare-bypasser[advanced]\n\n# With machine learning support\npip install cloudflare-bypasser[ml]\n\n# Complete installation\npip install cloudflare-bypasser[advanced,ml]\n```\n\n## Quick Start\n\n### Basic Usage (Free)\n\n```python\nfrom cloudflare_bypass import CloudflareBypasser\n\n# Simple usage\nwith CloudflareBypasser() as bypasser:\n success = bypasser.bypass_url(\"https://example.com\")\n if success:\n print(\"Bypass successful\")\n print(f\"Title: {bypasser.get_title()}\")\n print(f\"URL: {bypasser.get_current_url()}\")\n```\n\n### With API Key (More Reliable)\n\n```python\nfrom cloudflare_bypass import CloudflareBypasser\n\n# With captcha service\nbypasser = CloudflareBypasser(\n captcha_service=\"2captcha\", # or \"anticaptcha\", \"capmonster\"\n api_key=\"your_api_key_here\"\n)\n\nwith bypasser:\n success = bypasser.bypass_url(\"https://protected-site.com\")\n if success:\n page_source = bypasser.get_page_source()\n # Continue with your logic\n```\n\n### Advanced Configuration\n\n```python\nfrom cloudflare_bypass import CloudflareBypasser, BypassConfig, BypassMode\n\n# Custom configuration\nconfig = BypassConfig(\n mode=BypassMode.STEALTH,\n headless=True,\n simulate_human=True,\n enable_fingerprint_spoofing=True,\n captcha_service=\"anticaptcha\",\n api_key=\"your_api_key\",\n timeout=90,\n max_retries=3\n)\n\nwith CloudflareBypasser(config=config) as bypasser:\n success = bypasser.bypass_url(\"https://difficult-site.com\")\n```\n\n### Predefined Configurations\n\n```python\nfrom cloudflare_bypass import CloudflareBypasser, STEALTH_CONFIG, FAST_CONFIG\n\n# Stealth mode\nwith CloudflareBypasser(config=STEALTH_CONFIG) as bypasser:\n success = bypasser.bypass_url(\"https://example.com\")\n\n# Fast mode\nwith CloudflareBypasser(config=FAST_CONFIG) as bypasser:\n success = bypasser.bypass_url(\"https://example.com\")\n```\n\n## Advanced Examples\n\n### Processing Multiple URLs\n\n```python\nfrom cloudflare_bypass import CloudflareBypasser\n\nurls = [\n \"https://site1.com\",\n \"https://site2.com\", \n \"https://site3.com\"\n]\n\nwith CloudflareBypasser(captcha_service=\"2captcha\", api_key=\"key\") as bypasser:\n for url in urls:\n print(f\"Processing: {url}\")\n if bypasser.bypass_url(url):\n print(f\"Success: {bypasser.get_title()}\")\n else:\n print(f\"Failed: {url}\")\n```\n\n### Using Proxy\n\n```python\nconfig = BypassConfig(\n proxy=\"http://proxy:port\",\n proxy_auth={\"username\": \"user\", \"password\": \"pass\"},\n captcha_service=\"capmonster\",\n api_key=\"your_key\"\n)\n\nwith CloudflareBypasser(config=config) as bypasser:\n success = bypasser.bypass_url(\"https://example.com\")\n```\n\n### Error Handling\n\n```python\nfrom cloudflare_bypass import CloudflareBypasser, CloudflareBypassError, DriverError\n\ntry:\n with CloudflareBypasser() as bypasser:\n success = bypasser.bypass_url(\"https://example.com\")\n \n if success:\n element = bypasser.find_element(\"css selector\", \".some-class\")\n \nexcept DriverError as e:\n print(f\"Driver error: {e}\")\nexcept CloudflareBypassError as e:\n print(f\"Bypass error: {e}\")\nexcept Exception as e:\n print(f\"General error: {e}\")\n```\n\n## Configuration\n\n### Supported Captcha Services\n\n| Service | Approximate Cost | Speed | Accuracy |\n|---------|------------------|-------|----------|\n| 2captcha | $2.99/1k | Medium | High |\n| anticaptcha | $2.00/1k | High | Very High |\n| capmonster | $1.60/1k | Very High | High |\n| deathbycaptcha | $1.39/1k | Medium | Medium |\n\n### Bypass Modes\n\n- **AUTO**: Automatically detects the best method\n- **STEALTH**: Stealth mode with advanced techniques\n- **AGGRESSIVE**: Aggressive mode for difficult cases \n- **MINIMAL**: Fast mode for simple cases\n\n## Performance\n\n| Challenge Type | Success Rate | Average Time |\n|----------------|--------------|--------------|\n| JS Challenge | 85-95% | 5-15s |\n| Simple Turnstile | 70-85% | 10-30s |\n| Complex Turnstile | 40-60% | 30-60s |\n| With API Service | 95-99% | 15-45s |\n\n## Command Line Interface\n\n```bash\n# Basic bypass\ncloudflare-bypasser bypass \"https://example.com\"\n\n# With configuration\ncloudflare-bypasser bypass \"https://example.com\" --mode stealth --headless\n\n# With API key\ncloudflare-bypasser bypass \"https://example.com\" --captcha-service 2captcha --api-key \"your_key\"\n\n# Save results\ncloudflare-bypasser bypass \"https://example.com\" --output page.html --screenshot shot.png\n\n# Show package info\ncloudflare-bypasser info\n\n# Run tests\ncloudflare-bypasser test\n```\n\n## Development\n\n### Development Installation\n\n```bash\ngit clone https://github.com/yourusername/cloudflare-bypass.git\ncd cloudflare-bypass\npip install -e .[dev,advanced,ml]\n```\n\n### Running Tests\n\n```bash\npytest tests/\npytest --cov=cloudflare_bypass tests/\n```\n\n### Code Quality\n\n```bash\nblack cloudflare_bypass/\nflake8 cloudflare_bypass/\nmypy cloudflare_bypass/\n```\n\n## Legal Considerations\n\n- Research and testing purposes\n- Automation of your own websites\n- Educational purposes\n- Respect terms of service\n- No malicious activities\n- No unauthorized scraping\n\n**Use this library responsibly and respect website terms of service.**\n\n## Contributing\n\nContributions are welcome. Please:\n\n1. Fork the project\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- Documentation: https://cloudflarebypass.readthedocs.io/\n- Issues: https://github.com/yourusername/cloudflare-bypass/issues\n- Discussions: https://github.com/yourusername/cloudflare-bypass/discussions\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a complete list of changes and version history.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Professional Python library for bypassing Cloudflare protection without external services",
"version": "1.0.0",
"project_urls": {
"Bug Reports": "https://github.com/cloudflarebypass/cloudflare-bypass/issues",
"Changelog": "https://github.com/cloudflarebypass/cloudflare-bypass/blob/main/CHANGELOG.md",
"Documentation": "https://cloudflarebypass.readthedocs.io/",
"Homepage": "https://github.com/cloudflarebypass/cloudflare-bypass",
"Repository": "https://github.com/cloudflarebypass/cloudflare-bypass.git"
},
"split_keywords": [
"cloudflare",
" bypass",
" captcha",
" selenium",
" automation",
" web-scraping",
" bot-detection",
" turnstile",
" challenge"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1ca79d189343d3f4153cdb3d4e7071325cc51673def1bb834cd9376f588aec51",
"md5": "1a728f02b048baf75ecebdc2221ae10e",
"sha256": "6cfafbf3ae0536cc6265aac3038c516892d8d2f56e48b6d50790eadb74b54d73"
},
"downloads": -1,
"filename": "cloudflare_bypasser-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1a728f02b048baf75ecebdc2221ae10e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 19270,
"upload_time": "2025-09-03T10:32:42",
"upload_time_iso_8601": "2025-09-03T10:32:42.857476Z",
"url": "https://files.pythonhosted.org/packages/1c/a7/9d189343d3f4153cdb3d4e7071325cc51673def1bb834cd9376f588aec51/cloudflare_bypasser-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "18eb7e9e4c6eae2ca50f66a87576b128147c25ab160c70cc5cd230304d58f3e3",
"md5": "e222e5b0130797b9e5fab900f07eb2a3",
"sha256": "b327a6735c40a2753305b35af3a5d560e578fed641737700a541fa1d004efe1e"
},
"downloads": -1,
"filename": "cloudflare_bypasser-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "e222e5b0130797b9e5fab900f07eb2a3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 23112,
"upload_time": "2025-09-03T10:32:44",
"upload_time_iso_8601": "2025-09-03T10:32:44.071662Z",
"url": "https://files.pythonhosted.org/packages/18/eb/7e9e4c6eae2ca50f66a87576b128147c25ab160c70cc5cd230304d58f3e3/cloudflare_bypasser-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-03 10:32:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cloudflarebypass",
"github_project": "cloudflare-bypass",
"github_not_found": true,
"lcname": "cloudflare-bypasser"
}