package mc import ( "encoding/base64" "encoding/json" ) //DownloadSkin is exported function func (mc *Handler) DownloadSkin() { resp := httpReq("https://sessionserver.mojang.com/session/minecraft/profile/" + mc.UUID) var profileArray profile json.Unmarshal(resp, &profileArray) decoded, _ := base64.URLEncoding.DecodeString(profileArray.Properties[0].Value) var textureArray texture json.Unmarshal([]byte(decoded), &textureArray) downloadFile(mc.savePath+"/"+mc.UUID+".png", textureArray.Textures.SKIN.URL) }