UNPKG

rsshub

Version:
64 lines (62 loc) 1.93 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import { t as ViewType } from "./types-gOySfSXJ.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import "./parse-date-r5WDWHno.mjs"; import { n as rootUrl, t as fetchCollection } from "./utils-DEJlVgab.mjs"; //#region lib/routes/newslaundry/podcast.ts const route = { path: "/podcast/:category?", view: ViewType.Articles, categories: ["new-media"], example: "/newslaundry/podcast", parameters: { category: "Podcast category, see below for details" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: true, supportScihub: false }, radar: [ { source: ["newslaundry.com/podcast"], target: "/podcast" }, { source: ["newslaundry.com/collection/nl-hafta-podcast"], target: "/podcast/nl-hafta" }, { source: ["newslaundry.com/podcast/whats-your-ism"], target: "/podcast/whats-your-ism" } ], name: "Podcast", description: `| Category | URL | | -------- | --- | | All Podcasts | [/podcast](https://rsshub.app/newslaundry/podcast) | | NL Hafta | [/podcast/nl-hafta](https://rsshub.app/newslaundry/podcast/nl-hafta) | | What's Your Ism? | [/podcast/whats-your-ism](https://rsshub.app/newslaundry/podcast/whats-your-ism) |`, maintainers: ["Rjnishant530"], handler }; async function handler(ctx) { const category = ctx.req.param("category"); const categoryMap = { "nl-hafta": { slug: "nl-hafta-podcast", url: `${rootUrl}/collection/nl-hafta-podcast` }, "whats-your-ism": { slug: "whats-your-ism-podcast-newslaundry-hindi", url: `${rootUrl}/podcast/whats-your-ism` } }; const skipFirstItem = !category; return category && categoryMap[category] ? await fetchCollection(categoryMap[category].slug, categoryMap[category].url) : await fetchCollection("podcast", void 0, skipFirstItem); } //#endregion export { route };