Release v0.4.0: Add YouPorn support #102
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { Cookies, Platforms, XVideosOrientations, PornHubOrientations } from '@/meta/settings';
|
import { Cookies, Platforms, XVideosOrientations, PornHubOrientations, YouPornOrientations } from '@/meta/settings';
|
||||||
|
|
||||||
import css from './Orientation.module.scss'
|
import css from './Orientation.module.scss'
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@ const getOrientations = (platform: Platforms):Object => {
|
||||||
return XVideosOrientations
|
return XVideosOrientations
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if([Platforms.youporn].includes(platform)) {
|
||||||
|
return YouPornOrientations
|
||||||
|
}
|
||||||
|
|
||||||
return PornHubOrientations
|
return PornHubOrientations
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { Cookies, Platforms, PornHubOrientations, XVideosOrientations } from '@/meta/settings';
|
import { Cookies, Platforms, PornHubOrientations, XVideosOrientations, YouPornOrientations } from '@/meta/settings';
|
||||||
|
|
||||||
import css from './Platform.module.scss'
|
import css from './Platform.module.scss'
|
||||||
|
|
||||||
|
@ -26,6 +26,10 @@ const mapOrientationToPlatform = (platform: string, orientation: string): string
|
||||||
return Object.keys(PornHubOrientations).includes(orientation) ? orientation : String(PornHubOrientations.generic)
|
return Object.keys(PornHubOrientations).includes(orientation) ? orientation : String(PornHubOrientations.generic)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([String(Platforms.youporn)].includes(platform)) {
|
||||||
|
return String(YouPornOrientations.generic)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Platform: React.FC<Props> = (props) => {
|
const Platform: React.FC<Props> = (props) => {
|
||||||
|
|
|
@ -7,7 +7,8 @@ export enum Cookies {
|
||||||
export enum Platforms {
|
export enum Platforms {
|
||||||
xvideos= 'xvideos',
|
xvideos= 'xvideos',
|
||||||
xnxx= 'xnxx',
|
xnxx= 'xnxx',
|
||||||
pornhub= 'pornhub'
|
pornhub= 'pornhub',
|
||||||
|
youporn= 'youporn'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum XVideosCatQueryMap {
|
export enum XVideosCatQueryMap {
|
||||||
|
@ -27,6 +28,10 @@ export enum PornHubOrientations {
|
||||||
gay= 'gay'
|
gay= 'gay'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum YouPornOrientations {
|
||||||
|
generic= 'generic'
|
||||||
|
}
|
||||||
|
|
||||||
export enum Themes {
|
export enum Themes {
|
||||||
light= 'light',
|
light= 'light',
|
||||||
dark= 'dark',
|
dark= 'dark',
|
||||||
|
|
|
@ -5,12 +5,13 @@ import { Platforms } from "@/meta/settings";
|
||||||
import { XVideosAgent } from "./scrape/xvideos/agent";
|
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";
|
||||||
|
|
||||||
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,
|
||||||
}
|
}
|
||||||
|
|
||||||
export class VideoAgent {
|
export class VideoAgent {
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { FetchParams, GalleryData, VideoAgent, VideoData } from "@/meta/data";
|
||||||
|
import { fetchYouPornGalleryData } from "./gallery";
|
||||||
|
import { fetchYouPornVideoData } from "./video";
|
||||||
|
|
||||||
|
export class YouPornAgent implements VideoAgent {
|
||||||
|
|
||||||
|
public getGallery = async (params?: FetchParams): Promise<GalleryData[]> => {
|
||||||
|
return await fetchYouPornGalleryData(params)
|
||||||
|
}
|
||||||
|
|
||||||
|
public getVideo = async (id: string, params?: FetchParams): Promise<[VideoData, GalleryData[]]> => {
|
||||||
|
return await fetchYouPornVideoData(id, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { FetchParams, GalleryData } from "@/meta/data";
|
||||||
|
|
||||||
|
export const fetchYouPornGalleryData = async (params?: FetchParams): Promise<GalleryData[]> => {
|
||||||
|
|
||||||
|
let data: GalleryData[] = [];
|
||||||
|
|
||||||
|
return data
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { FetchParams, GalleryData, VideoData } from "@/meta/data";
|
||||||
|
|
||||||
|
export const fetchYouPornVideoData = async (videoId: string, params?: FetchParams): Promise<[VideoData, GalleryData[]]> => {
|
||||||
|
|
||||||
|
let data: VideoData = {
|
||||||
|
hlsUrl: '',
|
||||||
|
srcSet: []
|
||||||
|
}
|
||||||
|
|
||||||
|
let relatedData: GalleryData[] = [];
|
||||||
|
|
||||||
|
return [ data, relatedData ]
|
||||||
|
}
|
Loading…
Reference in New Issue