add xhamster base structure

This commit is contained in:
La macchina desiderante 2024-05-28 20:10:17 +02:00
parent a2e61d83f1
commit 291c6efe55
7 changed files with 57 additions and 4 deletions

View File

@ -1,6 +1,6 @@
'use client'
import { Cookies, Platforms, XVideosOrientations, PornHubOrientations, YouPornOrientations, RedTubeOrientations } from '@/meta/settings';
import { Cookies, Platforms, XVideosOrientations, PornHubOrientations, YouPornOrientations, RedTubeOrientations, XHamsterOrientations } from '@/meta/settings';
import css from './Orientation.module.scss'
@ -29,6 +29,10 @@ const getOrientations = (platform: Platforms):Object => {
return RedTubeOrientations
}
if([Platforms.xhamster].includes(platform)) {
return XHamsterOrientations
}
return PornHubOrientations
}

View File

@ -1,6 +1,6 @@
'use client'
import { Cookies, Platforms, PornHubOrientations, RedTubeOrientations, XVideosOrientations, YouPornOrientations } from '@/meta/settings';
import { Cookies, Platforms, PornHubOrientations, RedTubeOrientations, XHamsterOrientations, XVideosOrientations, YouPornOrientations } from '@/meta/settings';
import css from './Platform.module.scss'
@ -31,6 +31,10 @@ const mapOrientationToPlatform = (platform: string, orientation: string): string
return Object.keys(RedTubeOrientations).includes(orientation) ? orientation : String(RedTubeOrientations.etero)
}
if ([String(Platforms.xhamster)].includes(platform)) {
return Object.keys(XHamsterOrientations).includes(orientation) ? orientation : String(XHamsterOrientations.etero)
}
if ([String(Platforms.youporn)].includes(platform)) {
return String(YouPornOrientations.generic)
}

View File

@ -9,7 +9,8 @@ export enum Platforms {
xnxx= 'xnxx',
pornhub= 'pornhub',
youporn= 'youporn',
redtube= 'redtube'
redtube= 'redtube',
xhamster= 'xhamster'
}
export enum XVideosCatQueryMap {
@ -39,6 +40,12 @@ export enum RedTubeOrientations {
trans= 'trans'
}
export enum XHamsterOrientations {
etero= 'etero',
gay= 'gay',
trans= 'trans'
}
export enum Themes {
light= 'light',
dark= 'dark',

View File

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

View File

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

View File

@ -0,0 +1,8 @@
import { FetchParams, GalleryData } from "@/meta/data";
export const fetchXHamsterGalleryData = 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 fetchXHamsterVideoData = async (videoId: string, params?: FetchParams): Promise<[VideoData, GalleryData[]]> => {
let data: VideoData = {
hlsUrl: '',
srcSet: []
}
let relatedData: GalleryData[] = [];
return [ data, relatedData ]
}