Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import aiohttp
- import asyncio
- async def make_request(session):
- url = "https://..."
- payload = {
- "image_url": "https://cdn.discordapp.com/attachments/1096822099345145969/1117198390585987092/68a31cb7cc50b355a63624176e095c250cb39e6c.jpg"
- }
- headers = {
- "Authorization": "8Jw1kj5Woa4SDHtD%hH!7v4--",
- }
- async with session.post(url, json=payload, headers=headers) as response:
- return await response.json()
- async with aiohttp.ClientSession() as session:
- tasks = []
- for i in range(0, 60):
- tasks.append(asyncio.create_task(make_request(session)))
- results = await asyncio.gather(*tasks)
- for result in results:
- print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement