Advertisement
Guest User

Untitled

a guest
May 28th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import urllib, httplib, getpass
  2.  
  3. conn = httplib.HTTPConnection("minecraft.net")
  4. p = urllib.urlencode({
  5.     "username": raw_input("user: "),
  6.     "password": getpass.getpass("pass: ")
  7. })
  8. conn.request("POST", "/login.jsp", p, {
  9.     "Content-Type": "application/x-www-form-urlencoded",
  10.     "Content-Length": str(len(p))
  11. })
  12. resp = conn.getresponse()
  13. data = resp.read()
  14. conn.close()
  15. if resp.status == 302:
  16.     print "Logged in."
  17. else:
  18.     print "Failed to login."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement