rsshub
Version:
Make RSS Great Again!
81 lines (79 loc) • 2.53 kB
JavaScript
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import { t as cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import "./config-not-found-Dyp3RlZZ.mjs";
import { t as domainValidation } from "./utils-Dffws7oF.mjs";
import path from "node:path";
import { load } from "cheerio";
//#region lib/routes/91porn/author.ts
init_esm_shims();
const route = {
path: "/author/:uid/:lang?",
categories: ["multimedia"],
example: "/91porn/author/2d6d2iWm4vVCwqujAZbSrKt2QJCbbaObv9HQ21Zo8wGJWudWBg",
parameters: {
uid: "Author ID, can be found in URL",
lang: "Language, see above, `en_US` by default "
},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: true,
supportBT: false,
supportPodcast: false,
supportScihub: false,
nsfw: true
},
radar: [{
source: ["91porn.com/index.php"],
target: ""
}],
name: "Author",
maintainers: ["TonyRL"],
handler,
url: "91porn.com/index.php"
};
async function handler(ctx) {
const { domain = "91porn.com" } = ctx.req.query();
const { uid, lang = "en_US" } = ctx.req.param();
const siteUrl = `https://${domain}/uvideos.php?UID=${uid}&type=public`;
domainValidation(domain);
const $ = load((await got_default.post(siteUrl, {
form: { session_language: lang },
headers: { referer: siteUrl }
})).data);
let items = $(".row .well").toArray().map((item) => {
item = $(item);
return {
title: item.find(".video-title").text(),
link: item.find("a").attr("href"),
poster: item.find(".img-responsive").attr("src")
};
});
items = await Promise.all(items.map((item) => cache_default.tryGet(`91porn:${lang}:${new URL(item.link).searchParams.get("viewkey")}`, async () => {
const { data } = await got_default(item.link);
const $$1 = load(data);
item.pubDate = parseDate($$1(".title-yakov").eq(0).text(), "YYYY-MM-DD");
item.description = art(path.join(__dirname, "templates/index-234d0e45.art"), {
link: item.link,
poster: item.poster
});
item.author = $$1(".title-yakov a span").text();
delete item.poster;
return item;
})));
return {
title: `${$(".login_register_header").text()} - 91porn`,
link: siteUrl,
item: items
};
}
//#endregion
export { route };