UNPKG

rsshub

Version:
49 lines (47 loc) 1.45 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import { t as ViewType } from "./types-gOySfSXJ.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import "./helpers-Bo4JQYdN.mjs"; import { t as got_default } from "./got-CO-ndVl2.mjs"; import { a as renderDescription, t as defaultDomain } from "./utils-D1hBzcqc.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 };