KemoFureApi/modules/Shared/downloading.py

9 lines
303 B
Python
Raw Permalink Normal View History

2024-02-01 16:05:14 +08:00
import aiohttp
async def download_bytes(url, session : aiohttp.ClientSession):
async with session.get(url) as resp:
return await resp.read()
async def download_text(url, session : aiohttp.ClientSession):
async with session.get(url) as resp:
return await resp.text()