Download bot.py from eres69/cloudflare-bypass-api: direct link, hf CLI and curl.
- Browser
- Download file 2 kB
-
https://huggingface.co/spaces/eres69/cloudflare-bypass-api/resolve/main/bot.py
- Command line
-
hf download hf://spaces/eres69/cloudflare-bypass-api/bot.py
-
curl -L -o bot.py https://huggingface.co/spaces/eres69/cloudflare-bypass-api/resolve/main/bot.py
2 kB
| import requests | |
| import time | |
| import os | |
| # Read from environment, default to HF Spaces port | |
| API_URL = os.getenv("API_URL", "http://127.0.0.1:7860/scrape") | |
| API_KEY = os.getenv("API_KEY", "my_secret_key_123") | |
| SITES = [ | |
| ("π’ No CF (httpbin)", "https://httpbin.org/headers"), | |
| ("π‘ Medium CF (G2.com)", "https://www.g2.com"), | |
| ("π΄ Strict CF", "https://nowsecure.nl"), | |
| ("π΄ Turnstile Demo", "https://demo.turnstile.workers.dev/"), | |
| ("π‘ Indeed (job site)", "https://www.indeed.com"), | |
| ] | |
| print("\n" + "="*62) | |
| print(" π¬ LIVE 3-STAGE BYPASS TEST β 5 REAL SITES") | |
| print("="*62) | |
| results = [] | |
| for label, url in SITES: | |
| print(f"\n {label}") | |
| print(f" URL: {url[:55]}") | |
| print(f" {'β'*52}") | |
| try: | |
| headers = {"X-API-Key": API_KEY} | |
| resp = requests.post(API_URL, json={"url": url}, headers=headers, timeout=60).json() | |
| stage = resp.get("stage", "?") | |
| method = resp.get("method", "?") | |
| t = resp.get("time_seconds", "?") | |
| cookies = resp.get("cookies", {}) | |
| token = resp.get("token") | |
| html = (resp.get("html") or "")[:80].replace("\n", " ") | |
| print(f" β Stage {stage}: {method}") | |
| print(f" β± Time: {t}s") | |
| print(f" πͺ Cookies: {len(cookies)}" + (f" π Token: {token[:25]}..." if token else "")) | |
| print(f" π Preview: {html}...") | |
| results.append((label, "β PASS", stage, t)) | |
| except Exception as e: | |
| print(f" β FAILED β {str(e)[:80]}") | |
| results.append((label, "β FAIL", "β", "β")) | |
| print("\n" + "="*62) | |
| print(" π SUMMARY TABLE") | |
| print("="*62) | |
| print(f" {'Site':<28} {'Result':<10} {'Stage':<8} {'Time'}") | |
| print(f" {'β'*28} {'β'*10} {'β'*8} {'β'*8}") | |
| for label, result, stage, t in results: | |
| print(f" {label:<28} {result:<10} {str(stage):<8} {t}s") | |
| wins = sum(1 for _, r, _, _ in results if "PASS" in r) | |
| print(f"\n Score: {wins}/5 sites bypassed") | |
| print("="*62) | |