Basic encrpytion support, needs more work. Introduces new dependency pycrypto
This commit is contained in:
1 parent
75a68b3a9e
commit
fb7b22b771
5 files changed
+315
-170
No files matched your search
+4
-1
@@ -10,7 +10,7 @@ def loginToMinecraft(username, password):
|
||||
data = urllib.urlencode(data)
|
||||
req = urllib2.Request(url, data, header)
|
||||
opener = urllib2.build_opener()
|
||||
response = opener.open(req)
|
||||
response = opener.open(req, None, 10)
|
||||
response = response.read()
|
||||
except urllib2.URLError:
|
||||
toReturn = {'Response' : "Can't connect to minecraft.net"}
|
||||
@@ -18,6 +18,9 @@ def loginToMinecraft(username, password):
|
||||
if(response == "Bad login"):
|
||||
toReturn = {'Response' : "Incorrect username/password"}
|
||||
return toReturn
|
||||
if(response == "Account migrated, use e-mail as username."):
|
||||
toReturn = {'Response' : "Account migrated, use e-mail as username."}
|
||||
return toReturn
|
||||
response = response.split(":")
|
||||
sessionid = response[3]
|
||||
toReturn = {'Response' : "Good to go!",
|
||||
|
||||
Reference in new issue
Block a user