add simple tokenmaker example
This commit is contained in:
parent
022ed83187
commit
801231a868
1 changed files with 20 additions and 0 deletions
20
examples/tokenmaker.py
Executable file
20
examples/tokenmaker.py
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env python
|
||||
if __name__ == "__main__":
|
||||
import json
|
||||
import asyncio
|
||||
|
||||
from getpass import getpass
|
||||
|
||||
from aiocraft.mc.auth.mojang import MojangAuthenticator
|
||||
|
||||
username = input("username > ")
|
||||
password = getpass("password > ")
|
||||
|
||||
async def main(usr, pwd):
|
||||
tok = MojangAuthenticator(username=usr, password=pwd)
|
||||
await tok.login()
|
||||
return tok
|
||||
|
||||
t = asyncio.run(main(username, password))
|
||||
|
||||
print(json.dumps(t.serialize()))
|
Loading…
Reference in a new issue