rsshub
Version:
Make RSS Great Again!
66 lines (64 loc) • 2 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import { t as ViewType } from "./types-D84BRIt4.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./parse-date-BrP7mxXf.mjs";
import "./render-BQo6B4tL.mjs";
import { n as rootUrl, t as fetchCollection } from "./utils-BaF1fRPi.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 };