File size: 1,402 Bytes
ed1b19a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | import asyncio
import httpx
async def main():
# Gunakan timeout yang cukup lama karena Puppeteer butuh waktu untuk bypass
# Jika di lokal/server, sesuaikan URL-nya
base_url = "http://localhost:7860"
limits = httpx.Limits(max_keepalive_connections=5, max_connections=10)
async with httpx.AsyncClient(timeout=120.0, limits=limits) as client:
print("--- Testing Mode: IUAM ---")
try:
resp1 = await client.post(
f"{base_url}/cloudflare",
json={
"domain": "https://olamovies.watch/generate",
"mode": "iuam",
},
)
# Menggunakan .get() agar tidak error jika respon bukan JSON
print(resp1.status_code, resp1.json())
except Exception as e:
print(f"Error pada IUAM: {e}")
print("\n--- Testing Mode: Turnstile ---")
try:
resp2 = await client.post(
f"{base_url}/cloudflare",
json={
"domain": "https://lksfy.com/",
"siteKey": "0x4AAAAAAA49NnPZwQijgRoi",
"mode": "turnstile",
},
)
print(resp2.status_code, resp2.json())
except Exception as e:
print(f"Error pada Turnstile: {e}")
if __name__ == "__main__":
asyncio.run(main())
|