mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
renaming
This commit is contained in:
37
providers/uhd/catalog.ts
Normal file
37
providers/uhd/catalog.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
export const catalog = [
|
||||
{
|
||||
title: "Latest",
|
||||
filter: "",
|
||||
},
|
||||
{
|
||||
title: "Web Series",
|
||||
filter: "/web-series",
|
||||
},
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/movies",
|
||||
},
|
||||
{
|
||||
title: "4K HDR",
|
||||
filter: "/4k-hdr",
|
||||
},
|
||||
];
|
||||
|
||||
export const genres = [
|
||||
{
|
||||
title: "4K HEVC",
|
||||
filter: "/2160p-hevc",
|
||||
},
|
||||
{
|
||||
title: "HD 10bit",
|
||||
filter: "/1080p-10bit",
|
||||
},
|
||||
{
|
||||
title: "English Movies",
|
||||
filter: "/movies/english-movies",
|
||||
},
|
||||
{
|
||||
title: "Dual Audio",
|
||||
filter: "/movies/dual-audio-movies",
|
||||
},
|
||||
];
|
||||
@@ -1,15 +0,0 @@
|
||||
import {uhdCatalogList, uhdGenresList} from './uhCtatalog';
|
||||
import {uhdGetPosts, uhdGetPostsSearch} from './uhdGetPosts';
|
||||
import {uhdGetStream} from './uhdGetStream';
|
||||
import {getUhdInfo} from './getUhdInfo';
|
||||
import {ProviderType} from '../types';
|
||||
|
||||
export const uhdMovies: ProviderType = {
|
||||
catalog: uhdCatalogList,
|
||||
genres: uhdGenresList,
|
||||
GetMetaData: getUhdInfo,
|
||||
GetHomePosts: uhdGetPosts,
|
||||
GetStream: uhdGetStream,
|
||||
nonStreamableServer: ['Gdrive-Instant'],
|
||||
GetSearchPosts: uhdGetPostsSearch,
|
||||
};
|
||||
@@ -1,25 +1,25 @@
|
||||
import {Info, Link, ProviderContext} from '../types';
|
||||
import { Info, Link, ProviderContext } from "../types";
|
||||
|
||||
const headers = {
|
||||
Accept:
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||
'Cache-Control': 'no-store',
|
||||
'Accept-Language': 'en-US,en;q=0.9',
|
||||
DNT: '1',
|
||||
'sec-ch-ua':
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"Cache-Control": "no-store",
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
DNT: "1",
|
||||
"sec-ch-ua":
|
||||
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'Sec-Fetch-Dest': 'document',
|
||||
'Sec-Fetch-Mode': 'navigate',
|
||||
'Sec-Fetch-Site': 'none',
|
||||
'Sec-Fetch-User': '?1',
|
||||
'Upgrade-Insecure-Requests': '1',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-ch-ua-platform": '"Windows"',
|
||||
"Sec-Fetch-Dest": "document",
|
||||
"Sec-Fetch-Mode": "navigate",
|
||||
"Sec-Fetch-Site": "none",
|
||||
"Sec-Fetch-User": "?1",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
|
||||
};
|
||||
|
||||
export async function getUhdInfo({
|
||||
export const getMeta = async function ({
|
||||
link,
|
||||
providerContext,
|
||||
}: {
|
||||
@@ -27,14 +27,14 @@ export async function getUhdInfo({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Info> {
|
||||
try {
|
||||
const {axios, cheerio} = providerContext;
|
||||
const { axios, cheerio } = providerContext;
|
||||
const url = link;
|
||||
const res = await axios.get(url, {headers});
|
||||
const res = await axios.get(url, { headers });
|
||||
const html = await res.data;
|
||||
const $ = cheerio.load(html);
|
||||
|
||||
const title = $('h2:first').text() || '';
|
||||
const image = $('h2').siblings().find('img').attr('src') || '';
|
||||
const title = $("h2:first").text() || "";
|
||||
const image = $("h2").siblings().find("img").attr("src") || "";
|
||||
// const trailer = $('iframe').attr('src') || '';
|
||||
|
||||
// console.log({ title, image, trailer });
|
||||
@@ -43,20 +43,20 @@ export async function getUhdInfo({
|
||||
const episodes: Link[] = [];
|
||||
|
||||
// new structure
|
||||
$('.mks_separator').each((index, element) => {
|
||||
$(".mks_separator").each((index, element) => {
|
||||
$(element)
|
||||
.nextUntil('.mks_separator')
|
||||
.nextUntil(".mks_separator")
|
||||
.each((index, element) => {
|
||||
const title = $(element).text();
|
||||
const episodesList: {title: string; link: string}[] = [];
|
||||
const episodesList: { title: string; link: string }[] = [];
|
||||
$(element)
|
||||
.next('p')
|
||||
.find('a')
|
||||
.next("p")
|
||||
.find("a")
|
||||
.each((index, element) => {
|
||||
const title = $(element).text();
|
||||
const link = $(element).attr('href');
|
||||
if (title && link && !title.toLocaleLowerCase().includes('zip')) {
|
||||
episodesList.push({title, link});
|
||||
const link = $(element).attr("href");
|
||||
if (title && link && !title.toLocaleLowerCase().includes("zip")) {
|
||||
episodesList.push({ title, link });
|
||||
// console.log({ title, link });
|
||||
}
|
||||
});
|
||||
@@ -70,20 +70,20 @@ export async function getUhdInfo({
|
||||
});
|
||||
|
||||
// old structure
|
||||
$('hr').each((index, element) => {
|
||||
$("hr").each((index, element) => {
|
||||
$(element)
|
||||
.nextUntil('hr')
|
||||
.nextUntil("hr")
|
||||
.each((index, element) => {
|
||||
const title = $(element).text();
|
||||
const episodesList: {title: string; link: string}[] = [];
|
||||
const episodesList: { title: string; link: string }[] = [];
|
||||
$(element)
|
||||
.next('p')
|
||||
.find('a')
|
||||
.next("p")
|
||||
.find("a")
|
||||
.each((index, element) => {
|
||||
const title = $(element).text();
|
||||
const link = $(element).attr('href');
|
||||
if (title && link && !title.toLocaleLowerCase().includes('zip')) {
|
||||
episodesList.push({title, link});
|
||||
const link = $(element).attr("href");
|
||||
if (title && link && !title.toLocaleLowerCase().includes("zip")) {
|
||||
episodesList.push({ title, link });
|
||||
// console.log({ title, link });
|
||||
}
|
||||
});
|
||||
@@ -98,23 +98,23 @@ export async function getUhdInfo({
|
||||
// console.log(episodes);
|
||||
return {
|
||||
title: title.match(/^Download\s+([^(\[]+)/i)
|
||||
? title?.match(/^Download\s+([^(\[]+)/i)?.[1] || ''
|
||||
: title.replace('Download', '') || '',
|
||||
? title?.match(/^Download\s+([^(\[]+)/i)?.[1] || ""
|
||||
: title.replace("Download", "") || "",
|
||||
image,
|
||||
imdbId: '',
|
||||
imdbId: "",
|
||||
synopsis: title,
|
||||
type: '',
|
||||
type: "",
|
||||
linkList: episodes,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return {
|
||||
title: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
synopsis: '',
|
||||
title: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
synopsis: "",
|
||||
linkList: [],
|
||||
type: 'uhd',
|
||||
type: "uhd",
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,25 +1,25 @@
|
||||
import {Post, ProviderContext} from '../types';
|
||||
import { Post, ProviderContext } from "../types";
|
||||
|
||||
const headers = {
|
||||
Accept:
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||
'Cache-Control': 'no-store',
|
||||
'Accept-Language': 'en-US,en;q=0.9',
|
||||
DNT: '1',
|
||||
'sec-ch-ua':
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"Cache-Control": "no-store",
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
DNT: "1",
|
||||
"sec-ch-ua":
|
||||
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'Sec-Fetch-Dest': 'document',
|
||||
'Sec-Fetch-Mode': 'navigate',
|
||||
'Sec-Fetch-Site': 'none',
|
||||
'Sec-Fetch-User': '?1',
|
||||
'Upgrade-Insecure-Requests': '1',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-ch-ua-platform": '"Windows"',
|
||||
"Sec-Fetch-Dest": "document",
|
||||
"Sec-Fetch-Mode": "navigate",
|
||||
"Sec-Fetch-Site": "none",
|
||||
"Sec-Fetch-User": "?1",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
|
||||
};
|
||||
|
||||
export const uhdGetPosts = async ({
|
||||
export const getPosts = async ({
|
||||
filter,
|
||||
page,
|
||||
// providerValue,
|
||||
@@ -32,16 +32,16 @@ export const uhdGetPosts = async ({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> => {
|
||||
const {getBaseUrl} = providerContext;
|
||||
const baseUrl = await getBaseUrl('UhdMovies');
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("UhdMovies");
|
||||
const url =
|
||||
page === 1 ? `${baseUrl}/${filter}/` : `${baseUrl + filter}/page/${page}/`;
|
||||
console.log('url', url);
|
||||
console.log("url", url);
|
||||
|
||||
return posts(baseUrl, url, signal, providerContext);
|
||||
};
|
||||
|
||||
export const uhdGetPostsSearch = async ({
|
||||
export const getSearchPosts = async ({
|
||||
searchQuery,
|
||||
page,
|
||||
// providerValue,
|
||||
@@ -54,8 +54,8 @@ export const uhdGetPostsSearch = async ({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> => {
|
||||
const {getBaseUrl} = providerContext;
|
||||
const baseUrl = await getBaseUrl('UhdMovies');
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("UhdMovies");
|
||||
const url = `${baseUrl}/search/${searchQuery}/page/${page}/`;
|
||||
|
||||
return posts(baseUrl, url, signal, providerContext);
|
||||
@@ -65,25 +65,25 @@ async function posts(
|
||||
baseURL: string,
|
||||
url: string,
|
||||
signal: AbortSignal,
|
||||
providerContext: ProviderContext,
|
||||
providerContext: ProviderContext
|
||||
): Promise<Post[]> {
|
||||
try {
|
||||
const {axios, cheerio} = providerContext;
|
||||
const res = await axios.get(url, {headers, signal});
|
||||
const { axios, cheerio } = providerContext;
|
||||
const res = await axios.get(url, { headers, signal });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const uhdCatalog: Post[] = [];
|
||||
|
||||
$('.gridlove-posts')
|
||||
.find('.layout-masonry')
|
||||
$(".gridlove-posts")
|
||||
.find(".layout-masonry")
|
||||
.each((index, element) => {
|
||||
const title = $(element).find('a').attr('title');
|
||||
const link = $(element).find('a').attr('href');
|
||||
const image = $(element).find('a').find('img').attr('src');
|
||||
const title = $(element).find("a").attr("title");
|
||||
const link = $(element).find("a").attr("href");
|
||||
const image = $(element).find("a").find("img").attr("src");
|
||||
|
||||
if (title && link && image) {
|
||||
uhdCatalog.push({
|
||||
title: title.replace('Download', '').trim(),
|
||||
title: title.replace("Download", "").trim(),
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
@@ -91,7 +91,7 @@ async function posts(
|
||||
});
|
||||
return uhdCatalog;
|
||||
} catch (err) {
|
||||
console.error('uhd error ', err);
|
||||
console.error("uhd error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,25 @@
|
||||
import {ProviderContext, Stream} from '../types';
|
||||
import { ProviderContext, Stream } from "../types";
|
||||
|
||||
const headers = {
|
||||
Accept:
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||
'Cache-Control': 'no-store',
|
||||
'Accept-Language': 'en-US,en;q=0.9',
|
||||
DNT: '1',
|
||||
'sec-ch-ua':
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"Cache-Control": "no-store",
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
DNT: "1",
|
||||
"sec-ch-ua":
|
||||
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'Sec-Fetch-Dest': 'document',
|
||||
'Sec-Fetch-Mode': 'navigate',
|
||||
'Sec-Fetch-Site': 'none',
|
||||
'Sec-Fetch-User': '?1',
|
||||
'Upgrade-Insecure-Requests': '1',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-ch-ua-platform": '"Windows"',
|
||||
"Sec-Fetch-Dest": "document",
|
||||
"Sec-Fetch-Mode": "navigate",
|
||||
"Sec-Fetch-Site": "none",
|
||||
"Sec-Fetch-User": "?1",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
|
||||
};
|
||||
|
||||
export const uhdGetStream = async ({
|
||||
export const getStream = async ({
|
||||
link: url,
|
||||
providerContext,
|
||||
}: {
|
||||
@@ -27,35 +27,35 @@ export const uhdGetStream = async ({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Stream[]> => {
|
||||
try {
|
||||
const {axios, cheerio} = providerContext;
|
||||
const { axios, cheerio } = providerContext;
|
||||
let downloadLink = await modExtractor(url, providerContext);
|
||||
|
||||
// console.log(downloadLink.data);
|
||||
|
||||
const ddl = downloadLink?.data?.match(/content="0;url=(.*?)"/)?.[1] || url;
|
||||
|
||||
console.log('ddl', ddl);
|
||||
console.log("ddl", ddl);
|
||||
// console.log(ddl);
|
||||
const driveLink = await isDriveLink(ddl);
|
||||
const ServerLinks: Stream[] = [];
|
||||
|
||||
const driveRes = await axios.get(driveLink, {headers});
|
||||
const driveRes = await axios.get(driveLink, { headers });
|
||||
const driveHtml = driveRes.data;
|
||||
const $drive = cheerio.load(driveHtml);
|
||||
//instant link
|
||||
try {
|
||||
const seed = $drive('.btn-danger').attr('href') || '';
|
||||
const instantToken = seed.split('=')[1];
|
||||
const seed = $drive(".btn-danger").attr("href") || "";
|
||||
const instantToken = seed.split("=")[1];
|
||||
// console.log('InstantToken', instantToken);
|
||||
const InstantFromData = new FormData();
|
||||
InstantFromData.append('keys', instantToken);
|
||||
const videoSeedUrl = seed.split('/').slice(0, 3).join('/') + '/api';
|
||||
InstantFromData.append("keys", instantToken);
|
||||
const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
|
||||
// console.log('videoSeedUrl', videoSeedUrl);
|
||||
const instantLinkRes = await fetch(videoSeedUrl, {
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
body: InstantFromData,
|
||||
headers: {
|
||||
'x-token': videoSeedUrl,
|
||||
"x-token": videoSeedUrl,
|
||||
},
|
||||
});
|
||||
const instantLinkData = await instantLinkRes.json();
|
||||
@@ -63,96 +63,96 @@ export const uhdGetStream = async ({
|
||||
if (instantLinkData.error === false) {
|
||||
const instantLink = instantLinkData.url;
|
||||
ServerLinks.push({
|
||||
server: 'Gdrive-Instant',
|
||||
server: "Gdrive-Instant",
|
||||
link: instantLink,
|
||||
type: 'mkv',
|
||||
type: "mkv",
|
||||
});
|
||||
} else {
|
||||
console.log('Instant link not found', instantLinkData);
|
||||
console.log("Instant link not found", instantLinkData);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('Instant link not found', err);
|
||||
console.log("Instant link not found", err);
|
||||
}
|
||||
|
||||
// resume link
|
||||
try {
|
||||
const resumeDrive = driveLink.replace('/file', '/zfile');
|
||||
const resumeDrive = driveLink.replace("/file", "/zfile");
|
||||
// console.log('resumeDrive', resumeDrive);
|
||||
const resumeDriveRes = await axios.get(resumeDrive, {headers});
|
||||
const resumeDriveRes = await axios.get(resumeDrive, { headers });
|
||||
const resumeDriveHtml = resumeDriveRes.data;
|
||||
const $resumeDrive = cheerio.load(resumeDriveHtml);
|
||||
const resumeLink = $resumeDrive('.btn-success').attr('href');
|
||||
const resumeLink = $resumeDrive(".btn-success").attr("href");
|
||||
// console.log('resumeLink', resumeLink);
|
||||
if (resumeLink) {
|
||||
ServerLinks.push({
|
||||
server: 'ResumeCloud',
|
||||
server: "ResumeCloud",
|
||||
link: resumeLink,
|
||||
type: 'mkv',
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('Resume link not found');
|
||||
console.log("Resume link not found");
|
||||
}
|
||||
|
||||
// CF workers type 1
|
||||
try {
|
||||
const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=1';
|
||||
const cfWorkersRes = await axios.get(cfWorkersLink, {headers});
|
||||
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1";
|
||||
const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
|
||||
const cfWorkersHtml = cfWorkersRes.data;
|
||||
const $cfWorkers = cheerio.load(cfWorkersHtml);
|
||||
const cfWorkersStream = $cfWorkers('.btn-success');
|
||||
const cfWorkersStream = $cfWorkers(".btn-success");
|
||||
cfWorkersStream.each((i, el) => {
|
||||
const link = el.attribs.href;
|
||||
const link = (el as any).attribs?.href;
|
||||
if (link) {
|
||||
ServerLinks.push({
|
||||
server: 'Cf Worker 1.' + i,
|
||||
server: "Cf Worker 1." + i,
|
||||
link: link,
|
||||
type: 'mkv',
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
console.log('CF workers link not found', err);
|
||||
console.log("CF workers link not found", err);
|
||||
}
|
||||
|
||||
// CF workers type 2
|
||||
try {
|
||||
const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=2';
|
||||
const cfWorkersRes = await axios.get(cfWorkersLink, {headers});
|
||||
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2";
|
||||
const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
|
||||
const cfWorkersHtml = cfWorkersRes.data;
|
||||
const $cfWorkers = cheerio.load(cfWorkersHtml);
|
||||
const cfWorkersStream = $cfWorkers('.btn-success');
|
||||
const cfWorkersStream = $cfWorkers(".btn-success");
|
||||
cfWorkersStream.each((i, el) => {
|
||||
const link = el.attribs.href;
|
||||
const link = (el as any).attribs?.href;
|
||||
if (link) {
|
||||
ServerLinks.push({
|
||||
server: 'Cf Worker 2.' + i,
|
||||
server: "Cf Worker 2." + i,
|
||||
link: link,
|
||||
type: 'mkv',
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
console.log('CF workers link not found', err);
|
||||
console.log("CF workers link not found", err);
|
||||
}
|
||||
|
||||
console.log('ServerLinks', ServerLinks);
|
||||
console.log("ServerLinks", ServerLinks);
|
||||
return ServerLinks;
|
||||
} catch (err) {
|
||||
console.log('getStream error', err);
|
||||
console.log("getStream error", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
const isDriveLink = async (ddl: string) => {
|
||||
if (ddl.includes('drive')) {
|
||||
if (ddl.includes("drive")) {
|
||||
const driveLeach = await fetch(ddl);
|
||||
const driveLeachData = await driveLeach.text();
|
||||
const pathMatch = driveLeachData.match(
|
||||
/window\.location\.replace\("([^"]+)"\)/,
|
||||
/window\.location\.replace\("([^"]+)"\)/
|
||||
);
|
||||
const path = pathMatch?.[1];
|
||||
const mainUrl = ddl.split('/')[2];
|
||||
const mainUrl = ddl.split("/")[2];
|
||||
console.log(`driveUrl = https://${mainUrl}${path}`);
|
||||
return `https://${mainUrl}${path}`;
|
||||
} else {
|
||||
@@ -161,13 +161,13 @@ const isDriveLink = async (ddl: string) => {
|
||||
};
|
||||
|
||||
async function modExtractor(url: string, providerContext: ProviderContext) {
|
||||
const {axios, cheerio} = providerContext;
|
||||
const { axios, cheerio } = providerContext;
|
||||
try {
|
||||
const wpHttp = url.split('sid=')[1];
|
||||
const wpHttp = url.split("sid=")[1];
|
||||
var bodyFormData0 = new FormData();
|
||||
bodyFormData0.append('_wp_http', wpHttp);
|
||||
const res = await fetch(url.split('?')[0], {
|
||||
method: 'POST',
|
||||
bodyFormData0.append("_wp_http", wpHttp);
|
||||
const res = await fetch(url.split("?")[0], {
|
||||
method: "POST",
|
||||
body: bodyFormData0,
|
||||
});
|
||||
const data = await res.text();
|
||||
@@ -176,25 +176,25 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
|
||||
const $ = cheerio.load(html);
|
||||
|
||||
// find input with name="_wp_http2"
|
||||
const wpHttp2 = $('input').attr('name', '_wp_http2').val();
|
||||
const wpHttp2 = $("input").attr("name", "_wp_http2").val();
|
||||
|
||||
// console.log('wpHttp2', wpHttp2);
|
||||
|
||||
// form data
|
||||
var bodyFormData = new FormData();
|
||||
bodyFormData.append('_wp_http2', wpHttp2);
|
||||
const formUrl1 = $('form').attr('action');
|
||||
const formUrl = formUrl1 || url.split('?')[0];
|
||||
bodyFormData.append("_wp_http2", wpHttp2);
|
||||
const formUrl1 = $("form").attr("action");
|
||||
const formUrl = formUrl1 || url.split("?")[0];
|
||||
|
||||
const res2 = await fetch(formUrl, {
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
body: bodyFormData,
|
||||
});
|
||||
const html2: any = await res2.text();
|
||||
const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1];
|
||||
console.log(link);
|
||||
const cookie = link.split('=')[1];
|
||||
console.log('cookie', cookie);
|
||||
const cookie = link.split("=")[1];
|
||||
console.log("cookie", cookie);
|
||||
|
||||
const downloadLink = await axios.get(link, {
|
||||
headers: {
|
||||
@@ -204,6 +204,6 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
|
||||
});
|
||||
return downloadLink;
|
||||
} catch (err) {
|
||||
console.log('modGetStream error', err);
|
||||
console.log("modGetStream error", err);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
export const uhdCatalogList = [
|
||||
{
|
||||
title: 'Latest',
|
||||
filter: '',
|
||||
},
|
||||
{
|
||||
title: 'Web Series',
|
||||
filter: '/web-series',
|
||||
},
|
||||
{
|
||||
title: 'Movies',
|
||||
filter: '/movies',
|
||||
},
|
||||
{
|
||||
title: '4K HDR',
|
||||
filter: '/4k-hdr',
|
||||
},
|
||||
];
|
||||
|
||||
export const uhdGenresList = [
|
||||
{
|
||||
title: '4K HEVC',
|
||||
filter: '/2160p-hevc',
|
||||
},
|
||||
{
|
||||
title: 'HD 10bit',
|
||||
filter: '/1080p-10bit',
|
||||
},
|
||||
{
|
||||
title: 'English Movies',
|
||||
filter: '/movies/english-movies',
|
||||
},
|
||||
{
|
||||
title: 'Dual Audio',
|
||||
filter: '/movies/dual-audio-movies',
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user