Advertisement
kopyl

Untitled

Jun 14th, 2023
1,034
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. import aiohttp
  2. import asyncio
  3.  
  4.  
  5. async def make_request(session):
  6.     url = "https://..."
  7.     payload = {
  8.         "image_url": "https://cdn.discordapp.com/attachments/1096822099345145969/1117198390585987092/68a31cb7cc50b355a63624176e095c250cb39e6c.jpg"
  9.     }
  10.     headers = {
  11.         "Authorization": "8Jw1kj5Woa4SDHtD%hH!7v4--",
  12.     }
  13.     async with session.post(url, json=payload, headers=headers) as response:
  14.         return await response.json()
  15.  
  16.  
  17. async with aiohttp.ClientSession() as session:
  18.     tasks = []
  19.  
  20.     for i in range(0, 60):
  21.         tasks.append(asyncio.create_task(make_request(session)))
  22.  
  23.     results = await asyncio.gather(*tasks)
  24.     for result in results:
  25.         print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement