flarebreak
Python wrapper for cloudflare-solver — Cloudflare Turnstile ve IUAM korumalarını otomatik çözer.
Hem sync (requests) hem async (aiohttp) destekler.
Kurulum
# Sadece sync
pip install flarebreak
# Async da istiyorsan
pip install "flarebreak[async]"
Gereksinim
Kütüphaneyi kullanmadan önce solver servisinin çalışıyor olması lazım:
docker build -t turnstile-solver .
docker run -d -p 407:407 turnstile-solver
Kullanım
Otomatik (önerilen)
from flarebreak import CloudflareSolver
with CloudflareSolver() as solver:
# Sitekey aramana gerek yok — otomatik bulur ve çözer
result = solver.solve("https://korumalı-site.com")
print(result.token) # Turnstile ise
print(result.cf_clearance) # IUAM ise
Manuel — Turnstile
from flarebreak import CloudflareSolver
with CloudflareSolver() as solver:
result = solver.turnstile(
url="https://site.com",
sitekey="0x4AAAAAAAGzw6rXeQWJ_y2P",
)
print(result.token)
print(result.elapsed) # "2.94s"
Manuel — IUAM (cf_clearance)
import requests
from flarebreak import CloudflareSolver
with CloudflareSolver() as solver:
result = solver.iuam(url="https://nowsecure.nl")
print(result.cf_clearance)
print(result.user_agent) # replay'de zorunlu!
# Aynı oturumu devam ettir
session = requests.Session()
session.headers.update(result.headers)
resp = session.get("https://nowsecure.nl")
Ne tür koruma var? (detect)
with CloudflareSolver() as solver:
info = solver.detect("https://site.com")
print(info.has_turnstile) # True/False
print(info.has_iuam) # True/False
print(info.sitekey) # 0x4AAA...
Async + paralel
import asyncio
from flarebreak import AsyncCloudflareSolver
async def main():
async with AsyncCloudflareSolver() as solver:
results = await asyncio.gather(
solver.solve("https://site-a.com"),
solver.solve("https://site-b.com"),
solver.solve("https://site-c.com"),
)
for r in results:
print(r)
asyncio.run(main())
Proxy desteği
with CloudflareSolver() as solver:
result = solver.solve(
"https://site.com",
proxy="http://user:pass@proxy.example.com:8080",
# socks5://... ve socks4://... de desteklenir
)
API
CloudflareSolver(host, port, timeout)
| Param | Default | Açıklama |
|---|---|---|
host |
"localhost" |
Solver servis adresi |
port |
407 |
Solver servis portu |
timeout |
60 |
Saniye cinsinden zaman aşımı |
Metodlar
| Metod | Açıklama | Döndürür |
|---|---|---|
solve(url) |
Otomatik tespit et ve çöz | TurnstileResult veya IUAMResult |
turnstile(url, sitekey) |
Manuel Turnstile çöz | TurnstileResult |
iuam(url) |
Manuel IUAM çöz | IUAMResult |
detect(url) |
Sadece tespit et, çözme | DetectionResult |
health() |
Servis durumu | HealthResult |
Result nesneleri
TurnstileResult
result.token # "1.kMLfH4VM8k..."
result.elapsed # "2.94s"
result.success # True/False
IUAMResult
result.cf_clearance # "155jEz2BCC8o..."
result.user_agent # "Mozilla/5.0..."
result.headers # {"Cookie": "...", "User-Agent": "..."}
result.ip # "45.152.31.27"
result.elapsed # "2.87s"
result.success # True/False
DetectionResult
result.has_turnstile # True/False
result.has_iuam # True/False
result.sitekey # "0x4AAA..." (ilk bulunan)
result.sitekeys # ["0x4AAA...", ...] (tümü)
result.is_protected # True/False
Hata yönetimi
from flarebreak import SolverError, TimeoutError, SolverUnavailableError
try:
result = solver.solve("https://site.com")
except TimeoutError:
print("Solver zaman aşımına uğradı")
except SolverUnavailableError:
print("Docker container çalışmıyor")
except SolverError as e:
print(f"Hata: {e}")
Lisans
MIT
Metadata
Release files for flarebreak 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flarebreak-0.2.1.tar.gz | 11.2 kB | Without provenance | Details for flarebreak-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flarebreak-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for flarebreak-0.2.1-py3-none-any.whl |
Total release size: 23.2 kB
Release files / flarebreak-0.2.1.tar.gz
| Download URL | flarebreak-0.2.1.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75ee29fd929d4f8a6c2891554ce7b30e1b65351e87292ef740353fc046980b47
|
|
BLAKE2b-256 checksum How to use checksums |
e6c8988af5c7783467666217d3c0009f68dfe697239703025a5aee8ab343d43b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / flarebreak-0.2.1-py3-none-any.whl
| Download URL | flarebreak-0.2.1-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80d42da9860a4de18df6da03e12020d0056914c724494686463732f2049f281b
|
|
BLAKE2b-256 checksum How to use checksums |
c58095f42723352fd18cfb431efd63dccca6a3db767aa8caa6bcc774eea40a8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for flarebreak 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.