Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, httplib, getpass
- conn = httplib.HTTPConnection("minecraft.net")
- p = urllib.urlencode({
- "username": raw_input("user: "),
- "password": getpass.getpass("pass: ")
- })
- conn.request("POST", "/login.jsp", p, {
- "Content-Type": "application/x-www-form-urlencoded",
- "Content-Length": str(len(p))
- })
- resp = conn.getresponse()
- data = resp.read()
- conn.close()
- if resp.status == 302:
- print "Logged in."
- else:
- print "Failed to login."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement