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

9 lines
273 B
Python
Raw Normal View History

2021-02-06 16:30:13 +00:00
import aiohttp
2021-02-11 12:41:07 +00:00
async def get_url(url: str, headers=None):
2021-02-06 16:30:13 +00:00
async with aiohttp.ClientSession() as session:
2021-02-11 12:41:07 +00:00
async with session.get(url, timeout=aiohttp.ClientTimeout(total=20), headers=headers) as req:
2021-02-06 16:30:13 +00:00
text = await req.text()
return text