UNPKG

rsshub

Version:
56 lines (54 loc) 1.66 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import "./render-BQo6B4tL.mjs"; import "./got-KxxWdaxq.mjs"; import { n as getOriginUrl, t as getArticleDesc } from "./utils-C-dRFGfN.mjs"; import { load } from "cheerio"; //#region lib/routes/jpxgmn/weekly.ts const route = { path: "/weekly", categories: ["picture"], example: "/jpxgmn/weekly", radar: [{ source: ["mei5.vip/"], target: "/weekly" }], name: "本周热门", maintainers: ["Urabartin"], handler, features: { nsfw: true } }; async function handler() { const response = await ofetch_default.raw(await getOriginUrl()); const baseUrl = new URL(response.url).origin; const $ = load(response._data); const items = $("aside div:nth-child(2) li").toArray().map((item) => { const fullTitle = $(item).find("a").attr("title") || ""; const result = fullTitle.match(/([^.]+)\.\D+([\d-]+)/); const ret = { title: fullTitle, link: new URL($(item).find("a").attr("href"), baseUrl).href }; if (result !== null) { ret.title = result[1]; ret.pubDate = parseDate(result[2]); } return ret; }); return { title: `极品性感美女 - 本周热门推荐`, link: response.url, item: await Promise.all(items.map((item) => cache_default.tryGet(item.link, async () => { item.description = await getArticleDesc(item.link); return item; }))) }; } //#endregion export { route };