UNPKG

rsshub

Version:
54 lines (52 loc) 1.6 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 cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import "./got-KxxWdaxq.mjs"; import "./timezone-D8cuwzTY.mjs"; import { t as ehapi_default } from "./ehapi-DNsvkGqI.mjs"; //#region lib/routes/ehentai/tag.ts const route = { path: "/tag/:tag/:page?/:routeParams?", categories: ["picture"], example: "/ehentai/tag/language:chinese/0/bittorrent=true&embed_thumb=false", parameters: { tag: "Tag", page: "Page number, set 0 to get latest", routeParams: "Additional parameters, see the table above" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: true, supportBT: true, supportPodcast: false, supportScihub: false, nsfw: true }, name: "Tag", maintainers: ["yindaheng98", "syrinka"], handler }; async function handler(ctx) { const page = ctx.req.param("page"); const tag = ctx.req.param("tag"); const routeParams = new URLSearchParams(ctx.req.param("routeParams")); const bittorrent = routeParams.get("bittorrent") || false; const embed_thumb = routeParams.get("embed_thumb") || false; const items = await ehapi_default.getTagItems(cache_default, tag, page, bittorrent, embed_thumb); return ehapi_default.from_ex ? { title: tag + " - ExHentai Tag", link: `https://exhentai.org/tag/${tag}`, item: items } : { title: tag + " - E-Hentai Tag", link: `https://e-hentai.org/tag/${tag}`, item: items }; } //#endregion export { route };