diff --git a/scripts/test-cf.ts b/scripts/test-cf.ts deleted file mode 100644 index 5053dc403b..0000000000 --- a/scripts/test-cf.ts +++ /dev/null @@ -1,231 +0,0 @@ -import { writeFileSync } from "node:fs"; -import puppeteer from "puppeteer-extra"; -import StealthPlugin from "puppeteer-extra-plugin-stealth"; - -puppeteer.use(StealthPlugin()); - -const UA = - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " + - "AppleWebKit/537.36 (KHTML, like Gecko) " + - "Chrome/120.0.0.0 Safari/537.36"; - -interface CloneSource { - id: string; - name: string; - furnidataUrl: string; - nitroBaseUrl: string; - iconBaseUrl: string; -} - -const sources: CloneSource[] = [ - { - id: "default-habbo", - name: "Habbo", - furnidataUrl: - "https://raw.githubusercontent.com/Izzxt/habbo-resource/master/gamedata/furnidata.json", - nitroBaseUrl: "", - iconBaseUrl: "", - }, - { - id: "default-wibbo", - name: "Wibbo", - furnidataUrl: "https://assets.wibbo.org/gamedata/FurnitureData.json", - nitroBaseUrl: "https://assets.wibbo.org/bundled/furniture", - iconBaseUrl: "https://assets.wibbo.org/icons", - }, - { - id: "default-hubba", - name: "Hubba.cc", - furnidataUrl: "https://nitro.hubba.cc/gamedata/FurnitureData.json", - nitroBaseUrl: "https://nitro.hubba.cc/bundled/furniture", - iconBaseUrl: "", - }, - { - id: "default-leet", - name: "Leet", - furnidataUrl: "https://www.leet.ws/gamedata/furnidata.json", - nitroBaseUrl: "https://www.leet.ws/nitro/bundled/furniture", - iconBaseUrl: "https://www.leet.ws/nitro/icons", - }, - { - id: "default-hubbly", - name: "Hubbly", - furnidataUrl: "https://www.hubbly.pw/gamedata/furnidata.json", - nitroBaseUrl: "https://www.hubbly.pw/nitro/bundled/furniture", - iconBaseUrl: "https://www.hubbly.pw/nitro/icons", - }, - { - id: "default-habbaio", - name: "Habba.io", - furnidataUrl: "https://habba.io/gamedata/furnidata.json", - nitroBaseUrl: "https://habba.io/nitro/bundled/furniture", - iconBaseUrl: "https://habba.io/nitro/icons", - }, - { - id: "default-habheights", - name: "Hab Heights", - furnidataUrl: "https://habheights.online/gamedata/furnidata.json", - nitroBaseUrl: "https://habheights.online/nitro/bundled/furniture", - iconBaseUrl: "https://habheights.online/nitro/icons", - }, - { - id: "default-sodaho", - name: "Soda Ho", - furnidataUrl: "https://assets.sodaho.tel/gamedata/FurnitureData.json", - nitroBaseUrl: "https://sodaho.tel/nitro/bundled/furniture", - iconBaseUrl: "https://sodaho.tel/nitro/icons", - }, - { - id: "default-habstar", - name: "Hab Star", - furnidataUrl: "https://habstar.nu/gamedata/furnidata.json", - nitroBaseUrl: "https://habstar.nu/nitro/bundled/furniture", - iconBaseUrl: "https://habstar.nu/nitro/icons", - }, - { - id: "default-freshhotel", - name: "Fresh Hotel", - furnidataUrl: "https://fresh-hotel.org/gamedata/furnidata.json", - nitroBaseUrl: "https://fresh-hotel.org/nitro/bundled/furniture", - iconBaseUrl: "https://fresh-hotel.org/nitro/icons", - }, - { - id: "default-habcrush", - name: "Hab Crush", - furnidataUrl: "https://habcrush.pw/gamedata/furnidata.json", - nitroBaseUrl: "https://habcrush.pw/nitro/bundled/furniture", - iconBaseUrl: "https://habcrush.pw/nitro/icons", - }, - { - id: "default-zento", - name: "Zento", - furnidataUrl: "https://zento.wtf/gamedata/furnidata.json", - nitroBaseUrl: "https://zento.wtf/nitro/bundled/furniture", - iconBaseUrl: "https://zento.wtf/nitro/icons", - }, - { - id: "default-habhub", - name: "Hab Hub", - furnidataUrl: "https://habhub.life/gamedata/furnidata.json", - nitroBaseUrl: "https://habhub.life/nitro/bundled/furniture", - iconBaseUrl: "https://habhub.life/nitro/icons", - }, - { - id: "default-fobba", - name: "Fobba", - furnidataUrl: "https://fobba.net/gamedata/furnidata.json", - nitroBaseUrl: "https://fobba.net/nitro/bundled/furniture", - iconBaseUrl: "https://fobba.net/nitro/icons", - }, - { - id: "default-playaura", - name: "Play Aura", - furnidataUrl: "https://playaura.net/gamedata/furnidata.json", - nitroBaseUrl: "https://playaura.net/nitro/bundled/furniture", - iconBaseUrl: "https://playaura.net/nitro/icons", - }, - { - id: "default-hablet", - name: "Hablet", - furnidataUrl: "https://hablet.pw/gamedata/furnidata.json", - nitroBaseUrl: "https://hablet.pw/nitro/bundled/furniture", - iconBaseUrl: "https://hablet.pw/nitro/icons", - }, - { - id: "default-eclipsehotel", - name: "Eclipse Hotel", - furnidataUrl: "https://eclipsehotel.me/gamedata/furnidata.json", - nitroBaseUrl: "https://eclipsehotel.me/nitro/bundled/furniture", - iconBaseUrl: "https://eclipsehotel.me/nitro/icons", - }, - { - id: "default-habbletcity", - 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", - }, - { - id: "default-habbocity", - name: "Habbo City", - furnidataUrl: "https://habbocity.fr/gamedata/furnidata.json", - nitroBaseUrl: "https://habbocity.fr/nitro/bundled/furniture", - iconBaseUrl: "https://habbocity.fr/nitro/icons", - }, -]; - -async function testUrl( - page: any, - url: string, -): Promise<{ status: number; blocked: boolean }> { - try { - const response = await page.goto(url, { - waitUntil: "networkidle2", - timeout: 15000, - }); - const status = response?.status() ?? 0; - const body = await page.content(); - - const blocked = - body.includes("Attention Required") || - body.includes("Checking your browser") || - body.includes("Just a moment"); - return { status, blocked }; - } catch (e: any) { - return { status: 0, blocked: true }; - } -} - -async function main() { - const browser = await puppeteer.launch({ - headless: true, - args: [ - "--no-sandbox", - "--disable-setuid-sandbox", - "--disable-web-security", - "--disable-blink-features=AutomationControlled", - "--user-agent=" + UA, - ], - }); - - const results: Record = {}; - - for (const src of sources) { - const page = await browser.newPage(); - await page.setUserAgent(UA); - - const entry: any = { name: src.name }; - const tests: { url: string; status: number; blocked: boolean }[] = []; - - const urls = [ - src.furnidataUrl, - src.nitroBaseUrl ? `${src.nitroBaseUrl}` : null, - src.iconBaseUrl ? `${src.iconBaseUrl}` : null, - ].filter((u): u is string => !!u && u.length > 0); - - for (const url of urls) { - if (!url) continue; - const result = await testUrl(page, url); - tests.push({ url, ...result }); - } - - entry.tests = tests; - entry.working = tests.some((t) => t.status === 200 && !t.blocked); - results[src.id] = entry; - - console.log( - `${entry.working ? "✓" : "❌"} ${src.name}` + - (tests.length > 0 - ? `: ${tests.map((t) => `${t.status}${t.blocked ? "B" : ""}`).join(" ")}` - : " (no URLs)"), - ); - - await page.close(); - } - - await browser.close(); - writeFileSync("/tmp/clone-test.json", JSON.stringify(results, null, 2)); - console.log("\nResults written to /tmp/clone-test.json"); -} - -void main().catch(console.error);