This commit is contained in:
himanshu8443
2025-07-11 19:45:14 +05:30
parent 13f71510d5
commit 35f1e57a0b
139 changed files with 10578 additions and 139 deletions

64
dist/drive/catalog.js vendored
View File

@@ -1 +1,63 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Latest",filter:""},{title:"Anime",filter:"category/anime/"},{title:"Netflix",filter:"category/netflix/"},{title:"4K",filter:"category/2160p-4k/"}],exports.genres=[{title:"Action",filter:"/category/action"},{title:"Crime",filter:"/category/crime"},{title:"Comedy",filter:"/category/comedy"},{title:"Drama",filter:"/category/drama"},{title:"Horror",filter:"/category/horror"},{title:"Family",filter:"/category/family"},{title:"Sci-Fi",filter:"/category/sifi"},{title:"Thriller",filter:"/category/triller"},{title:"Romance",filter:"/category/romance"},{title:"Fight",filter:"/category/fight"}];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.genres = exports.catalog = void 0;
exports.catalog = [
{
title: "Latest",
filter: "",
},
{
title: "Anime",
filter: "category/anime/",
},
{
title: "Netflix",
filter: "category/netflix/",
},
{
title: "4K",
filter: "category/2160p-4k/",
},
];
exports.genres = [
{
title: "Action",
filter: "/category/action",
},
{
title: "Crime",
filter: "/category/crime",
},
{
title: "Comedy",
filter: "/category/comedy",
},
{
title: "Drama",
filter: "/category/drama",
},
{
title: "Horror",
filter: "/category/horror",
},
{
title: "Family",
filter: "/category/family",
},
{
title: "Sci-Fi",
filter: "/category/sifi",
},
{
title: "Thriller",
filter: "/category/triller",
},
{
title: "Romance",
filter: "/category/romance",
},
{
title: "Fight",
filter: "/category/fight",
},
];

View File

@@ -1 +1,45 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(i,r){function s(t){try{c(o.next(t))}catch(t){r(t)}}function a(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((o=o.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(t){return __awaiter(this,arguments,void 0,function*({url:t,providerContext:e}){try{const{axios:n,cheerio:o}=e,i=(yield n.get(t)).data;let r=o.load(i);const s=[];return r('a:contains("HubCloud")').map((t,e)=>{const n=r(e).parent().prev().text(),o=r(e).attr("href");o&&(n.includes("Ep")||n.includes("Download"))&&s.push({title:n.includes("Download")?"Play":n,link:o})}),s}catch(e){return[{title:"Server 1",link:t}]}})};exports.getEpisodes=getEpisodes;
"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.getEpisodes = void 0;
const getEpisodes = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) {
try {
const { axios, cheerio } = providerContext;
const res = yield axios.get(url);
const html = res.data;
let $ = cheerio.load(html);
const episodeLinks = [];
$('a:contains("HubCloud")').map((i, element) => {
const title = $(element).parent().prev().text();
const link = $(element).attr("href");
if (link && (title.includes("Ep") || title.includes("Download"))) {
episodeLinks.push({
title: title.includes("Download") ? "Play" : title,
link,
});
}
});
// console.log(episodeLinks);
return episodeLinks;
}
catch (err) {
console.error(err);
return [
{
title: "Server 1",
link: url,
},
];
}
});
};
exports.getEpisodes = getEpisodes;

86
dist/drive/meta.js vendored
View File

@@ -1 +1,85 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(a,o){function r(t){try{c(i.next(t))}catch(t){o(t)}}function s(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(r,s)}c((i=i.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(t){return __awaiter(this,arguments,void 0,function*({link:t,providerContext:e}){var n;try{const{axios:i,cheerio:a}=e,o=t,r=(yield i.get(o)).data,s=a.load(r),c=s(".left-wrapper").text().toLocaleLowerCase().includes("movie name")?"movie":"series",p=(null===(n=s('a:contains("IMDb")').attr("href"))||void 0===n?void 0:n.split("/")[4])||"",l=s(".left-wrapper").find('strong:contains("Name")').next().text()||s(".left-wrapper").find('strong:contains("Name"),h5:contains("Name")').find("span:first").text(),d=s(".left-wrapper").find('h2:contains("Storyline"),h3:contains("Storyline"),h5:contains("Storyline"),h4:contains("Storyline"),h4:contains("STORYLINE")').next().text()||s(".ipc-html-content-inner-div").text()||"",u=s("img.entered.lazyloaded,img.entered,img.litespeed-loaded").attr("src")||s("img.aligncenter").attr("src")||"",v=[];return s('a:contains("1080")a:not(:contains("Zip")),a:contains("720")a:not(:contains("Zip")),a:contains("480")a:not(:contains("Zip")),a:contains("2160")a:not(:contains("Zip")),a:contains("4k")a:not(:contains("Zip"))').map((t,e)=>{var n;const i=s(e).parent("h5").prev().text(),a=s(e).attr("href"),o=(null===(n=i.match(/\b(480p|720p|1080p|2160p)\b/i))||void 0===n?void 0:n[0])||"";a&&i&&v.push({title:i,episodesLink:"series"===c?a:"",directLinks:"movie"===c?[{title:"Movie",link:a,type:"movie"}]:[],quality:o})}),{title:l,synopsis:d,image:u,imdbId:p,type:c,linkList:v}}catch(t){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
"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 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);
const data = res.data;
const $ = cheerio.load(data);
const type = $(".left-wrapper")
.text()
.toLocaleLowerCase()
.includes("movie name")
? "movie"
: "series";
const imdbId = ((_b = $('a:contains("IMDb")').attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || "";
const title = $(".left-wrapper").find('strong:contains("Name")').next().text() ||
$(".left-wrapper")
.find('strong:contains("Name"),h5:contains("Name")')
.find("span:first")
.text();
const synopsis = $(".left-wrapper")
.find('h2:contains("Storyline"),h3:contains("Storyline"),h5:contains("Storyline"),h4:contains("Storyline"),h4:contains("STORYLINE")')
.next()
.text() ||
$(".ipc-html-content-inner-div").text() ||
"";
const image = $("img.entered.lazyloaded,img.entered,img.litespeed-loaded").attr("src") ||
$("img.aligncenter").attr("src") ||
"";
// Links
const links = [];
$('a:contains("1080")a:not(:contains("Zip")),a:contains("720")a:not(:contains("Zip")),a:contains("480")a:not(:contains("Zip")),a:contains("2160")a:not(:contains("Zip")),a:contains("4k")a:not(:contains("Zip"))').map((i, element) => {
var _a;
const title = $(element).parent("h5").prev().text();
const episodesLink = $(element).attr("href");
const quality = ((_a = title.match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || "";
if (episodesLink && title) {
links.push({
title,
episodesLink: type === "series" ? episodesLink : "",
directLinks: type === "movie"
? [{ title: "Movie", link: episodesLink, type: "movie" }]
: [],
quality: quality,
});
}
});
// console.log('drive meta', title, synopsis, image, imdbId, type, links);
console.log("drive meta", links, type);
return {
title,
synopsis,
image,
imdbId,
type,
linkList: links,
};
}
catch (err) {
console.error(err);
return {
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}
});
};
exports.getMeta = getMeta;

61
dist/drive/posts.js vendored
View File

@@ -1 +1,60 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,a)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(t){return __awaiter(this,arguments,void 0,function*({filter:t,page:e,signal:r,providerContext:n}){const{getBaseUrl:i}=n;return posts({url:`${(yield i("drive"))+t}/page/${e}/`,signal:r,providerContext:n})})};exports.getPosts=getPosts;const getSearchPosts=function(t){return __awaiter(this,arguments,void 0,function*({searchQuery:t,page:e,signal:r,providerContext:n}){const{getBaseUrl:i}=n;return posts({url:`${yield i("drive")}page/${e}/?s=${t}`,signal:r,providerContext:n})})};function posts(t){return __awaiter(this,arguments,void 0,function*({url:t,signal:e,providerContext:r}){try{const{cheerio:n}=r,i=yield fetch(t,{signal:e}),o=yield i.text(),s=n.load(o),a=[];return s(".recent-movies").children().map((t,e)=>{const r=s(e).find("figure").find("img").attr("alt"),n=s(e).find("a").attr("href"),i=s(e).find("figure").find("img").attr("src");r&&n&&i&&a.push({title:r.replace("Download","").trim(),link:n,image:i})}),a}catch(t){return[]}})}exports.getSearchPosts=getSearchPosts;
"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 getPosts = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) {
const { getBaseUrl } = providerContext;
const baseUrl = yield getBaseUrl("drive");
const url = `${baseUrl + filter}/page/${page}/`;
return posts({ url, signal, providerContext });
});
};
exports.getPosts = getPosts;
const getSearchPosts = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) {
const { getBaseUrl } = providerContext;
const baseUrl = yield getBaseUrl("drive");
const url = `${baseUrl}page/${page}/?s=${searchQuery}`;
return posts({ url, signal, providerContext });
});
};
exports.getSearchPosts = getSearchPosts;
function posts(_a) {
return __awaiter(this, arguments, void 0, function* ({ url, signal, providerContext, }) {
try {
const { cheerio } = providerContext;
const res = yield fetch(url, { signal });
const data = yield res.text();
const $ = cheerio.load(data);
const catalog = [];
$(".recent-movies")
.children()
.map((i, element) => {
const title = $(element).find("figure").find("img").attr("alt");
const link = $(element).find("a").attr("href");
const image = $(element).find("figure").find("img").attr("src");
if (title && link && image) {
catalog.push({
title: title.replace("Download", "").trim(),
link: link,
image: image,
});
}
});
return catalog;
}
catch (err) {
console.error("drive error ", err);
return [];
}
});
}

46
dist/drive/stream.js vendored
View File

@@ -1 +1,45 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,a){return new(r||(r=Promise))(function(o,n){function i(t){try{s(a.next(t))}catch(t){n(t)}}function c(t){try{s(a.throw(t))}catch(t){n(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(i,c)}s((a=a.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(t){return __awaiter(this,arguments,void 0,function*({link:t,type:e,signal:r,providerContext:a}){var o,n;const i=a.commonHeaders;try{if("movie"===e){const e=(yield a.axios.get(t,{headers:i})).data,r=a.cheerio.load(e);t=r('a:contains("HubCloud")').attr("href")||t}const c=yield a.axios.get(t,{headers:i});let s=null===(o=c.data.match(/<meta\s+http-equiv="refresh"\s+content="[^"]*?;\s*url=([^"]+)"\s*\/?>/i))||void 0===o?void 0:o[1];if(t.includes("/archives/")&&(s=null===(n=c.data.match(/<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i))||void 0===n?void 0:n[1]),!s)return yield a.extractors.hubcloudExtracter(t,r);const d=(yield a.axios.get(s,{headers:i})).data,u=a.cheerio.load(d)(".fa-file-download").parent().attr("href");return yield a.extractors.hubcloudExtracter((null==u?void 0:u.includes("https://hubcloud"))?u:s,r)}catch(t){return[]}})};exports.getStream=getStream;
"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 getStream = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link: url, type, signal, providerContext, }) {
var _b, _c;
const headers = providerContext.commonHeaders;
try {
if (type === "movie") {
const res = yield providerContext.axios.get(url, { headers });
const html = res.data;
const $ = providerContext.cheerio.load(html);
const link = $('a:contains("HubCloud")').attr("href");
url = link || url;
}
const res = yield providerContext.axios.get(url, { headers });
let redirectUrl = (_b = res.data.match(/<meta\s+http-equiv="refresh"\s+content="[^"]*?;\s*url=([^"]+)"\s*\/?>/i)) === null || _b === void 0 ? void 0 : _b[1];
if (url.includes("/archives/")) {
redirectUrl = (_c = res.data.match(/<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i)) === null || _c === void 0 ? void 0 : _c[1];
}
if (!redirectUrl) {
return yield providerContext.extractors.hubcloudExtracter(url, signal);
}
const res2 = yield providerContext.axios.get(redirectUrl, { headers });
const data = res2.data;
const $ = providerContext.cheerio.load(data);
const hubcloudLink = $(".fa-file-download").parent().attr("href");
return yield providerContext.extractors.hubcloudExtracter((hubcloudLink === null || hubcloudLink === void 0 ? void 0 : hubcloudLink.includes("https://hubcloud")) ? hubcloudLink : redirectUrl, signal);
}
catch (err) {
console.error("Movies Drive err", err);
return [];
}
});
};
exports.getStream = getStream;