Created
December 1, 2019 19:22
-
-
Save NMZivkovic/8fd6511a5a2663ef7a9443d978390507 to your computer and use it in GitHub Desktop.
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
def download_image(image): | |
response = requests.get(image[0], stream=True) | |
realname = ''.join(e for e in image[1] if e.isalnum()) | |
file = open("C://images//bs//{}.jpg".format(realname), 'wb') | |
response.raw.decode_content = True | |
shutil.copyfileobj(response.raw, file) | |
del response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment