Skip to content

Instantly share code, notes, and snippets.

@evanhalley
Last active May 21, 2017 02:40
Show Gist options
  • Save evanhalley/3808528633ffa61bc509aa52cee55e79 to your computer and use it in GitHub Desktop.
Save evanhalley/3808528633ffa61bc509aa52cee55e79 to your computer and use it in GitHub Desktop.
Saves an image (jpg) given a url
import sys
import urllib
import time
url = sys.argv[1]
directory = sys.argv[2]
destination = directory + "/" + str(time.time()) + ".jpg"
print 'Saving image from url ', url, ' to ', destination
urllib.urlretrieve(url, destination)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment