Skip to content

Instantly share code, notes, and snippets.

@Rotzke
Last active February 11, 2018 22:25
Show Gist options
  • Save Rotzke/4797fbc40a31b94f7fdb35adbb5b499c to your computer and use it in GitHub Desktop.
Save Rotzke/4797fbc40a31b94f7fdb35adbb5b499c to your computer and use it in GitHub Desktop.
Requests images downloader
import requests
from PIL import Image
from io import BytesIO
filename = 'image.jpg'
r = requests.get('https://example.com/image.jpg')
i = Image.open(BytesIO(r.content))
i.save(filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment