rsshub
Version:
Make RSS Great Again!
46 lines (45 loc) • 1.26 kB
JavaScript
import "./types-DNj6Etbg.mjs";
import { p as getDataByPlaylistId, t as callApi } from "./utils-BqHLZDl4.mjs";
import { n as getDataByPlaylistId$1 } from "./youtubei-BxoJJr-j.mjs";
//#region lib/routes/youtube/playlist.ts
const route = {
path: "/playlist/:id/:embed?",
categories: ["social-media"],
view: 3,
example: "/youtube/playlist/PLqQ1RwlxOgeLTJ1f3fNMSwhjVgaWKo_9Z",
parameters: {
id: "YouTube playlist id",
embed: "Default to embed the video, set to any value to disable embedding"
},
features: {
requireConfig: [{
name: "YOUTUBE_KEY",
description: " YouTube API Key, support multiple keys, split them with `,`, [API Key application](https://console.developers.google.com/)",
optional: true
}],
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "Playlist",
maintainers: ["HenryQW"],
handler
};
async function handler(ctx) {
const id = ctx.req.param("id");
const embed = !ctx.req.param("embed");
const isJsonFeed = ctx.req.query("format") === "json";
return await callApi({
googleApi: getDataByPlaylistId,
youtubeiApi: getDataByPlaylistId$1,
params: {
playlistId: id,
embed,
isJsonFeed
}
});
}
//#endregion
export { route };