rsshub
Version:
Make RSS Great Again!
61 lines (59 loc) • 1.84 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 "./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/master.ts
const route = {
path: "/master/:channel",
categories: ["traditional-media"],
example: "/cw/master/8",
parameters: { channel: "主頻道 ID,可在 URL 中找到" },
features: {
requireConfig: false,
requirePuppeteer: true,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "主頻道",
maintainers: ["TonyRL"],
handler,
description: `| 主頻道名稱 | 主頻道 ID |
| ---------- | --------- |
| 財經 | 8 |
| 產業 | 7 |
| 國際 | 9 |
| 管理 | 10 |
| 環境 | 12 |
| 教育 | 13 |
| 人物 | 14 |
| 政治社會 | 77 |
| 調查排行 | 15 |
| 健康關係 | 79 |
| 時尚品味 | 11 |
| 運動生活 | 103 |
| 重磅外媒 | 16 |`
};
async function handler(ctx) {
const browser = await puppeteer_default();
const { $, items } = await parsePage("master", browser, ctx);
await browser.close();
return {
title: $("head title").text(),
description: $("meta[name=description]").attr("content"),
link: `${baseUrl}/masterChannel.action?idMasterChannel=${ctx.req.param("channel")}`,
image: `${baseUrl}/assets_new/img/fbshare.jpg`,
language: $("meta[property=\"og:locale\"]").attr("content"),
item: items
};
}
//#endregion
export { route };