From 9bcc6aeb8f00287f1005e046bb702baff2b5c821 Mon Sep 17 00:00:00 2001 From: Tim203 Date: Wed, 20 Nov 2024 13:06:18 +0100 Subject: [PATCH] Apparently the texture can now be http or https, instead of just http --- lib/global_api/skins/skin_uploader.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/global_api/skins/skin_uploader.ex b/lib/global_api/skins/skin_uploader.ex index a3ca1b7..13cdd65 100644 --- a/lib/global_api/skins/skin_uploader.ex +++ b/lib/global_api/skins/skin_uploader.ex @@ -83,8 +83,8 @@ defmodule GlobalApi.SkinUploader do texture_data = body["data"]["texture"] texture_id = texture_data["url"] - # http://textures.minecraft.net/texture/ = 38 chars long - texture_id = String.slice(texture_id, 38, String.length(texture_id) - 38) + # can vary now between http and https, so we just grab the last section + texture_id = String.split(texture_id, "/", trim: true) |> List.last() skin_value = texture_data["value"] skin_signature = texture_data["signature"]