Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, urllib2, os
- baseUrl = "https://boards.4chan.org/js/jsMath/fonts/cmmi10/alpha/120/char{0}.png"
- directory = os.getcwd()+"/characters/"
- os.mkdir(directory)
- for i in range(100):
- try:
- fullLink = baseUrl.format(i)
- readableData = urllib2.urlopen(fullLink).read()
- if "4chan - 404 Not Found" in readableData:
- raise Exception, "Not found"
- urllib.urlretrieve(fullLink, directory+"char{0}.png".format(i))
- print "Downloaded character {0}".format(i)
- except Exception, e:
- print "Unable to Download character {0}, {1}".format(i, e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement