From 6927768e0e0bcbda102c33a5734970390b4f2c71 Mon Sep 17 00:00:00 2001 From: addstar Date: Thu, 1 Dec 2022 15:17:39 +1100 Subject: [PATCH] Use Profile API instead of deprecated Names API --- mcuuid/mcuuid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcuuid/mcuuid.py b/mcuuid/mcuuid.py index 2987a16..533551c 100644 --- a/mcuuid/mcuuid.py +++ b/mcuuid/mcuuid.py @@ -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()))