UNPKG

rsshub

Version:
51 lines (49 loc) 1.52 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import { t as ViewType } from "./types-D84BRIt4.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import "./helpers-DxBp0Pty.mjs"; import "./render-BQo6B4tL.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { a as renderDescription, t as defaultDomain } from "./utils-BTaTkcFQ.mjs"; //#region lib/routes/pornhub/search.ts const route = { path: "/search/:keyword", categories: ["multimedia"], view: ViewType.Videos, example: "/pornhub/search/stepsister", parameters: { keyword: "keyword" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false, nsfw: true }, name: "Keyword Search", maintainers: ["nczitzk"], handler }; async function handler(ctx) { const keyword = ctx.req.param("keyword"); const currentUrl = `${defaultDomain}/webmasters/search?search=${keyword}`; const list = (await got_default(currentUrl)).data.videos.map((item) => ({ title: item.title, link: item.url, description: renderDescription({ thumbs: item.thumbs }), pubDate: parseDate(item.publish_date), category: [...new Set([...item.tags.map((t) => t.tag_name), ...item.categories.map((c) => c.category)])] })); return { title: `Pornhub - ${keyword}`, link: currentUrl, item: list }; } //#endregion export { route };