从Mojang API获取Minecraft玩家信息。
mcuuid的Python项目详细描述
mcuuid
从Mojang API获取Minecraft玩家信息
用法
pip install mcuuid
- 使用如下模块:
api
from mcuuid.api import GetPlayerData
player = GetPlayerData(identifier)
if player.valid is True:
uuid = player.uuid
name = player.username
标识符可以是用户名或uuid。
当identifier = "gronkh"
时:
uuid
将是"a2080281c2784181b961d99ed2f3347c"
而name
将是"Gronkh"
player = GetPlayerData(identifier, timestamp)
有些名字是时间敏感的。(更改时) 所以你可以选择一个特殊的时间
它甚至可以和uuid一起工作他们在给定的时间响应用户名
工具
用户名的语法检查
from mcuuid.tools import is_valid_minecraft_username
if is_valid_minecraft_username('gronkh'):
print('Valid')
UUID的综合检查
from mcuuid.tools import is_valid_mojang_uuid
if is_valid_mojang_uuid('a2080281c2784181b961d99ed2f3347c'):
print('Valid')
测试文件
用法
$ python test.py gronkh
或
$ python test.py a2080281c2784181b961d99ed2f3347c
或
$ python test.py
Please enter a username or UUID:
gronkh
或
$ python test.py
Please enter a username or UUID:
a2080281c2784181b961d99ed2f3347c
响应:
UUID: a2080281c2784181b961d99ed2f3347c
correct name: Gronkh
许可证
这个软件是根据麻省理工学院的许可证授权的你想怎么用就怎么用