mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2025-07-12 20:30:24 +02:00
Replace skinsdb API source (#91)
The old API is no longer reachable, thus got replaced. This also removes the obsolete skin preview download because the mod is capable of generating them automatically. Co-authored-by: CallMeDax <142984237+CallMeDax@users.noreply.github.com>
This commit is contained in:
@ -47,9 +47,8 @@ if #internal.errors > 0 then
|
||||
end
|
||||
|
||||
-- http://minetest.fensta.bplaced.net/api/apidoku.md
|
||||
local root_url = "http://minetest.fensta.bplaced.net"
|
||||
local page_url = root_url .. "/api/v2/get.json.php?getlist&page=%i&outformat=base64" -- [1] = Page#
|
||||
local preview_url = root_url .. "/skins/1/%i.png" -- [1] = ID
|
||||
local root_url = "http://skinsdb.terraqueststudios.net"
|
||||
local page_url = root_url .. "/api/v1/content?client=mod&page=%i" -- [1] = Page#
|
||||
|
||||
local mod_path = skins.modpath
|
||||
local meta_path = mod_path .. "/meta/"
|
||||
@ -100,9 +99,6 @@ local function safe_single_skin(skin)
|
||||
skins_path .. name .. ".png",
|
||||
core.decode_base64(skin.img)
|
||||
)
|
||||
fetch_url(preview_url:format(skin.id), function(preview)
|
||||
unsafe_file_write(skins_path .. name .. skins.fsep .. "preview.png", preview)
|
||||
end)
|
||||
core.log("action", ("%s: Completed skin %s"):format(_ID_, name))
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user