UNPKG

rsshub

Version:
59 lines (57 loc) 2 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 "./parse-date-BrP7mxXf.mjs"; import "./helpers-DxBp0Pty.mjs"; import "./render-BQo6B4tL.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { t as invalid_parameter_default } from "./invalid-parameter-rr4AgGpp.mjs"; import { t as isValidHost } from "./valid-host-C-u5eW3j.mjs"; import { i as parseItems, n as getRadarDomin, r as headers } from "./utils-BTaTkcFQ.mjs"; import { load } from "cheerio"; //#region lib/routes/pornhub/model.ts const route = { path: "/model/:username/:language?/:sort?", categories: ["multimedia"], view: ViewType.Videos, example: "/pornhub/model/stacy-starando", parameters: { language: "language, see below", username: "username, part of the url e.g. `pornhub.com/model/stacy-starando`", sort: "sorting method, see below" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: true, supportBT: false, supportPodcast: false, supportScihub: false, nsfw: true }, radar: getRadarDomin("/model/:username"), name: "Model", maintainers: ["I2IMk", "queensferryme"], handler }; async function handler(ctx) { const { language = "www", username, sort = "" } = ctx.req.param(); const link = `https://${language}.pornhub.com/model/${username}/videos${sort ? `?o=${sort}` : ""}`; if (!isValidHost(language)) throw new invalid_parameter_default("Invalid language"); const { data: response } = await got_default(link, { headers }); const $ = load(response); const items = $("#mostRecentVideosSection .videoBox").toArray().map((e) => parseItems($(e))); return { title: $("h1").first().text(), description: $("section.aboutMeSection").text().trim(), link, image: $("#getAvatar").attr("src"), language: $("html").attr("lang"), item: items }; } //#endregion export { route };