This commit is contained in:
himanshu8443
2025-06-15 21:29:40 +05:30
commit 3f3e12f5df
299 changed files with 18729 additions and 0 deletions

63
dist/drive/catalog.js vendored Normal file
View File

@@ -0,0 +1,63 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.driveGenresList = exports.driveCatalog = void 0;
exports.driveCatalog = [
{
title: 'Latest',
filter: '',
},
{
title: 'Anime',
filter: 'category/anime/',
},
{
title: 'Netflix',
filter: 'category/netflix/',
},
{
title: '4K',
filter: 'category/2160p-4k/',
},
];
exports.driveGenresList = [
{
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',
},
];

34
dist/drive/driveGetEpisodesList.js vendored Normal file
View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.driveGetEpisodeLinks = void 0;
const driveGetEpisodeLinks = async function ({ url, providerContext, }) {
try {
const { axios, cheerio } = providerContext;
const res = await 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.driveGetEpisodeLinks = driveGetEpisodeLinks;

72
dist/drive/driveGetInfo.js vendored Normal file
View File

@@ -0,0 +1,72 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.driveGetInfo = void 0;
const driveGetInfo = async function ({ link, providerContext, }) {
try {
const { axios, cheerio } = providerContext;
const url = link;
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const type = $('.left-wrapper')
.text()
.toLocaleLowerCase()
.includes('movie name')
? 'movie'
: 'series';
const imdbId = $('a:contains("IMDb")').attr('href')?.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) => {
const title = $(element).parent('h5').prev().text();
const episodesLink = $(element).attr('href');
const quality = title.match(/\b(480p|720p|1080p|2160p)\b/i)?.[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.driveGetInfo = driveGetInfo;

45
dist/drive/driveGetPosts.js vendored Normal file
View File

@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.driveGetSearchPost = exports.driveGetPosts = void 0;
const driveGetPosts = async function ({ filter, page, signal, providerContext, }) {
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('drive');
const url = `${baseUrl + filter}/page/${page}/`;
return posts({ url, signal, providerContext });
};
exports.driveGetPosts = driveGetPosts;
const driveGetSearchPost = async function ({ searchQuery, page, signal, providerContext, }) {
const { getBaseUrl } = providerContext;
const baseUrl = await getBaseUrl('drive');
const url = `${baseUrl}page/${page}/?s=${searchQuery}`;
return posts({ url, signal, providerContext });
};
exports.driveGetSearchPost = driveGetSearchPost;
async function posts({ url, signal, providerContext, }) {
try {
const { cheerio } = providerContext;
const res = await fetch(url, { signal });
const data = await 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 [];
}
}

33
dist/drive/driveGetStream.js vendored Normal file
View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.driveGetStream = void 0;
const driveGetStream = async function ({ link: url, type, signal, providerContext, }) {
const headers = providerContext.commonHeaders;
try {
if (type === 'movie') {
const res = await 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 = await providerContext.axios.get(url, { headers });
let redirectUrl = res.data.match(/<meta\s+http-equiv="refresh"\s+content="[^"]*?;\s*url=([^"]+)"\s*\/?>/i)?.[1];
if (url.includes('/archives/')) {
redirectUrl = res.data.match(/<a\s+[^>]*href="(https:\/\/hubcloud\.[^\/]+\/[^"]+)"/i)?.[1];
}
if (!redirectUrl) {
return await providerContext.extractors.hubcloudExtracter(url, signal);
}
const res2 = await providerContext.axios.get(redirectUrl, { headers });
const data = res2.data;
const $ = providerContext.cheerio.load(data);
const hubcloudLink = $('.fa-file-download').parent().attr('href');
return await providerContext.extractors.hubcloudExtracter(hubcloudLink?.includes('https://hubcloud') ? hubcloudLink : redirectUrl, signal);
}
catch (err) {
console.error('Movies Drive err', err);
return [];
}
};
exports.driveGetStream = driveGetStream;

17
dist/drive/index.js vendored Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.moviesDrive = void 0;
const catalog_1 = require("./catalog");
const driveGetEpisodesList_1 = require("./driveGetEpisodesList");
const driveGetInfo_1 = require("./driveGetInfo");
const driveGetPosts_1 = require("./driveGetPosts");
const driveGetStream_1 = require("./driveGetStream");
exports.moviesDrive = {
catalog: catalog_1.driveCatalog,
genres: catalog_1.driveGenresList,
GetMetaData: driveGetInfo_1.driveGetInfo,
GetHomePosts: driveGetPosts_1.driveGetPosts,
GetStream: driveGetStream_1.driveGetStream,
GetEpisodeLinks: driveGetEpisodesList_1.driveGetEpisodeLinks,
GetSearchPosts: driveGetPosts_1.driveGetSearchPost,
};