Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, os
- version = 1.0
- nc = lambda s: (s,s.lower(),s.capitalize())
- print("Minecraft Skin Downloader - Version %s" % str(version))
- print("Current Download Path: %s" % os.getcwd())
- print("Press Ctrl-C to quit; Type !!HELP for information")
- print("="*80)
- run = True
- try:
- while run:
- try:
- req = raw_input("Minecraft Username: ")
- if req == "!!HELP":
- print("#"*80)
- print("-Minecraft Skin Downloader")
- print("-Version %s" % str(version))
- print("-Type any *valid* Minecraft Username at the prompt.")
- print("-Usernames are case sensitive.")
- print("-To try to fix this, Minecraft Skin Downloader will attempt to download the name 3 times with different capitalizations.")
- print("-If it fails all 3 times, Either: The user does not exist or You typed the name wrong.")
- print("-Skin is downloaded and saved as a .png in the same directory as this program's executable/.py file.")
- print("Pastebin: http://pastebin.com/78mrj1U2\n")
- print("#"*80)
- else:
- print("Attempting to download %s's skin..." % req)
- formatted_names = nc(req)
- for name in formatted_names:
- try:
- print("Trying: %s" % name)
- url = "https://s3.amazonaws.com/MinecraftSkins/%s.png" % name
- content = urllib.urlopen(url).read()
- if "AccessDenied" in content:
- raise Exception, "Error: The username '%s' is not valid." % name
- urllib.urlretrieve(url, name+'.png')
- print("Download Successful.")
- except Exception, e:
- print e
- except Exception, e:
- print(e)
- run = False
- except Exception, e:
- print(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement