UNPKG

rsshub

Version:
43 lines (41 loc) 1.2 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import "./md5-C8GRvctM.mjs"; import "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import "./got-KxxWdaxq.mjs"; import "./config-not-found-Dyp3RlZZ.mjs"; import { n as getMangaDetails } from "./_feed-Dvn7_0BR.mjs"; //#region lib/routes/mangadex/index.ts const route = { path: "/manga/:id/:lang?", radar: [{ source: ["mangadex.org/title/:id/:suffix", "mangadex.org/title/:id"], target: "/manga/:id" }], name: "Single Manga Feed", maintainers: ["vzz64", "chrisis58"], example: "/mangadex/manga/f98660a1-d2e2-461c-960d-7bd13df8b76d/en", handler, features: { nsfw: true } }; async function handler(ctx) { const { id, lang } = ctx.req.param(); const mangaDetail = await getMangaDetails(id, lang); return { title: mangaDetail.title, link: `https://mangadex.org/title/${id}`, description: mangaDetail.description, item: mangaDetail.chapters.map((chapter) => ({ title: chapter.title, link: chapter.link, pubDate: chapter.pubDate, image: mangaDetail.cover })) }; } //#endregion export { route };