Added verified working retro hotel sources from VindRetros.nl: - YabboHotel: 52,663 room + 707 wall items furnidata (no nitro/icons yet) - Habblet City: full furnidata + nitro + icons (all working) Removed offline/unreachable sources: - Leet.city (Cloudflare challenge - 403 blocked) - Hubbly (404 - site restructured) - Duplicate entries (Classic, Original, Retro, GitHub mirror duplicates) - All unreachable hotel domains (CH, NO, PT, JP, KR, SE, DK, PL, RU, SG, MX) - CDN subdomains (assets.habbo.com, cdn.habbo.com - DNS unresolvable) Final: 13 verified working sources with 200 status furnidata: - 9 official Habbo hotels (COM, NL, DE, FR, ES, FI, BR, TR, IT) - 3 retro sources (YabboHotel, Wibbo, Hubba.cc) - 1 full retro source with nitro/icons (Habblet City)
175 lines
4.4 KiB
TypeScript
175 lines
4.4 KiB
TypeScript
import { randomUUID } from "node:crypto";
|
|
import { siteSettings } from "@/lib/services/site-settings";
|
|
|
|
export interface CloneSource {
|
|
id: string;
|
|
name: string;
|
|
furnidataUrl: string;
|
|
nitroBaseUrl: string;
|
|
iconBaseUrl: string;
|
|
hotel: string;
|
|
}
|
|
|
|
const KEY = "clone_sources";
|
|
|
|
/**
|
|
* Verified sources. Used as the default list and as the fallback when the
|
|
* `clone_sources` site setting is empty.
|
|
*
|
|
* Furnidata URLs verified HTTP 200 on 2026-08-06.
|
|
* Retro sources using Cloudflare may require browser-like headers on fetch.
|
|
*/
|
|
export const DEFAULT_SOURCES: CloneSource[] = [
|
|
{
|
|
id: "default-habbo-com",
|
|
name: "Habbo (COM)",
|
|
furnidataUrl: "https://www.habbo.com/gamedata/furnidata_json/1",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "com",
|
|
},
|
|
{
|
|
id: "default-habbo-nl",
|
|
name: "Habbo (NL)",
|
|
furnidataUrl: "https://www.habbo.nl/gamedata/furnidata_json/1",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "nl",
|
|
},
|
|
{
|
|
id: "default-habbo-de",
|
|
name: "Habbo (DE)",
|
|
furnidataUrl: "https://www.habbo.de/gamedata/furnidata_json/1",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "de",
|
|
},
|
|
{
|
|
id: "default-habbo-fr",
|
|
name: "Habbo (FR)",
|
|
furnidataUrl: "https://www.habbo.fr/gamedata/furnidata_json/1",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "fr",
|
|
},
|
|
{
|
|
id: "default-habbo-es",
|
|
name: "Habbo (ES)",
|
|
furnidataUrl: "https://www.habbo.es/gamedata/furnidata_json/1",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "es",
|
|
},
|
|
{
|
|
id: "default-habbo-fi",
|
|
name: "Habbo (FI)",
|
|
furnidataUrl: "https://www.habbo.fi/gamedata/furnidata_json/1",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "fi",
|
|
},
|
|
{
|
|
id: "default-habbo-br",
|
|
name: "Habbo (BR)",
|
|
furnidataUrl: "https://www.habbo.com.br/gamedata/furnidata_json/1",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "com.br",
|
|
},
|
|
{
|
|
id: "default-habbo-tr",
|
|
name: "Habbo (TR)",
|
|
furnidataUrl: "https://www.habbo.com.tr/gamedata/furnidata_json/1",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "com.tr",
|
|
},
|
|
{
|
|
id: "default-habbo-it",
|
|
name: "Habbo (IT - GitHub mirror)",
|
|
furnidataUrl:
|
|
"https://raw.githubusercontent.com/Izzxt/habbo-resource/master/gamedata/furnidata.json",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "it",
|
|
},
|
|
{
|
|
id: "default-yabbohotel",
|
|
name: "YabboHotel",
|
|
furnidataUrl: "https://yabbohotel.com/gamedata/FurnitureData.json",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "com",
|
|
},
|
|
{
|
|
id: "default-wibbo",
|
|
name: "Wibbo",
|
|
furnidataUrl: "https://assets.wibbo.org/gamedata/FurnitureData.json",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "com",
|
|
},
|
|
{
|
|
id: "default-hubba",
|
|
name: "Hubba.cc",
|
|
furnidataUrl: "https://nitro.hubba.cc/gamedata/FurnitureData.json",
|
|
nitroBaseUrl: "",
|
|
iconBaseUrl: "",
|
|
hotel: "com",
|
|
},
|
|
{
|
|
id: "default-habblet-city",
|
|
name: "Habblet City",
|
|
furnidataUrl: "https://www.habblet.city/gamedata/furnidata.json",
|
|
nitroBaseUrl: "https://www.habblet.city/nitro/bundled/furniture",
|
|
iconBaseUrl: "https://www.habblet.city/nitro/icons",
|
|
hotel: "com",
|
|
},
|
|
];
|
|
|
|
export const DEFAULT_ICON_SOURCES: CloneSource[] = DEFAULT_SOURCES.filter(
|
|
(s) => s.iconBaseUrl,
|
|
);
|
|
|
|
export const DEFAULT_NITRO_SOURCES: CloneSource[] = DEFAULT_SOURCES.filter(
|
|
(s) => s.nitroBaseUrl,
|
|
);
|
|
|
|
export async function listSources(): Promise<CloneSource[]> {
|
|
const raw = (await siteSettings.get(KEY, "[]")) ?? "[]";
|
|
try {
|
|
const arr = JSON.parse(raw);
|
|
return Array.isArray(arr) && arr.length > 0 ? arr : DEFAULT_SOURCES;
|
|
} catch {
|
|
return DEFAULT_SOURCES;
|
|
}
|
|
}
|
|
|
|
export async function upsertSource(
|
|
src: Omit<CloneSource, "id"> & { id?: string },
|
|
): Promise<CloneSource> {
|
|
const sources = await listSources();
|
|
const entry: CloneSource = {
|
|
id: src.id || randomUUID(),
|
|
name: src.name.trim(),
|
|
furnidataUrl: src.furnidataUrl.trim(),
|
|
nitroBaseUrl: src.nitroBaseUrl.trim().replace(/\/+$/, ""),
|
|
iconBaseUrl: src.iconBaseUrl.trim().replace(/\/+$/, ""),
|
|
hotel: (src.hotel ?? "").trim(),
|
|
};
|
|
const idx = sources.findIndex((s) => s.id === entry.id);
|
|
if (idx >= 0) sources[idx] = entry;
|
|
else sources.push(entry);
|
|
await siteSettings.update(KEY, JSON.stringify(sources));
|
|
return entry;
|
|
}
|
|
|
|
export async function deleteSource(id: string): Promise<void> {
|
|
const sources = (await listSources()).filter((s) => s.id !== id);
|
|
await siteSettings.update(KEY, JSON.stringify(sources));
|
|
}
|
|
|
|
export async function getSource(id: string): Promise<CloneSource | null> {
|
|
return (await listSources()).find((s) => s.id === id) ?? null;
|
|
}
|