Last active
January 10, 2017 09:03
-
-
Save Aareon/aa3ea6a127b6b143147bcb67bd247c4a to your computer and use it in GitHub Desktop.
Downloads Endless Frontier Discord Server icons, displays progress, saves them to ./icons
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 os,requests | |
icons = requests.get('http://pastebin.com/raw/b5fdkNp9').content.splitlines() | |
if not os.path.exists('./icons'): | |
print("Creating ./icons") | |
os.mkdir('./icons') | |
for i, icon in enumerate(icons): | |
##print('{0}\r'.format("Downloaded: "+str(i+1)+"/"+str(len(icons))+" images")), ##Python 2.7 | |
##print("Downloaded: "+str(i+1)+"/"+str(len(icons))+" images", end="\r"), ##Python 3.x | |
img_data = requests.get(icons[i]).content | |
with open("./icons/icon"+str(i)+".png", 'wb') as handler: | |
handler.write(img_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Optimized to the best of my ability to compile and run in Python 3.
Uncomment line 7 for Python 2.7, line 8 for Python 3.