Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, os, re
- def main():
- suffix = raw_input("http://imgur.com/a/")
- url = "http://imgur.com/a/"+suffix
- directory = suffix+"-DL"
- if not os.path.exists(directory): os.mkdir(directory)
- files = re.findall('<a href="\/\/i\.imgur\.com\/(.+)" target="_blank">View full resolution<\/a>', urllib.urlopen(url).read())
- for file in files:
- print "Downloading %s" % file
- fileurl = "http://i.imgur.com/%s" % file
- urllib.urlretrieve(fileurl, directory+"/%s " % file)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement