This commit is contained in:
himanshu8443
2025-06-18 11:42:29 +05:30
parent 490a4bd71d
commit 9621597865
100 changed files with 6898 additions and 5740 deletions

164
dist/uhd/meta.js vendored
View File

@@ -1,4 +1,13 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMeta = void 0;
const headers = {
@@ -16,93 +25,96 @@ const headers = {
"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",
};
const getMeta = async function ({ link, providerContext, }) {
try {
const { axios, cheerio } = providerContext;
const url = link;
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 trailer = $('iframe').attr('src') || '';
// console.log({ title, image, trailer });
// Links
const episodes = [];
// new structure
$(".mks_separator").each((index, element) => {
$(element)
.nextUntil(".mks_separator")
.each((index, element) => {
const title = $(element).text();
const episodesList = [];
const getMeta = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
var _b;
try {
const { axios, cheerio } = providerContext;
const url = link;
const res = yield axios.get(url, { headers });
const html = yield res.data;
const $ = cheerio.load(html);
const title = $("h2:first").text() || "";
const image = $("h2").siblings().find("img").attr("src") || "";
// const trailer = $('iframe').attr('src') || '';
// console.log({ title, image, trailer });
// Links
const episodes = [];
// new structure
$(".mks_separator").each((index, element) => {
$(element)
.next("p")
.find("a")
.nextUntil(".mks_separator")
.each((index, element) => {
const title = $(element).text();
const link = $(element).attr("href");
if (title && link && !title.toLocaleLowerCase().includes("zip")) {
episodesList.push({ title, link });
// console.log({ title, link });
const episodesList = [];
$(element)
.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 });
// console.log({ title, link });
}
});
if (title && episodesList.length > 0) {
episodes.push({
title,
directLinks: episodesList,
});
}
});
if (title && episodesList.length > 0) {
episodes.push({
title,
directLinks: episodesList,
});
}
});
});
// old structure
$("hr").each((index, element) => {
$(element)
.nextUntil("hr")
.each((index, element) => {
const title = $(element).text();
const episodesList = [];
// old structure
$("hr").each((index, element) => {
$(element)
.next("p")
.find("a")
.nextUntil("hr")
.each((index, element) => {
const title = $(element).text();
const link = $(element).attr("href");
if (title && link && !title.toLocaleLowerCase().includes("zip")) {
episodesList.push({ title, link });
// console.log({ title, link });
const episodesList = [];
$(element)
.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 });
// console.log({ title, link });
}
});
if (title && episodesList.length > 0) {
episodes.push({
title,
directLinks: episodesList,
});
}
});
if (title && episodesList.length > 0) {
episodes.push({
title,
directLinks: episodesList,
});
}
});
});
// console.log(episodes);
return {
title: title.match(/^Download\s+([^(\[]+)/i)
? title?.match(/^Download\s+([^(\[]+)/i)?.[1] || ""
: title.replace("Download", "") || "",
image,
imdbId: "",
synopsis: title,
type: "",
linkList: episodes,
};
}
catch (error) {
console.error(error);
return {
title: "",
image: "",
imdbId: "",
synopsis: "",
linkList: [],
type: "uhd",
};
}
// console.log(episodes);
return {
title: title.match(/^Download\s+([^(\[]+)/i)
? ((_b = title === null || title === void 0 ? void 0 : title.match(/^Download\s+([^(\[]+)/i)) === null || _b === void 0 ? void 0 : _b[1]) || ""
: title.replace("Download", "") || "",
image,
imdbId: "",
synopsis: title,
type: "",
linkList: episodes,
};
}
catch (error) {
console.error(error);
return {
title: "",
image: "",
imdbId: "",
synopsis: "",
linkList: [],
type: "uhd",
};
}
});
};
exports.getMeta = getMeta;

81
dist/uhd/posts.js vendored
View File

@@ -1,4 +1,13 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSearchPosts = exports.getPosts = void 0;
const headers = {
@@ -16,50 +25,52 @@ const headers = {
"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",
};
const getPosts = async ({ filter, page,
const getPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ filter, page,
// providerValue,
signal, providerContext, }) => {
signal, providerContext, }) {
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("UhdMovies");
const baseUrl = yield getBaseUrl("UhdMovies");
const url = page === 1 ? `${baseUrl}/${filter}/` : `${baseUrl + filter}/page/${page}/`;
console.log("url", url);
return posts(baseUrl, url, signal, providerContext);
};
});
exports.getPosts = getPosts;
const getSearchPosts = async ({ searchQuery, page,
const getSearchPosts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ searchQuery, page,
// providerValue,
signal, providerContext, }) => {
signal, providerContext, }) {
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl("UhdMovies");
const baseUrl = yield getBaseUrl("UhdMovies");
const url = `${baseUrl}/search/${searchQuery}/page/${page}/`;
return posts(baseUrl, url, signal, providerContext);
};
});
exports.getSearchPosts = getSearchPosts;
async function posts(baseURL, url, signal, providerContext) {
try {
const { axios, cheerio } = providerContext;
const res = await axios.get(url, { headers, signal });
const html = res.data;
const $ = cheerio.load(html);
const uhdCatalog = [];
$(".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");
if (title && link && image) {
uhdCatalog.push({
title: title.replace("Download", "").trim(),
link: link,
image: image,
});
}
});
return uhdCatalog;
}
catch (err) {
console.error("uhd error ", err);
return [];
}
function posts(baseURL, url, signal, providerContext) {
return __awaiter(this, void 0, void 0, function* () {
try {
const { axios, cheerio } = providerContext;
const res = yield axios.get(url, { headers, signal });
const html = res.data;
const $ = cheerio.load(html);
const uhdCatalog = [];
$(".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");
if (title && link && image) {
uhdCatalog.push({
title: title.replace("Download", "").trim(),
link: link,
image: image,
});
}
});
return uhdCatalog;
}
catch (err) {
console.error("uhd error ", err);
return [];
}
});
}

134
dist/uhd/stream.js vendored
View File

@@ -1,4 +1,13 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStream = void 0;
const headers = {
@@ -16,17 +25,18 @@ const headers = {
"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",
};
const getStream = async ({ link: url, providerContext, }) => {
const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link: url, providerContext, }) {
var _b, _c;
try {
const { axios, cheerio } = providerContext;
let downloadLink = await modExtractor(url, providerContext);
let downloadLink = yield modExtractor(url, providerContext);
// console.log(downloadLink.data);
const ddl = downloadLink?.data?.match(/content="0;url=(.*?)"/)?.[1] || url;
const ddl = ((_c = (_b = downloadLink === null || downloadLink === void 0 ? void 0 : downloadLink.data) === null || _b === void 0 ? void 0 : _b.match(/content="0;url=(.*?)"/)) === null || _c === void 0 ? void 0 : _c[1]) || url;
console.log("ddl", ddl);
// console.log(ddl);
const driveLink = await isDriveLink(ddl);
const driveLink = yield isDriveLink(ddl);
const ServerLinks = [];
const driveRes = await axios.get(driveLink, { headers });
const driveRes = yield axios.get(driveLink, { headers });
const driveHtml = driveRes.data;
const $drive = cheerio.load(driveHtml);
//instant link
@@ -38,14 +48,14 @@ const getStream = async ({ link: url, providerContext, }) => {
InstantFromData.append("keys", instantToken);
const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log('videoSeedUrl', videoSeedUrl);
const instantLinkRes = await fetch(videoSeedUrl, {
const instantLinkRes = yield fetch(videoSeedUrl, {
method: "POST",
body: InstantFromData,
headers: {
"x-token": videoSeedUrl,
},
});
const instantLinkData = await instantLinkRes.json();
const instantLinkData = yield instantLinkRes.json();
// console.log('instantLinkData', instantLinkData);
if (instantLinkData.error === false) {
const instantLink = instantLinkData.url;
@@ -66,7 +76,7 @@ const getStream = async ({ link: url, providerContext, }) => {
try {
const resumeDrive = driveLink.replace("/file", "/zfile");
// console.log('resumeDrive', resumeDrive);
const resumeDriveRes = await axios.get(resumeDrive, { headers });
const resumeDriveRes = yield axios.get(resumeDrive, { headers });
const resumeDriveHtml = resumeDriveRes.data;
const $resumeDrive = cheerio.load(resumeDriveHtml);
const resumeLink = $resumeDrive(".btn-success").attr("href");
@@ -85,12 +95,13 @@ const getStream = async ({ link: url, providerContext, }) => {
// CF workers type 1
try {
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1";
const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
const cfWorkersRes = yield axios.get(cfWorkersLink, { headers });
const cfWorkersHtml = cfWorkersRes.data;
const $cfWorkers = cheerio.load(cfWorkersHtml);
const cfWorkersStream = $cfWorkers(".btn-success");
cfWorkersStream.each((i, el) => {
const link = el.attribs?.href;
var _a;
const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href;
if (link) {
ServerLinks.push({
server: "Cf Worker 1." + i,
@@ -106,12 +117,13 @@ const getStream = async ({ link: url, providerContext, }) => {
// CF workers type 2
try {
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=2";
const cfWorkersRes = await axios.get(cfWorkersLink, { headers });
const cfWorkersRes = yield axios.get(cfWorkersLink, { headers });
const cfWorkersHtml = cfWorkersRes.data;
const $cfWorkers = cheerio.load(cfWorkersHtml);
const cfWorkersStream = $cfWorkers(".btn-success");
cfWorkersStream.each((i, el) => {
const link = el.attribs?.href;
var _a;
const link = (_a = el.attribs) === null || _a === void 0 ? void 0 : _a.href;
if (link) {
ServerLinks.push({
server: "Cf Worker 2." + i,
@@ -131,14 +143,14 @@ const getStream = async ({ link: url, providerContext, }) => {
console.log("getStream error", err);
return [];
}
};
});
exports.getStream = getStream;
const isDriveLink = async (ddl) => {
const isDriveLink = (ddl) => __awaiter(void 0, void 0, void 0, function* () {
if (ddl.includes("drive")) {
const driveLeach = await fetch(ddl);
const driveLeachData = await driveLeach.text();
const driveLeach = yield fetch(ddl);
const driveLeachData = yield driveLeach.text();
const pathMatch = driveLeachData.match(/window\.location\.replace\("([^"]+)"\)/);
const path = pathMatch?.[1];
const path = pathMatch === null || pathMatch === void 0 ? void 0 : pathMatch[1];
const mainUrl = ddl.split("/")[2];
console.log(`driveUrl = https://${mainUrl}${path}`);
return `https://${mainUrl}${path}`;
@@ -146,47 +158,49 @@ const isDriveLink = async (ddl) => {
else {
return ddl;
}
};
async function modExtractor(url, providerContext) {
const { axios, cheerio } = providerContext;
try {
const wpHttp = url.split("sid=")[1];
var bodyFormData0 = new FormData();
bodyFormData0.append("_wp_http", wpHttp);
const res = await fetch(url.split("?")[0], {
method: "POST",
body: bodyFormData0,
});
const data = await res.text();
// console.log('', data);
const html = data;
const $ = cheerio.load(html);
// find input with name="_wp_http2"
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];
const res2 = await fetch(formUrl, {
method: "POST",
body: bodyFormData,
});
const html2 = await res2.text();
const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1];
console.log(link);
const cookie = link.split("=")[1];
console.log("cookie", cookie);
const downloadLink = await axios.get(link, {
headers: {
Referer: formUrl,
Cookie: `${cookie}=${wpHttp2}`,
},
});
return downloadLink;
}
catch (err) {
console.log("modGetStream error", err);
}
});
function modExtractor(url, providerContext) {
return __awaiter(this, void 0, void 0, function* () {
const { axios, cheerio } = providerContext;
try {
const wpHttp = url.split("sid=")[1];
var bodyFormData0 = new FormData();
bodyFormData0.append("_wp_http", wpHttp);
const res = yield fetch(url.split("?")[0], {
method: "POST",
body: bodyFormData0,
});
const data = yield res.text();
// console.log('', data);
const html = data;
const $ = cheerio.load(html);
// find input with name="_wp_http2"
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];
const res2 = yield fetch(formUrl, {
method: "POST",
body: bodyFormData,
});
const html2 = yield res2.text();
const link = html2.match(/setAttribute\("href",\s*"(.*?)"/)[1];
console.log(link);
const cookie = link.split("=")[1];
console.log("cookie", cookie);
const downloadLink = yield axios.get(link, {
headers: {
Referer: formUrl,
Cookie: `${cookie}=${wpHttp2}`,
},
});
return downloadLink;
}
catch (err) {
console.log("modGetStream error", err);
}
});
}