UNPKG

rsshub

Version:
38 lines (36 loc) 1.51 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import "./parse-date-BrP7mxXf.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./render-BQo6B4tL.mjs"; import { i as parseList, n as getItem, r as headers, t as baseUrl } from "./utils-DmlO83Ks.mjs"; //#region lib/routes/javtrailers/categories.ts const route = { path: "/categories/:category", categories: ["multimedia"], example: "/javtrailers/categories/50001755", parameters: { category: "Category name, can be found in the URL of the category page" }, radar: [{ source: ["javtrailers.com/categories/:category"] }], name: "Categories", maintainers: ["TonyRL"], url: "javtrailers.com/categories", handler, features: { nsfw: true } }; async function handler(ctx) { const { category } = ctx.req.param(); const response = await ofetch_default(`${baseUrl}/api/categories/${category}?page=0`, { headers }); const list = parseList(response.videos); const items = await Promise.all(list.map((item) => cache_default.tryGet(item.link, () => getItem(item)))); return { title: `Watch ${response.category.name} Jav Online | Japanese Adult Video - JavTrailers.com`, description: `Watch ${response.category.name} Jav video’s free, we have the largest Jav collections with high definition`, link: `${baseUrl}/categories/${category}`, item: items }; } //#endregion export { route };