Skip to content

Instantly share code, notes, and snippets.

@satomacoto
Created April 21, 2019 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satomacoto/f4a5d8260469e3d93930c949d9257314 to your computer and use it in GitHub Desktop.
Save satomacoto/f4a5d8260469e3d93930c949d9257314 to your computer and use it in GitHub Desktop.
download with requests
import shutil
import requests
def download(url, dst):
response = requests.get(url, stream=True)
with open(str(dst), 'wb') as out_file:
shutil.copyfileobj(response.raw, out_file)
del response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment