UNPKG

rsshub

Version:
46 lines (44 loc) 1.47 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import "./cache-Bo__VnGm.mjs"; import "./render-BQo6B4tL.mjs"; import { i as renderVideo, t as getMylist } from "./utils-CZH2BSR1.mjs"; //#region lib/routes/nicovideo/mylist.ts const route = { name: "Mylist", path: "/mylist/:id", parameters: { id: "Mylist ID" }, example: "/nicovideo/mylist/2973737", maintainers: ["esperecyan"], radar: [{ source: ["www.nicovideo.jp/user/:user/mylist/:id"], target: "/mylist/:id" }], handler: async (ctx) => { const { id } = ctx.req.param(); const mylist = await getMylist(id); return { title: `マイリスト ${mylist.name}‐ニコニコ動画`, link: `https://www.nicovideo.jp/user/${mylist.owner.id}/mylist/${mylist.id}`, language: "ja", item: mylist.items.map((item) => ({ title: item.video.title, link: `https://www.nicovideo.jp/watch/${item.video.id}`, pubDate: parseDate(item.addedAt), author: [{ name: item.video.owner.name, avatar: item.video.owner.iconUrl, url: `https://www.nicovideo.jp/user/${item.video.owner.id}` }], description: renderVideo(item.video, false), image: item.video.thumbnail.nHdUrl ?? item.video.thumbnail.largeUrl ?? item.video.thumbnail.middleUrl ?? void 0 })) }; } }; //#endregion export { route };