add RedTube base structure

This commit is contained in:
La macchina desiderante 2024-05-26 09:21:18 +02:00
parent df9cb431f4
commit 18b7c6cb2e
5 changed files with 40 additions and 1 deletions

View File

@ -8,7 +8,8 @@ export enum Platforms {
xvideos= 'xvideos', xvideos= 'xvideos',
xnxx= 'xnxx', xnxx= 'xnxx',
pornhub= 'pornhub', pornhub= 'pornhub',
youporn= 'youporn' youporn= 'youporn',
redtube= 'redtube'
} }
export enum XVideosCatQueryMap { export enum XVideosCatQueryMap {

View File

@ -6,12 +6,14 @@ import { XVideosAgent } from "./scrape/xvideos/agent";
import { XNXXAgent } from "./scrape/xnxx/agent"; import { XNXXAgent } from "./scrape/xnxx/agent";
import { PornHubAgent } from "./scrape/pornhub/agent"; import { PornHubAgent } from "./scrape/pornhub/agent";
import { YouPornAgent } from "./scrape/youporn/agent"; import { YouPornAgent } from "./scrape/youporn/agent";
import { RedTubeAgent } from "./scrape/redtube/agent";
const AgentMapper = { const AgentMapper = {
[Platforms.xvideos]: XVideosAgent, [Platforms.xvideos]: XVideosAgent,
[Platforms.xnxx]: XNXXAgent, [Platforms.xnxx]: XNXXAgent,
[Platforms.pornhub]: PornHubAgent, [Platforms.pornhub]: PornHubAgent,
[Platforms.youporn]: YouPornAgent, [Platforms.youporn]: YouPornAgent,
[Platforms.redtube]: RedTubeAgent
} }
export class VideoAgent { export class VideoAgent {

View File

@ -0,0 +1,15 @@
import { FetchParams, GalleryData, VideoAgent, VideoData } from "@/meta/data";
import { fetchRedTubeGalleryData } from "./gallery";
import { fetchRedTubeVideoData } from "./video";
export class RedTubeAgent implements VideoAgent {
public getGallery = async (params?: FetchParams): Promise<GalleryData[]> => {
return await fetchRedTubeGalleryData(params)
}
public getVideo = async (id: string, params?: FetchParams): Promise<[VideoData, GalleryData[]]> => {
return await fetchRedTubeVideoData(id, params)
}
}

View File

@ -0,0 +1,8 @@
import { FetchParams, GalleryData } from "@/meta/data";
export const fetchRedTubeGalleryData = async (params?: FetchParams): Promise<GalleryData[]> => {
let data: GalleryData[] = [];
return data
}

View File

@ -0,0 +1,13 @@
import { FetchParams, GalleryData, VideoData, VideoSourceItem } from "@/meta/data";
export const fetchRedTubeVideoData = async (videoId: string, params?: FetchParams): Promise<[VideoData, GalleryData[]]> => {
let data: VideoData = {
hlsUrl: '',
srcSet: []
}
let relatedData: GalleryData[] = [];
return [ data, relatedData ]
}