rsshub
Version:
Make RSS Great Again!
52 lines (50 loc) • 1.4 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./parse-date-BrP7mxXf.mjs";
import { t as cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { n as SUB_URL, r as article_default, t as SUB_NAME_PREFIX } from "./const-BwtCFg-9.mjs";
import { load } from "cheerio";
//#region lib/routes/baobua/latest.ts
const route = {
path: "/",
categories: ["picture"],
example: "/baobua",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{
source: ["baobua.com/"],
target: ""
}],
name: "Latest",
maintainers: ["AiraNadih"],
handler,
url: "baobua.com/"
};
async function handler() {
const $ = load((await got_default(SUB_URL)).body);
const itemRaw = $(".thcovering-video").toArray();
return {
title: `${SUB_NAME_PREFIX} - Latest`,
link: SUB_URL,
item: await Promise.all(itemRaw.map((e) => {
let link = $(e).find("a").attr("href");
if (!link) return null;
if (link.startsWith("/")) link = new URL(link, SUB_URL).href;
return cache_default.tryGet(link, () => article_default(link));
}).filter(Boolean))
};
}
//#endregion
export { route };