UNPKG

rsshub

Version:
47 lines (45 loc) 1.41 kB
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 "./cache-Bo__VnGm.mjs"; import "./proxy-Db7uGcYb.mjs"; import { n as puppeteer_default } from "./puppeteer-DGmvuGvT.mjs"; import "./puppeteer-utils-BK3JC9qW.mjs"; import { n as parsePage, t as baseUrl } from "./utils-CfsEaO4D.mjs"; //#region lib/routes/cw/author.ts const route = { path: "/author/:channel", categories: ["traditional-media"], example: "/cw/author/57", parameters: { channel: "作者 ID,可在 URL 中找到" }, features: { requireConfig: false, requirePuppeteer: true, antiCrawler: true, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["cw.com.tw/author/:channel"] }], name: "作者", maintainers: ["TonyRL"], handler }; async function handler(ctx) { const browser = await puppeteer_default(); const { $, items } = await parsePage("author", browser, ctx); await browser.close(); return { title: $("head title").text(), description: $(".authorTxt").text(), link: `${baseUrl}/author/${ctx.req.param("channel")}`, image: $(".authorPhoto img").attr("src") || `${baseUrl}/assets_new/img/fbshare.jpg'`, language: $("meta[property=\"og:locale\"]").attr("content"), item: items }; } //#endregion export { route };