rsshub
Version:
Make RSS Great Again!
49 lines (47 loc) • 1.38 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 "./helpers-DxBp0Pty.mjs";
import "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { i as api_key_default, r as handleMovieItem } from "./utils-CQz8GZS-.mjs";
//#region lib/routes/themoviedb/collection.ts
const route = {
path: "/collection/:id/:lang?",
categories: ["multimedia"],
example: "/themoviedb/collection/131292/en-US",
parameters: {
id: "Collection ID",
lang: "Language"
},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "Collection",
maintainers: ["x2cf"],
handler
};
async function handler(ctx) {
const { id, lang } = ctx.req.param();
const { data } = await got_default(`https://api.themoviedb.org/3/collection/${id}`, { searchParams: {
language: lang,
api_key: api_key_default()
} });
return {
title: `${data.name} — TMDB`,
description: data.overview.trim(),
image: `https://image.tmdb.org/t/p/original${data.poster_path}`,
link: `https://www.themoviedb.org/collection/${data.id}`,
item: data.parts.map((item) => handleMovieItem(item, lang))
};
}
//#endregion
export { route };