import { FetchParams, GalleryData, VideoData } from "@/meta/data"; import { Platforms } from "@/meta/settings"; import { fetchXVideosGalleryData } from "./scrape/xvideos/gallery"; import { fetchXvideosVideoData } from "./scrape/xvideos/video"; export class VideoAgent { platform: Platforms; constructor(platform: Platforms) { this.platform = platform } public getGallery = async (params?: FetchParams): Promise => { switch (this.platform) { case Platforms.xvideos: return await fetchXVideosGalleryData(params) default: return [] } } public getVideo = async (id: string, params?: FetchParams): Promise<[VideoData, GalleryData[]]> => { switch (this.platform) { case Platforms.xvideos: return await fetchXvideosVideoData(id, params) default: return [{ lowResUrl: '' }, []] } } }