Skip to content

Instantly share code, notes, and snippets.

View langma's full-sized avatar

Markus Lång langma

  • Roblox
  • San Mateo
View GitHub Profile
@Hammer2900
Hammer2900 / download_multiple.py
Created September 28, 2016 17:51 — forked from harrisont/download_multiple.py
Use asyncio and aiohttp to asynchronously download multiple files at once and handle the responses as they finish
import asyncio
from contextlib import closing
import aiohttp
async def download_file(session: aiohttp.ClientSession, url: str):
async with session.get(url) as response:
assert response.status == 200
# For large files use response.content.read(chunk_size) instead.