我试图寻找一个使用Minecraft身份验证的python脚本,并获取播放器的用户名(来自他们的电子邮件和密码)。我可以查看该帐户是否有效,但我似乎无法获得Minecraft播放器的用户名。 虽然我是Python和请求的初学者,但我可以理解一些代码
这是我目前的代码[Python 3.5]:
import fileinput
import json
import requests
import time
for line in fileinput.input(['list.txt']):
a = line
username, password = (a.strip().split(':', 1))
data = json.dumps({"agent":{"name":"Minecraft","version":1},"username":username,"password":password,"clientToken":""})
headers = {'Content-Type': 'application/json'}
rAuth = requests.post('https://authserver.mojang.com/authenticate', data=data, headers=headers)
if rAuth.status_code == 200: # This means success
print(username, password, sep=':')
else:
print("Error", rAuth.status_code) # This displays the error code
time.sleep(5) # Delay
我正在寻找一个python脚本,可以通过他们的电子邮件和密码找到Minecraft用户的用户名。如果模块要求'我想要它。使用但任何其他模块都没问题。