Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created December 1, 2019 19:22
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 NMZivkovic/8fd6511a5a2663ef7a9443d978390507 to your computer and use it in GitHub Desktop.
Save NMZivkovic/8fd6511a5a2663ef7a9443d978390507 to your computer and use it in GitHub Desktop.
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