UNPKG

rsshub

Version:
46 lines (44 loc) 1.77 kB
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 { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import { t as art } from "./render-BQo6B4tL.mjs"; import path from "node:path"; //#region lib/routes/manyvids/video.ts init_esm_shims(); const route = { path: "/profile/vids/:uid", radar: [{ source: ["www.manyvids.com/Profile/:uid/:handle/Store/*", "www.manyvids.com/Profile/:uid/:handle/Store"] }], parameters: { uid: "User ID, can be found in the URL." }, name: "Creator Videos", example: "/manyvids/profile/vids/1001213004", maintainers: ["TonyRL"], handler, features: { nsfw: true } }; const getProfileById = (uid) => cache_default.tryGet(`manyvids:profile:${uid}`, () => ofetch_default(`https://www.manyvids.com/bff/profile/profiles/${uid}`)); const render = (data) => art(path.join(__dirname, "templates/video-8846fe11.art"), data); async function handler(ctx) { const { uid } = ctx.req.param(); const profile = await getProfileById(uid); const items = (await ofetch_default(`https://www.manyvids.com/bff/store/videos/${uid}/`, { query: { page: 1 } })).data.map((v) => ({ title: v.title, link: `https://www.manyvids.com/Video/${v.id}/${v.slug}`, author: v.creator.stageName, description: render({ poster: v.thumbnail.url, src: v.preview.url }) })); return { title: `${profile.displayName}'s Profile - Porn vids, Pics & More | ManyVids - ManyVids`, link: `https://www.manyvids.com/Profile/${uid}/${profile.urlHandle}/Store/Videos`, image: profile.avatar, description: profile.bio, item: items }; } //#endregion export { route };