UNPKG

rsshub

Version:
17 lines (16 loc) 665 B
import { n as outPlaywright } from "./playwright-o20DiLNh.mjs"; //#region lib/routes/alternativeto/utils.ts const baseURL = "https://alternativeto.net"; const playwrightGet = (url, cache) => cache.tryGet(url, async () => { const context = await outPlaywright(); const page = await context.newPage(); await page.route("**/*", (route) => { route.request().resourceType() === "document" ? route.continue() : route.abort(); }); await page.goto(url, { waitUntil: "domcontentloaded" }); const html = await page.evaluate(() => document.documentElement.getHTML()); await context.close(); return html; }); //#endregion export { playwrightGet as n, baseURL as t };