Last active
February 11, 2018 22:25
-
-
Save Rotzke/4797fbc40a31b94f7fdb35adbb5b499c to your computer and use it in GitHub Desktop.
Requests images downloader
This file contains 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 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