Created
April 21, 2019 22:58
-
-
Save satomacoto/f4a5d8260469e3d93930c949d9257314 to your computer and use it in GitHub Desktop.
download with requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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