diff --git a/src/components/Layout/SearchBar/SearchBarForm/SearchBarForm.module.scss b/src/components/Layout/SearchBar/SearchBarForm/SearchBarForm.module.scss
index b868e96..f5c440c 100644
--- a/src/components/Layout/SearchBar/SearchBarForm/SearchBarForm.module.scss
+++ b/src/components/Layout/SearchBar/SearchBarForm/SearchBarForm.module.scss
@@ -9,6 +9,7 @@
.query{
flex: 6;
margin-right: $spacing_16;
+ transition: none !important;
}
.query:hover {
@@ -24,6 +25,7 @@
background-color: var(--primary);
border-color: var(--primary);
color: var(--primary-inverse);
+ transition: none !important;
}
.submitBtn:hover {
diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx
index ae6c3bd..8ce895a 100644
--- a/src/components/Layout/index.tsx
+++ b/src/components/Layout/index.tsx
@@ -21,7 +21,7 @@ const Layout: React.FC
= (props) => {
- Proxy Raye: un proxy per XVideos basato su PornInvidious
+ Proxy Raye: watch porn videos without tracking or annoying ads!
{children}
diff --git a/src/components/Pages/NotFound/Msg/Msg.module.scss b/src/components/Pages/NotFound/Msg/Msg.module.scss
new file mode 100644
index 0000000..dca88b8
--- /dev/null
+++ b/src/components/Pages/NotFound/Msg/Msg.module.scss
@@ -0,0 +1,13 @@
+@import 'fontsize';
+
+.header {
+ font-size: $font-size-xlarge;
+}
+
+.msg {
+ font-size: $font-size-large;
+}
+
+.link {
+ color: var(--primary);
+}
\ No newline at end of file
diff --git a/src/components/Pages/NotFound/Msg/index.tsx b/src/components/Pages/NotFound/Msg/index.tsx
new file mode 100644
index 0000000..fa1cf09
--- /dev/null
+++ b/src/components/Pages/NotFound/Msg/index.tsx
@@ -0,0 +1,22 @@
+import React, { } from 'react';
+
+import style from './Msg.module.scss';
+
+import { useTranslations } from 'next-intl';
+import Link from 'next/link';
+
+const Msg: React.FC = () => {
+
+ const t = useTranslations('NotFound');
+
+ return (
+
+
{t('uh_oh')}
+
{t('something_wrong')}
+
{t('back_to_home')}
+
+ );
+
+};
+
+export default Msg;
\ No newline at end of file
diff --git a/src/components/Pages/NotFound/index.tsx b/src/components/Pages/NotFound/index.tsx
new file mode 100644
index 0000000..ab79a9d
--- /dev/null
+++ b/src/components/Pages/NotFound/index.tsx
@@ -0,0 +1,18 @@
+import React from 'react';
+
+import Header from '@/components/Layout/Header';
+import SearchBar from '@/components/Layout/SearchBar';
+import Msg from './Msg';
+
+const NotFound: React.FC = (props) => {
+
+ return (
+ <>
+
+
+
+ >
+ );
+};
+
+export default NotFound;
\ No newline at end of file
diff --git a/src/utils/info/version.ts b/src/utils/info/version.ts
new file mode 100644
index 0000000..4f76523
--- /dev/null
+++ b/src/utils/info/version.ts
@@ -0,0 +1,23 @@
+import fs from 'fs/promises';
+import path from 'path';
+
+export const getAppVersion = async (): Promise => {
+
+ let version = ''
+
+ try {
+
+ const packageJsonPath = path.resolve(process.cwd(), 'package.json');
+
+ const data = await fs.readFile(packageJsonPath, 'utf8');
+
+ const packageJson = JSON.parse(data);
+
+ version = packageJson.version
+
+ } catch (error) {
+ // handle error
+ }
+
+ return version
+}
diff --git a/src/utils/scrape/headers.ts b/src/utils/scrape/headers.ts
new file mode 100644
index 0000000..c66bc7a
--- /dev/null
+++ b/src/utils/scrape/headers.ts
@@ -0,0 +1,38 @@
+import { XVIDEOS_BASE_URL } from "@/constants/urls";
+import { removeHttpS } from "../string";
+
+const getRandomUserAgent = (): string => {
+
+ const userAgents: string[] = [
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5397.215 Safari/537.36',
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0',
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.2420.81',
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 OPR/109.0.0.0',
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 14.4; rv:124.0) Gecko/20100101 Firefox/124.0',
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 14_4_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15',
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 14_4_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 OPR/109.0.0.0',
+ 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
+ 'Mozilla/5.0 (X11; Linux i686; rv:124.0) Gecko/20100101 Firefox/124.0'
+ ];
+
+ const rand = Math.floor(Math.random() * userAgents.length);
+
+ return userAgents[rand]
+}
+
+export const getHeaders = (host:string = XVIDEOS_BASE_URL) => {
+ return {
+ headers: {
+ "User-Agent": getRandomUserAgent(),
+ "Accept-Language": "en-gb, en, en-US, it",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Connection": "keep-alive",
+ "Sec-Fetch-Dest": "document",
+ "Sec-Fetch-Mode": "navigate",
+ "Sec-Fetch-Site": "none",
+ "Host": removeHttpS(host)
+ },
+ }
+};
\ No newline at end of file
diff --git a/src/utils/scrape/gallery.ts b/src/utils/scrape/xvideos/gallery.ts
similarity index 82%
rename from src/utils/scrape/gallery.ts
rename to src/utils/scrape/xvideos/gallery.ts
index a53aec7..51d617b 100644
--- a/src/utils/scrape/gallery.ts
+++ b/src/utils/scrape/xvideos/gallery.ts
@@ -1,8 +1,9 @@
import { XVIDEOS_BASE_URL } from '@/constants/urls';
-import { GalleryData, VideoData } from '@/meta/data';
+import { GalleryData } from '@/meta/data';
import axios, { AxiosError } from 'axios';
import * as cheerio from "cheerio";
+import { getHeaders } from '../headers';
interface FetchParams {
baseUrl?: string
@@ -13,11 +14,7 @@ export const fetchGalleryData = async (params?: FetchParams): Promise {
- const start = tagBlock.indexOf(`html5player.${functionName}('`) + `html5player.${functionName}('`.length;
- const end = tagBlock.toString().indexOf("'", start);
+ tagBlock: string, functionName: string, extension: string): string | null => {
+ const start = tagBlock.indexOf(`html5player.${functionName}('`) + `html5player.${functionName}('`.length;
+ const end = tagBlock.toString().indexOf("'", start);
- const substr = tagBlock.substring(start, end);
+ const substr = tagBlock.substring(start, end);
- if (substr.includes(extension)) {
- return substr
- }
+ if (substr.includes(extension)) {
+ return substr
+ }
- return null
+ return null
}
-export const findRelatedVideos = (tagBlock: string): GalleryData[]|null => {
+export const findRelatedVideos = (tagBlock: string): GalleryData[] | null => {
if (!(tagBlock.includes('video_related=['))) {
return null
}
@@ -22,13 +22,13 @@ export const findRelatedVideos = (tagBlock: string): GalleryData[]|null => {
// Trova l'inizio e la fine dell'array di oggetti nell'input
const start = tagBlock.indexOf('[{');
const end = tagBlock.lastIndexOf('}]') + 2;
-
+
// Estrai la sottostringa contenente l'array di oggetti
const jsonString = tagBlock.substring(start, end);
-
+
// Parsea la stringa JSON in un array di oggetti
const videoRelatedArray = JSON.parse(jsonString);
-
+
// Mappa ogni oggetto nell'array per rinominare le chiavi
//@ts-ignore
const parsedArray = videoRelatedArray.map(obj => ({
@@ -37,6 +37,23 @@ export const findRelatedVideos = (tagBlock: string): GalleryData[]|null => {
imgUrl: obj.i,
text: obj.tf
}));
-
+
return parsedArray;
-}
\ No newline at end of file
+}
+
+export const removeHttpS = (url: string): string => {
+ if (url.startsWith("http://")) {
+ return url.slice(7);
+ } else if (url.startsWith("https://")) {
+ return url.slice(8);
+ }
+ return url;
+};
+
+export const encodeVideoUrlPath = (input: string): string => {
+ return encodeURIComponent(input.replace(/^\/+/, ''))
+};
+
+export const decodeVideoUrlPath = (input: string): string => {
+ return `/${decodeURIComponent(input)}`;
+};
\ No newline at end of file