Skip to content

Commit

Permalink
Merge pull request #3 from AddstarMC/master
Browse files Browse the repository at this point in the history
Use Profile API instead of deprecated Names API
  • Loading branch information
clerie authored Dec 11, 2022
2 parents 6e78fe7 + 6927768 commit 9b1d7ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mcuuid/mcuuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def _load_by_name(self):

def _load_by_uuid(self):
if self._names == None:
r = requests.get("https://api.mojang.com/user/profiles/{uuid}/names".format(
r = requests.get("https://sessionserver.mojang.com/session/minecraft/profile/{uuid}".format(
uuid=self._uuid,
), headers = {
'Content-Type':'application/json',
})
data = json.loads(r.text)
self._names = {d.get("changedToAt", 0): d.get("name") for d in data}
self._names = {0: data.get("name")}
self._pretty_name = self._names.get(max(self._names.keys()))

0 comments on commit 9b1d7ee

Please sign in to comment.