Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/core/utils.py
2021-02-11 20:41:07 +08:00

8 lines
273 B
Python

import aiohttp
async def get_url(url: str, headers=None):
async with aiohttp.ClientSession() as session:
async with session.get(url, timeout=aiohttp.ClientTimeout(total=20), headers=headers) as req:
text = await req.text()
return text