Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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