Skip to content

Instantly share code, notes, and snippets.

View jenrik's full-sized avatar
🐧

Jener Rasmussen jenrik

🐧
View GitHub Profile
@jenrik
jenrik / minecraft_login.py
Last active May 19, 2020 07:31
[DEPRECATED] Minecraft login script for Python 3. Use as you wish as long as you give me credit.
import http.client, urllib.parse, getpass
username = input("Username: ")
password = getpass.getpass(prompt='Password: ', stream=None)
params = urllib.parse.urlencode({'user': username, 'password': password, 'version': 12})
headers = {"Content-type": "application/x-www-form-urlencoded"}
conn = http.client.HTTPConnection("login.minecraft.net")
conn.request("POST", "", params, headers)
response = conn.getresponse()
print(response.status, response.reason)
data = response.read()