-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import type { Namespace } from '@/types'; | ||
|
||
export const namespace: Namespace = { | ||
name: 'Unknown', | ||
name: 'MangaDex', | ||
url: 'mangadex.org', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { Namespace } from '@/types'; | ||
|
||
export const namespace: Namespace = { | ||
name: 'ManyVids', | ||
url: 'www.manyvids.com', | ||
categories: ['multimedia'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<video controls preload="metadata" poster="{{ poster }}"> | ||
<source src="{{ src }}" type="video/mp4"> | ||
</video> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
export interface UserProfile { | ||
createdAt: string; | ||
displayName: string; | ||
profileId: string; | ||
urlHandle: string; | ||
userId: string; | ||
legacyUserId: string; | ||
userStatus: string; | ||
userType: string; | ||
avatar: string; | ||
bio: string; | ||
description: string; | ||
dob: string; | ||
identification: string; | ||
location: string; | ||
orientation: string; | ||
currentRank: number; | ||
bodyType: string; | ||
hairColor: string; | ||
ethnicity: string; | ||
poAddress: string; | ||
poCity: string; | ||
poName: string; | ||
poZip: string; | ||
portrait: string; | ||
shortLinkUrl: string; | ||
profession: string; | ||
socLnkFacebook: string; | ||
socLnkInstagram: string; | ||
socLnkReddit: string; | ||
socLnkTwitter: string; | ||
socLnkYoutube: string; | ||
profileType: string; | ||
hasPremiumMembership: boolean; | ||
} | ||
|
||
interface Avatar { | ||
url: string; | ||
} | ||
|
||
interface Creator { | ||
id: string; | ||
slug: string; | ||
stageName: string; | ||
avatar: Avatar; | ||
} | ||
|
||
interface Thumbnail { | ||
url: string; | ||
} | ||
|
||
interface Preview { | ||
url: string; | ||
} | ||
|
||
interface Price { | ||
free: boolean; | ||
onSale: boolean; | ||
regular: string; | ||
} | ||
|
||
interface Video { | ||
id: string; | ||
title: string; | ||
slug: string; | ||
duration: string; | ||
creator: Creator; | ||
thumbnail: Thumbnail; | ||
preview: Preview; | ||
price: Price; | ||
likes: number; | ||
views: number; | ||
type: string; | ||
} | ||
|
||
interface Pagination { | ||
total: number; | ||
totalWithoutFilters: number; | ||
currentPage: number; | ||
totalPages: number; | ||
nextPage: number; | ||
} | ||
|
||
export interface Videos { | ||
statusCode: number; | ||
statusMessage: string; | ||
data: Video[]; | ||
pagination: Pagination; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Route } from '@/types'; | ||
import ofetch from '@/utils/ofetch'; | ||
import cache from '@/utils/cache'; | ||
import { UserProfile, Videos } from './types'; | ||
import { art } from '@/utils/render'; | ||
import path from 'node:path'; | ||
import { getCurrentPath } from '@/utils/helpers'; | ||
|
||
const __dirname = getCurrentPath(import.meta.url); | ||
|
||
export const route: 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, | ||
}; | ||
|
||
const getProfileById = (uid: string) => cache.tryGet(`manyvids:profile:${uid}`, () => ofetch(`https://www.manyvids.com/bff/profile/profiles/${uid}`)) as Promise<UserProfile>; | ||
|
||
const render = (data) => art(path.join(__dirname, 'templates', 'video.art'), data); | ||
|
||
async function handler(ctx) { | ||
const { uid } = ctx.req.param(); | ||
|
||
const profile = await getProfileById(uid); | ||
const videos = await ofetch<Videos>(`https://www.manyvids.com/bff/store/videos/${uid}/`, { | ||
query: { page: 1 }, | ||
}); | ||
|
||
const items = videos.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, | ||
}; | ||
} |