Skip to content

Instantly share code, notes, and snippets.

@mberz
Created December 7, 2020 20:39
Show Gist options
  • Select an option

  • Save mberz/54b3b778611ebd47021d6b30c8b7fae4 to your computer and use it in GitHub Desktop.

Select an option

Save mberz/54b3b778611ebd47021d6b30c8b7fae4 to your computer and use it in GitHub Desktop.
Download a file using urllib3
import urllib3
import shutil
http = urllib3.PoolManager()
with open(filename, 'wb') as out:
r = http.request('GET', url, preload_content=False)
shutil.copyfileobj(r, out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment