mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
build
This commit is contained in:
22
dist/autoEmbed/allCatalog.js
vendored
22
dist/autoEmbed/allCatalog.js
vendored
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.allGenresList = exports.allCatalog = void 0;
|
||||
exports.allCatalog = [
|
||||
{
|
||||
title: 'Popular Movies',
|
||||
filter: '/top/catalog/movie/top.json',
|
||||
},
|
||||
{
|
||||
title: 'Popular TV Shows',
|
||||
filter: '/top/catalog/series/top.json',
|
||||
},
|
||||
{
|
||||
title: 'Featured Movies',
|
||||
filter: '/imdbRating/catalog/movie/imdbRating.json',
|
||||
},
|
||||
{
|
||||
title: 'Featured TV Shows',
|
||||
filter: '/imdbRating/catalog/series/imdbRating.json',
|
||||
},
|
||||
];
|
||||
exports.allGenresList = [];
|
||||
89
dist/autoEmbed/allGetInfo.js
vendored
89
dist/autoEmbed/allGetInfo.js
vendored
@@ -1,89 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.allGetInfo = void 0;
|
||||
const allGetInfo = async function ({ link, providerContext, }) {
|
||||
const axios = providerContext.axios;
|
||||
try {
|
||||
console.log('all', link);
|
||||
const res = await axios.get(link);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: data?.meta?.imdb_id || '',
|
||||
type: data?.meta?.type || 'movie',
|
||||
};
|
||||
const links = [];
|
||||
let directLinks = [];
|
||||
let season = new Map();
|
||||
if (meta.type === 'series') {
|
||||
data?.meta?.videos?.map((video) => {
|
||||
if (video?.season <= 0)
|
||||
return;
|
||||
if (!season.has(video?.season)) {
|
||||
season.set(video?.season, []);
|
||||
}
|
||||
season.get(video?.season).push({
|
||||
title: 'Episode ' + video?.episode,
|
||||
type: 'series',
|
||||
link: JSON.stringify({
|
||||
title: data?.meta?.name,
|
||||
imdbId: data?.meta?.imdb_id,
|
||||
season: video?.id?.split(':')[1],
|
||||
episode: video?.id?.split(':')[2],
|
||||
type: data?.meta?.type,
|
||||
tmdbId: data?.meta?.moviedb_id?.toString() || '',
|
||||
year: data?.meta?.year,
|
||||
}),
|
||||
});
|
||||
});
|
||||
const keys = Array.from(season.keys());
|
||||
keys.sort();
|
||||
keys.map(key => {
|
||||
directLinks = season.get(key);
|
||||
links.push({
|
||||
title: `Season ${key}`,
|
||||
directLinks: directLinks,
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log('all meta Mv🔥🔥', meta);
|
||||
links.push({
|
||||
title: data?.meta?.name,
|
||||
directLinks: [
|
||||
{
|
||||
title: 'Movie',
|
||||
type: 'movie',
|
||||
link: JSON.stringify({
|
||||
title: data?.meta?.name,
|
||||
imdbId: data?.meta?.imdb_id,
|
||||
season: '',
|
||||
episode: '',
|
||||
type: data?.meta?.type,
|
||||
tmdbId: data?.meta?.moviedb_id?.toString() || '',
|
||||
year: data?.meta?.year,
|
||||
}),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
return {
|
||||
...meta,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.allGetInfo = allGetInfo;
|
||||
89
dist/autoEmbed/allGetPost.js
vendored
89
dist/autoEmbed/allGetPost.js
vendored
@@ -1,89 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.allGetSearchPosts = exports.allGetPost = void 0;
|
||||
const allGetPost = async function ({ filter, signal, providerContext, }) {
|
||||
try {
|
||||
const catalog = [];
|
||||
const url = 'https://cinemeta-catalogs.strem.io' + filter;
|
||||
console.log('allGetPostUrl', url);
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = res.data;
|
||||
data?.metas.map((result) => {
|
||||
const title = result?.name;
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const type = result?.type;
|
||||
const image = result?.poster;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log('catalog', catalog.length);
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('AutoEmbed error ', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.allGetPost = allGetPost;
|
||||
const allGetSearchPosts = async function ({ searchQuery, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
try {
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const catalog = [];
|
||||
const url1 = `https://v3-cinemeta.strem.io/catalog/series/top/search=${encodeURI(searchQuery)}.json`;
|
||||
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`;
|
||||
const res = await providerContext.axios.get(url1, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = res.data;
|
||||
data?.metas.map((result) => {
|
||||
const title = result.name || '';
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const image = result?.poster;
|
||||
const type = result?.type;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
const res2 = await providerContext.axios.get(url2, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data2 = res2.data;
|
||||
data2?.metas.map((result) => {
|
||||
const title = result?.name || '';
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const image = result?.poster;
|
||||
const type = result?.type;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('AutoEmbed error ', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.allGetSearchPosts = allGetSearchPosts;
|
||||
222
dist/autoEmbed/allGetStream.js
vendored
222
dist/autoEmbed/allGetStream.js
vendored
@@ -1,222 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.allGetStream = void 0;
|
||||
exports.getRiveStream = getRiveStream;
|
||||
const types_1 = require("../types");
|
||||
const allGetStream = async ({ link: id, type, providerContext, }) => {
|
||||
try {
|
||||
const streams = [];
|
||||
const { imdbId, season, episode, title, tmdbId, year } = JSON.parse(id);
|
||||
await getRiveStream(tmdbId, episode, season, type, streams, providerContext);
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.allGetStream = allGetStream;
|
||||
async function getRiveStream(tmdId, episode, season, type, Streams, providerContext) {
|
||||
const secret = generateSecretKey(Number(tmdId));
|
||||
const servers = [
|
||||
'flowcast',
|
||||
'shadow',
|
||||
'asiacloud',
|
||||
'hindicast',
|
||||
'anime',
|
||||
'animez',
|
||||
'guard',
|
||||
'curve',
|
||||
'hq',
|
||||
'ninja',
|
||||
'alpha',
|
||||
'kaze',
|
||||
'zenesis',
|
||||
'genesis',
|
||||
'zenith',
|
||||
'ghost',
|
||||
'halo',
|
||||
'kinoecho',
|
||||
'ee3',
|
||||
'volt',
|
||||
'putafilme',
|
||||
'ophim',
|
||||
'kage',
|
||||
];
|
||||
const baseUrl = await providerContext.getBaseUrl('rive');
|
||||
const cors = process.env.CORS_PRXY ? process.env.CORS_PRXY + '?url=' : '';
|
||||
console.log('CORS: ' + cors);
|
||||
const route = type === 'series'
|
||||
? `/api/backendfetch?requestID=tvVideoProvider&id=${tmdId}&season=${season}&episode=${episode}&secretKey=${secret}&service=`
|
||||
: `/api/backendfetch?requestID=movieVideoProvider&id=${tmdId}&secretKey=${secret}&service=`;
|
||||
const url = cors
|
||||
? cors + encodeURIComponent(baseUrl + route)
|
||||
: baseUrl + route;
|
||||
await Promise.all(servers.map(async (server) => {
|
||||
console.log('Rive: ' + url + server);
|
||||
try {
|
||||
const res = await providerContext.axios.get(url + server, {
|
||||
timeout: 4000,
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const subtitles = [];
|
||||
if (res.data?.data?.captions) {
|
||||
res.data?.data?.captions.forEach((sub) => {
|
||||
subtitles.push({
|
||||
language: sub?.label?.slice(0, 2) || 'Und',
|
||||
uri: sub?.file,
|
||||
title: sub?.label || 'Undefined',
|
||||
type: sub?.file?.endsWith('.vtt')
|
||||
? types_1.TextTrackType.VTT
|
||||
: types_1.TextTrackType.SUBRIP,
|
||||
});
|
||||
});
|
||||
}
|
||||
res.data?.data?.sources.forEach((source) => {
|
||||
Streams.push({
|
||||
server: source?.source + '-' + source?.quality,
|
||||
link: source?.url,
|
||||
type: source?.format === 'hls' ? 'm3u8' : 'mp4',
|
||||
quality: source?.quality,
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}));
|
||||
}
|
||||
function generateSecretKey(id) {
|
||||
// Array of secret key fragments - updated array from the new implementation
|
||||
const c = [
|
||||
'Yhv40uKAZa',
|
||||
'nn8YU4yBA',
|
||||
'uNeH',
|
||||
'ehK',
|
||||
'jT0',
|
||||
'n5G',
|
||||
'99R',
|
||||
'MvB1M',
|
||||
'DQtPCh',
|
||||
'GBRjk4k4I',
|
||||
'CzIOoa95UT',
|
||||
'BLE8s',
|
||||
'GDZlc7',
|
||||
'Fz45T',
|
||||
'JW6lWn',
|
||||
'DE3g4uw0i',
|
||||
'18KxmYizv',
|
||||
'8ji',
|
||||
'JUDdNMnZ',
|
||||
'oGpBippPgm',
|
||||
'7De8Pg',
|
||||
'Zv6',
|
||||
'VHT9TVN',
|
||||
'bYH6m',
|
||||
'aK1',
|
||||
'WcWH6jU',
|
||||
'Q47YEMi4k',
|
||||
'vRD3A',
|
||||
'CGOsfJO',
|
||||
'BLn8',
|
||||
'RgK0drv7l',
|
||||
'oPTfGCn3a',
|
||||
'MkpMDkttW9',
|
||||
'VNI1fPM',
|
||||
'XNFi6',
|
||||
'6cq',
|
||||
'4LvTksXoEI',
|
||||
'1rRa2KOZB0',
|
||||
'zoOGRb8HT2',
|
||||
'mhcXDtvz',
|
||||
'NUmexFY2Ur',
|
||||
'6BIMdvSZ',
|
||||
'Tr0zU2vjRd',
|
||||
'QPR',
|
||||
'fhOqJR',
|
||||
'R9VnFY',
|
||||
'xkZ99D6S',
|
||||
'umY7E',
|
||||
'5Ds8qyDq',
|
||||
'Cc6jy09y3',
|
||||
'yvU3iR',
|
||||
'Bg07zY',
|
||||
'GccECglg',
|
||||
'VYd',
|
||||
'6vOiXqz',
|
||||
'7xX',
|
||||
'UdRrbEzF',
|
||||
'fE6wc',
|
||||
'BUd25Rb',
|
||||
'lxq5Zum89o',
|
||||
];
|
||||
// Handle undefined input
|
||||
if (id === undefined) {
|
||||
return 'rive';
|
||||
}
|
||||
try {
|
||||
let fragment, insertPos;
|
||||
// Convert input to string
|
||||
const idStr = String(id);
|
||||
// Updated string hash function to match the new implementation
|
||||
/* eslint-disable no-bitwise */
|
||||
const generateStringHash = function (input) {
|
||||
input = String(input);
|
||||
let hash = 0;
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
const char = input.charCodeAt(i);
|
||||
hash =
|
||||
((char + (hash << 6) + (hash << 16) - hash) ^ (char << i % 5)) >>> 0;
|
||||
}
|
||||
hash ^= hash >>> 13;
|
||||
hash = (1540483477 * hash) >>> 0;
|
||||
return (hash ^= hash >>> 15).toString(16).padStart(8, '0');
|
||||
};
|
||||
// Updated MurmurHash-like function to match the new implementation
|
||||
const applyMurmurHash = function (input) {
|
||||
const str = String(input);
|
||||
let hash = 3735928559 ^ str.length;
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
let char = str.charCodeAt(i);
|
||||
char ^= ((i + 31) * 131) & 255;
|
||||
hash =
|
||||
(668265261 *
|
||||
(hash = (((hash << 7) | (hash >>> 25)) >>> 0) ^ char)) >>>
|
||||
0;
|
||||
}
|
||||
hash ^= hash >>> 16;
|
||||
hash = (2246822507 * hash) >>> 0;
|
||||
hash ^= hash >>> 13;
|
||||
hash = (3266489909 * hash) >>> 0;
|
||||
return (hash ^= hash >>> 16).toString(16).padStart(8, '0');
|
||||
};
|
||||
/* eslint-enable no-bitwise */
|
||||
// Generate the encoded hash using the new implementation
|
||||
const encodedHash = btoa(applyMurmurHash(generateStringHash(idStr)));
|
||||
// Different handling for non-numeric vs numeric inputs
|
||||
if (isNaN(Number(id))) {
|
||||
// For non-numeric inputs, sum the character codes
|
||||
const charSum = idStr
|
||||
.split('')
|
||||
.reduce((sum, char) => sum + char.charCodeAt(0), 0);
|
||||
// Select array element or fallback to base64 encoded input
|
||||
fragment = c[charSum % c.length] || btoa(idStr);
|
||||
// Calculate insertion position
|
||||
insertPos = Math.floor((charSum % encodedHash.length) / 2);
|
||||
}
|
||||
else {
|
||||
// For numeric inputs, use the number directly
|
||||
const numId = Number(id);
|
||||
fragment = c[numId % c.length] || btoa(idStr);
|
||||
// Calculate insertion position
|
||||
insertPos = Math.floor((numId % encodedHash.length) / 2);
|
||||
}
|
||||
// Construct the final key by inserting the selected value into the base64 string
|
||||
return (encodedHash.slice(0, insertPos) + fragment + encodedHash.slice(insertPos));
|
||||
}
|
||||
catch (error) {
|
||||
// Return fallback value if any errors occur
|
||||
return 'topSecret';
|
||||
}
|
||||
}
|
||||
22
dist/autoEmbed/catalog.js
vendored
22
dist/autoEmbed/catalog.js
vendored
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Popular Movies",
|
||||
filter: "/top/catalog/movie/top.json",
|
||||
},
|
||||
{
|
||||
title: "Popular TV Shows",
|
||||
filter: "/top/catalog/series/top.json",
|
||||
},
|
||||
{
|
||||
title: "Featured Movies",
|
||||
filter: "/imdbRating/catalog/movie/imdbRating.json",
|
||||
},
|
||||
{
|
||||
title: "Featured TV Shows",
|
||||
filter: "/imdbRating/catalog/series/imdbRating.json",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
15
dist/autoEmbed/index.js
vendored
15
dist/autoEmbed/index.js
vendored
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.autoEmbed = void 0;
|
||||
const allCatalog_1 = require("./allCatalog");
|
||||
const allGetInfo_1 = require("./allGetInfo");
|
||||
const allGetStream_1 = require("./allGetStream");
|
||||
const allGetPost_1 = require("./allGetPost");
|
||||
exports.autoEmbed = {
|
||||
catalog: allCatalog_1.allCatalog,
|
||||
genres: allCatalog_1.allGenresList,
|
||||
GetMetaData: allGetInfo_1.allGetInfo,
|
||||
GetHomePosts: allGetPost_1.allGetPost,
|
||||
GetStream: allGetStream_1.allGetStream,
|
||||
GetSearchPosts: allGetPost_1.allGetSearchPosts,
|
||||
};
|
||||
89
dist/autoEmbed/meta.js
vendored
89
dist/autoEmbed/meta.js
vendored
@@ -1,89 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
const axios = providerContext.axios;
|
||||
try {
|
||||
console.log("all", link);
|
||||
const res = await axios.get(link);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: data?.meta?.imdb_id || "",
|
||||
type: data?.meta?.type || "movie",
|
||||
};
|
||||
const links = [];
|
||||
let directLinks = [];
|
||||
let season = new Map();
|
||||
if (meta.type === "series") {
|
||||
data?.meta?.videos?.map((video) => {
|
||||
if (video?.season <= 0)
|
||||
return;
|
||||
if (!season.has(video?.season)) {
|
||||
season.set(video?.season, []);
|
||||
}
|
||||
season.get(video?.season).push({
|
||||
title: "Episode " + video?.episode,
|
||||
type: "series",
|
||||
link: JSON.stringify({
|
||||
title: data?.meta?.name,
|
||||
imdbId: data?.meta?.imdb_id,
|
||||
season: video?.id?.split(":")[1],
|
||||
episode: video?.id?.split(":")[2],
|
||||
type: data?.meta?.type,
|
||||
tmdbId: data?.meta?.moviedb_id?.toString() || "",
|
||||
year: data?.meta?.year,
|
||||
}),
|
||||
});
|
||||
});
|
||||
const keys = Array.from(season.keys());
|
||||
keys.sort();
|
||||
keys.map((key) => {
|
||||
directLinks = season.get(key);
|
||||
links.push({
|
||||
title: `Season ${key}`,
|
||||
directLinks: directLinks,
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log("all meta Mv🔥🔥", meta);
|
||||
links.push({
|
||||
title: data?.meta?.name,
|
||||
directLinks: [
|
||||
{
|
||||
title: "Movie",
|
||||
type: "movie",
|
||||
link: JSON.stringify({
|
||||
title: data?.meta?.name,
|
||||
imdbId: data?.meta?.imdb_id,
|
||||
season: "",
|
||||
episode: "",
|
||||
type: data?.meta?.type,
|
||||
tmdbId: data?.meta?.moviedb_id?.toString() || "",
|
||||
year: data?.meta?.year,
|
||||
}),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
return {
|
||||
...meta,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
89
dist/autoEmbed/posts.js
vendored
89
dist/autoEmbed/posts.js
vendored
@@ -1,89 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, signal, providerContext, }) {
|
||||
try {
|
||||
const catalog = [];
|
||||
const url = "https://cinemeta-catalogs.strem.io" + filter;
|
||||
console.log("allGetPostUrl", url);
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = res.data;
|
||||
data?.metas.map((result) => {
|
||||
const title = result?.name;
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const type = result?.type;
|
||||
const image = result?.poster;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log("catalog", catalog.length);
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("AutoEmbed error ", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
try {
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const catalog = [];
|
||||
const url1 = `https://v3-cinemeta.strem.io/catalog/series/top/search=${encodeURI(searchQuery)}.json`;
|
||||
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`;
|
||||
const res = await providerContext.axios.get(url1, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = res.data;
|
||||
data?.metas.map((result) => {
|
||||
const title = result.name || "";
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const image = result?.poster;
|
||||
const type = result?.type;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
const res2 = await providerContext.axios.get(url2, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data2 = res2.data;
|
||||
data2?.metas.map((result) => {
|
||||
const title = result?.name || "";
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const image = result?.poster;
|
||||
const type = result?.type;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("AutoEmbed error ", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
222
dist/autoEmbed/stream.js
vendored
222
dist/autoEmbed/stream.js
vendored
@@ -1,222 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
exports.getRiveStream = getRiveStream;
|
||||
const types_1 = require("../types");
|
||||
const getStream = async ({ link: id, type, providerContext, }) => {
|
||||
try {
|
||||
const streams = [];
|
||||
const { imdbId, season, episode, title, tmdbId, year } = JSON.parse(id);
|
||||
await getRiveStream(tmdbId, episode, season, type, streams, providerContext);
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
async function getRiveStream(tmdId, episode, season, type, Streams, providerContext) {
|
||||
const secret = generateSecretKey(Number(tmdId));
|
||||
const servers = [
|
||||
"flowcast",
|
||||
"shadow",
|
||||
"asiacloud",
|
||||
"hindicast",
|
||||
"anime",
|
||||
"animez",
|
||||
"guard",
|
||||
"curve",
|
||||
"hq",
|
||||
"ninja",
|
||||
"alpha",
|
||||
"kaze",
|
||||
"zenesis",
|
||||
"genesis",
|
||||
"zenith",
|
||||
"ghost",
|
||||
"halo",
|
||||
"kinoecho",
|
||||
"ee3",
|
||||
"volt",
|
||||
"putafilme",
|
||||
"ophim",
|
||||
"kage",
|
||||
];
|
||||
const baseUrl = await providerContext.getBaseUrl("rive");
|
||||
const cors = process.env.CORS_PRXY ? process.env.CORS_PRXY + "?url=" : "";
|
||||
console.log("CORS: " + cors);
|
||||
const route = type === "series"
|
||||
? `/api/backendfetch?requestID=tvVideoProvider&id=${tmdId}&season=${season}&episode=${episode}&secretKey=${secret}&service=`
|
||||
: `/api/backendfetch?requestID=movieVideoProvider&id=${tmdId}&secretKey=${secret}&service=`;
|
||||
const url = cors
|
||||
? cors + encodeURIComponent(baseUrl + route)
|
||||
: baseUrl + route;
|
||||
await Promise.all(servers.map(async (server) => {
|
||||
console.log("Rive: " + url + server);
|
||||
try {
|
||||
const res = await providerContext.axios.get(url + server, {
|
||||
timeout: 4000,
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const subtitles = [];
|
||||
if (res.data?.data?.captions) {
|
||||
res.data?.data?.captions.forEach((sub) => {
|
||||
subtitles.push({
|
||||
language: sub?.label?.slice(0, 2) || "Und",
|
||||
uri: sub?.file,
|
||||
title: sub?.label || "Undefined",
|
||||
type: sub?.file?.endsWith(".vtt")
|
||||
? types_1.TextTrackType.VTT
|
||||
: types_1.TextTrackType.SUBRIP,
|
||||
});
|
||||
});
|
||||
}
|
||||
res.data?.data?.sources.forEach((source) => {
|
||||
Streams.push({
|
||||
server: source?.source + "-" + source?.quality,
|
||||
link: source?.url,
|
||||
type: source?.format === "hls" ? "m3u8" : "mp4",
|
||||
quality: source?.quality,
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}));
|
||||
}
|
||||
function generateSecretKey(id) {
|
||||
// Array of secret key fragments - updated array from the new implementation
|
||||
const c = [
|
||||
"Yhv40uKAZa",
|
||||
"nn8YU4yBA",
|
||||
"uNeH",
|
||||
"ehK",
|
||||
"jT0",
|
||||
"n5G",
|
||||
"99R",
|
||||
"MvB1M",
|
||||
"DQtPCh",
|
||||
"GBRjk4k4I",
|
||||
"CzIOoa95UT",
|
||||
"BLE8s",
|
||||
"GDZlc7",
|
||||
"Fz45T",
|
||||
"JW6lWn",
|
||||
"DE3g4uw0i",
|
||||
"18KxmYizv",
|
||||
"8ji",
|
||||
"JUDdNMnZ",
|
||||
"oGpBippPgm",
|
||||
"7De8Pg",
|
||||
"Zv6",
|
||||
"VHT9TVN",
|
||||
"bYH6m",
|
||||
"aK1",
|
||||
"WcWH6jU",
|
||||
"Q47YEMi4k",
|
||||
"vRD3A",
|
||||
"CGOsfJO",
|
||||
"BLn8",
|
||||
"RgK0drv7l",
|
||||
"oPTfGCn3a",
|
||||
"MkpMDkttW9",
|
||||
"VNI1fPM",
|
||||
"XNFi6",
|
||||
"6cq",
|
||||
"4LvTksXoEI",
|
||||
"1rRa2KOZB0",
|
||||
"zoOGRb8HT2",
|
||||
"mhcXDtvz",
|
||||
"NUmexFY2Ur",
|
||||
"6BIMdvSZ",
|
||||
"Tr0zU2vjRd",
|
||||
"QPR",
|
||||
"fhOqJR",
|
||||
"R9VnFY",
|
||||
"xkZ99D6S",
|
||||
"umY7E",
|
||||
"5Ds8qyDq",
|
||||
"Cc6jy09y3",
|
||||
"yvU3iR",
|
||||
"Bg07zY",
|
||||
"GccECglg",
|
||||
"VYd",
|
||||
"6vOiXqz",
|
||||
"7xX",
|
||||
"UdRrbEzF",
|
||||
"fE6wc",
|
||||
"BUd25Rb",
|
||||
"lxq5Zum89o",
|
||||
];
|
||||
// Handle undefined input
|
||||
if (id === undefined) {
|
||||
return "rive";
|
||||
}
|
||||
try {
|
||||
let fragment, insertPos;
|
||||
// Convert input to string
|
||||
const idStr = String(id);
|
||||
// Updated string hash function to match the new implementation
|
||||
/* eslint-disable no-bitwise */
|
||||
const generateStringHash = function (input) {
|
||||
input = String(input);
|
||||
let hash = 0;
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
const char = input.charCodeAt(i);
|
||||
hash =
|
||||
((char + (hash << 6) + (hash << 16) - hash) ^ (char << i % 5)) >>> 0;
|
||||
}
|
||||
hash ^= hash >>> 13;
|
||||
hash = (1540483477 * hash) >>> 0;
|
||||
return (hash ^= hash >>> 15).toString(16).padStart(8, "0");
|
||||
};
|
||||
// Updated MurmurHash-like function to match the new implementation
|
||||
const applyMurmurHash = function (input) {
|
||||
const str = String(input);
|
||||
let hash = 3735928559 ^ str.length;
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
let char = str.charCodeAt(i);
|
||||
char ^= ((i + 31) * 131) & 255;
|
||||
hash =
|
||||
(668265261 *
|
||||
(hash = (((hash << 7) | (hash >>> 25)) >>> 0) ^ char)) >>>
|
||||
0;
|
||||
}
|
||||
hash ^= hash >>> 16;
|
||||
hash = (2246822507 * hash) >>> 0;
|
||||
hash ^= hash >>> 13;
|
||||
hash = (3266489909 * hash) >>> 0;
|
||||
return (hash ^= hash >>> 16).toString(16).padStart(8, "0");
|
||||
};
|
||||
/* eslint-enable no-bitwise */
|
||||
// Generate the encoded hash using the new implementation
|
||||
const encodedHash = btoa(applyMurmurHash(generateStringHash(idStr)));
|
||||
// Different handling for non-numeric vs numeric inputs
|
||||
if (isNaN(Number(id))) {
|
||||
// For non-numeric inputs, sum the character codes
|
||||
const charSum = idStr
|
||||
.split("")
|
||||
.reduce((sum, char) => sum + char.charCodeAt(0), 0);
|
||||
// Select array element or fallback to base64 encoded input
|
||||
fragment = c[charSum % c.length] || btoa(idStr);
|
||||
// Calculate insertion position
|
||||
insertPos = Math.floor((charSum % encodedHash.length) / 2);
|
||||
}
|
||||
else {
|
||||
// For numeric inputs, use the number directly
|
||||
const numId = Number(id);
|
||||
fragment = c[numId % c.length] || btoa(idStr);
|
||||
// Calculate insertion position
|
||||
insertPos = Math.floor((numId % encodedHash.length) / 2);
|
||||
}
|
||||
// Construct the final key by inserting the selected value into the base64 string
|
||||
return (encodedHash.slice(0, insertPos) + fragment + encodedHash.slice(insertPos));
|
||||
}
|
||||
catch (error) {
|
||||
// Return fallback value if any errors occur
|
||||
return "topSecret";
|
||||
}
|
||||
}
|
||||
22
dist/cinemaLuxe/catalog.js
vendored
22
dist/cinemaLuxe/catalog.js
vendored
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Trending",
|
||||
filter: "/genre/latest-trending-releases/",
|
||||
},
|
||||
{
|
||||
title: "Netflix",
|
||||
filter: "/network/netflix/",
|
||||
},
|
||||
{
|
||||
title: "Amazon Prime",
|
||||
filter: "/network/prime-video/",
|
||||
},
|
||||
{
|
||||
title: "Animation",
|
||||
filter: "/genre/anime/",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
22
dist/cinemaLuxe/clCatalog.js
vendored
22
dist/cinemaLuxe/clCatalog.js
vendored
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clGenresList = exports.clCatalog = void 0;
|
||||
exports.clCatalog = [
|
||||
{
|
||||
title: 'Trending',
|
||||
filter: '/genre/latest-trending-releases/',
|
||||
},
|
||||
{
|
||||
title: 'Netflix',
|
||||
filter: '/network/netflix/',
|
||||
},
|
||||
{
|
||||
title: 'Amazon Prime',
|
||||
filter: '/network/prime-video/',
|
||||
},
|
||||
{
|
||||
title: 'Animation',
|
||||
filter: '/genre/anime/',
|
||||
},
|
||||
];
|
||||
exports.clGenresList = [];
|
||||
64
dist/cinemaLuxe/clGetEpisodes.js
vendored
64
dist/cinemaLuxe/clGetEpisodes.js
vendored
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clsEpisodeLinks = void 0;
|
||||
const clsEpisodeLinks = async function ({ url, providerContext, }) {
|
||||
try {
|
||||
if (!url.includes('luxelinks') || url.includes('luxecinema')) {
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const data = res.data;
|
||||
const encodedLink = data.match(/"link":"([^"]+)"/)?.[1];
|
||||
if (encodedLink) {
|
||||
url = encodedLink ? atob(encodedLink) : url;
|
||||
}
|
||||
else {
|
||||
const redirectUrlRes = await fetch('https://ext.8man.me/api/cinemaluxe', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ url }),
|
||||
});
|
||||
const redirectUrl = await redirectUrlRes.json();
|
||||
url = redirectUrl?.redirectUrl || url;
|
||||
}
|
||||
}
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const html = res.data;
|
||||
let $ = providerContext.cheerio.load(html);
|
||||
const episodeLinks = [];
|
||||
if (url.includes('luxedrive')) {
|
||||
episodeLinks.push({
|
||||
title: 'Movie',
|
||||
link: url,
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
$('a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button').map((i, element) => {
|
||||
const title = $(element).text()?.trim();
|
||||
const link = $(element).attr('href');
|
||||
if (title &&
|
||||
link &&
|
||||
!title.includes('Batch') &&
|
||||
!title.toLowerCase().includes('zip')) {
|
||||
episodeLinks.push({
|
||||
title: title
|
||||
.replace(/\(\d{4}\)/, '')
|
||||
.replace('Download', 'Movie')
|
||||
.replace('⚡', '')
|
||||
.trim(),
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('cl episode links', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.clsEpisodeLinks = clsEpisodeLinks;
|
||||
64
dist/cinemaLuxe/clGetMeta.js
vendored
64
dist/cinemaLuxe/clGetMeta.js
vendored
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clGetInfo = void 0;
|
||||
const clGetInfo = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const url = link;
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const data = res.data;
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const type = url.includes('tvshows') ? 'series' : 'movie';
|
||||
const imdbId = '';
|
||||
const title = url.split('/')[4].replace(/-/g, ' ');
|
||||
const image = $('.g-item').find('a').attr('href') || '';
|
||||
const synopsis = $('.wp-content').text().trim();
|
||||
const tags = $('.sgeneros')
|
||||
.children()
|
||||
.map((i, element) => $(element).text())
|
||||
.get()
|
||||
.slice(3);
|
||||
const rating = Number($('#repimdb').find('strong').text())
|
||||
.toFixed(1)
|
||||
.toString();
|
||||
const links = [];
|
||||
$('.mb-center.maxbutton-5-center,.ep-button-container').map((i, element) => {
|
||||
const title = $(element)
|
||||
.text()
|
||||
.replace('\u2b07Download', '')
|
||||
.replace('\u2b07 Download', '')
|
||||
.trim();
|
||||
const link = $(element).find('a').attr('href');
|
||||
if (title && link) {
|
||||
links.push({
|
||||
title,
|
||||
episodesLink: link,
|
||||
quality: title?.match(/\d+P\b/)?.[0].replace('P', 'p') || '',
|
||||
});
|
||||
}
|
||||
});
|
||||
return {
|
||||
title,
|
||||
tags,
|
||||
rating,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.clGetInfo = clGetInfo;
|
||||
55
dist/cinemaLuxe/clGetPosts.js
vendored
55
dist/cinemaLuxe/clGetPosts.js
vendored
@@ -1,55 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clGetPostsSearch = exports.clGetPosts = void 0;
|
||||
const clGetPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe');
|
||||
const url = `${baseUrl + filter}page/${page}/`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.clGetPosts = clGetPosts;
|
||||
const clGetPostsSearch = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe');
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.clGetPostsSearch = clGetPostsSearch;
|
||||
async function posts({ url, signal, providerContext, }) {
|
||||
try {
|
||||
const res = await fetch(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = await res.text();
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const catalog = [];
|
||||
$('.item.tvshows,.item.movies').map((i, element) => {
|
||||
const title = $(element).find('.poster').find('img').attr('alt');
|
||||
const link = $(element).find('.poster').find('a').attr('href');
|
||||
const image = $(element).find('.poster').find('img').attr('data-src');
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.result-item').map((i, element) => {
|
||||
const title = $(element).find('.thumbnail').find('img').attr('alt');
|
||||
const link = $(element).find('.thumbnail').find('a').attr('href');
|
||||
const image = $(element).find('.thumbnail').find('img').attr('data-src');
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('cinemaluxe error ', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
36
dist/cinemaLuxe/clGetSteam.js
vendored
36
dist/cinemaLuxe/clGetSteam.js
vendored
@@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clGetStream = void 0;
|
||||
const clGetStream = async ({ link, signal, providerContext, }) => {
|
||||
try {
|
||||
let newLink = link;
|
||||
if (link.includes('luxedrive')) {
|
||||
const res = await providerContext.axios.get(link);
|
||||
const $ = providerContext.cheerio.load(res.data);
|
||||
const hubcloudLink = $('a.btn.hubcloud').attr('href');
|
||||
if (hubcloudLink) {
|
||||
newLink = hubcloudLink;
|
||||
}
|
||||
else {
|
||||
const gdFlixLink = $('a.btn.gdflix').attr('href');
|
||||
if (gdFlixLink) {
|
||||
newLink = gdFlixLink;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newLink.includes('gdflix')) {
|
||||
const sreams = await providerContext.extractors.gdFlixExtracter(newLink, signal);
|
||||
return sreams;
|
||||
}
|
||||
const res2 = await providerContext.axios.get(newLink, { signal });
|
||||
const data2 = res2.data;
|
||||
const hcLink = data2.match(/location\.replace\('([^']+)'/)?.[1] || newLink;
|
||||
const hubCloudLinks = await providerContext.extractors.hubcloudExtracter(hcLink.includes('https://hubcloud') ? hcLink : newLink, signal);
|
||||
return hubCloudLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.clGetStream = clGetStream;
|
||||
64
dist/cinemaLuxe/episodes.js
vendored
64
dist/cinemaLuxe/episodes.js
vendored
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
const getEpisodes = async function ({ url, providerContext, }) {
|
||||
try {
|
||||
if (!url.includes("luxelinks") || url.includes("luxecinema")) {
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const data = res.data;
|
||||
const encodedLink = data.match(/"link":"([^"]+)"/)?.[1];
|
||||
if (encodedLink) {
|
||||
url = encodedLink ? atob(encodedLink) : url;
|
||||
}
|
||||
else {
|
||||
const redirectUrlRes = await fetch("https://ext.8man.me/api/cinemaluxe", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ url }),
|
||||
});
|
||||
const redirectUrl = await redirectUrlRes.json();
|
||||
url = redirectUrl?.redirectUrl || url;
|
||||
}
|
||||
}
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const html = res.data;
|
||||
let $ = providerContext.cheerio.load(html);
|
||||
const episodeLinks = [];
|
||||
if (url.includes("luxedrive")) {
|
||||
episodeLinks.push({
|
||||
title: "Movie",
|
||||
link: url,
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
$("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((i, element) => {
|
||||
const title = $(element).text()?.trim();
|
||||
const link = $(element).attr("href");
|
||||
if (title &&
|
||||
link &&
|
||||
!title.includes("Batch") &&
|
||||
!title.toLowerCase().includes("zip")) {
|
||||
episodeLinks.push({
|
||||
title: title
|
||||
.replace(/\(\d{4}\)/, "")
|
||||
.replace("Download", "Movie")
|
||||
.replace("⚡", "")
|
||||
.trim(),
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("cl episode links", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
17
dist/cinemaLuxe/index.js
vendored
17
dist/cinemaLuxe/index.js
vendored
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cinemaLuxe = void 0;
|
||||
const clCatalog_1 = require("./clCatalog");
|
||||
const clGetMeta_1 = require("./clGetMeta");
|
||||
const clGetEpisodes_1 = require("./clGetEpisodes");
|
||||
const clGetPosts_1 = require("./clGetPosts");
|
||||
const clGetSteam_1 = require("./clGetSteam");
|
||||
exports.cinemaLuxe = {
|
||||
catalog: clCatalog_1.clCatalog,
|
||||
genres: clCatalog_1.clGenresList,
|
||||
GetHomePosts: clGetPosts_1.clGetPosts,
|
||||
GetMetaData: clGetMeta_1.clGetInfo,
|
||||
GetSearchPosts: clGetPosts_1.clGetPostsSearch,
|
||||
GetEpisodeLinks: clGetEpisodes_1.clsEpisodeLinks,
|
||||
GetStream: clGetSteam_1.clGetStream,
|
||||
};
|
||||
64
dist/cinemaLuxe/meta.js
vendored
64
dist/cinemaLuxe/meta.js
vendored
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const url = link;
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const data = res.data;
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const type = url.includes("tvshows") ? "series" : "movie";
|
||||
const imdbId = "";
|
||||
const title = url.split("/")[4].replace(/-/g, " ");
|
||||
const image = $(".g-item").find("a").attr("href") || "";
|
||||
const synopsis = $(".wp-content").text().trim();
|
||||
const tags = $(".sgeneros")
|
||||
.children()
|
||||
.map((i, element) => $(element).text())
|
||||
.get()
|
||||
.slice(3);
|
||||
const rating = Number($("#repimdb").find("strong").text())
|
||||
.toFixed(1)
|
||||
.toString();
|
||||
const links = [];
|
||||
$(".mb-center.maxbutton-5-center,.ep-button-container").map((i, element) => {
|
||||
const title = $(element)
|
||||
.text()
|
||||
.replace("\u2b07Download", "")
|
||||
.replace("\u2b07 Download", "")
|
||||
.trim();
|
||||
const link = $(element).find("a").attr("href");
|
||||
if (title && link) {
|
||||
links.push({
|
||||
title,
|
||||
episodesLink: link,
|
||||
quality: title?.match(/\d+P\b/)?.[0].replace("P", "p") || "",
|
||||
});
|
||||
}
|
||||
});
|
||||
return {
|
||||
title,
|
||||
tags,
|
||||
rating,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
55
dist/cinemaLuxe/posts.js
vendored
55
dist/cinemaLuxe/posts.js
vendored
@@ -1,55 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const baseUrl = await providerContext.getBaseUrl("cinemaLuxe");
|
||||
const url = `${baseUrl + filter}page/${page}/`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const baseUrl = await providerContext.getBaseUrl("cinemaLuxe");
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, signal, providerContext, }) {
|
||||
try {
|
||||
const res = await fetch(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = await res.text();
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const catalog = [];
|
||||
$(".item.tvshows,.item.movies").map((i, element) => {
|
||||
const title = $(element).find(".poster").find("img").attr("alt");
|
||||
const link = $(element).find(".poster").find("a").attr("href");
|
||||
const image = $(element).find(".poster").find("img").attr("data-src");
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
$(".result-item").map((i, element) => {
|
||||
const title = $(element).find(".thumbnail").find("img").attr("alt");
|
||||
const link = $(element).find(".thumbnail").find("a").attr("href");
|
||||
const image = $(element).find(".thumbnail").find("img").attr("data-src");
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("cinemaluxe error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
36
dist/cinemaLuxe/stream.js
vendored
36
dist/cinemaLuxe/stream.js
vendored
@@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = async ({ link, signal, providerContext, }) => {
|
||||
try {
|
||||
let newLink = link;
|
||||
if (link.includes("luxedrive")) {
|
||||
const res = await providerContext.axios.get(link);
|
||||
const $ = providerContext.cheerio.load(res.data);
|
||||
const hubcloudLink = $("a.btn.hubcloud").attr("href");
|
||||
if (hubcloudLink) {
|
||||
newLink = hubcloudLink;
|
||||
}
|
||||
else {
|
||||
const gdFlixLink = $("a.btn.gdflix").attr("href");
|
||||
if (gdFlixLink) {
|
||||
newLink = gdFlixLink;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newLink.includes("gdflix")) {
|
||||
const sreams = await providerContext.extractors.gdFlixExtracter(newLink, signal);
|
||||
return sreams;
|
||||
}
|
||||
const res2 = await providerContext.axios.get(newLink, { signal });
|
||||
const data2 = res2.data;
|
||||
const hcLink = data2.match(/location\.replace\('([^']+)'/)?.[1] || newLink;
|
||||
const hubCloudLinks = await providerContext.extractors.hubcloudExtracter(hcLink.includes("https://hubcloud") ? hcLink : newLink, signal);
|
||||
return hubCloudLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
14
dist/dooflix/catalog.js
vendored
14
dist/dooflix/catalog.js
vendored
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Series",
|
||||
filter: "/rest-api//v130/tvseries",
|
||||
},
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/rest-api//v130/movies",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
14
dist/dooflix/dooCatalog.js
vendored
14
dist/dooflix/dooCatalog.js
vendored
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.dooGenresList = exports.dooCatalog = void 0;
|
||||
exports.dooCatalog = [
|
||||
{
|
||||
title: 'Series',
|
||||
filter: '/rest-api//v130/tvseries',
|
||||
},
|
||||
{
|
||||
title: 'Movies',
|
||||
filter: '/rest-api//v130/movies',
|
||||
},
|
||||
];
|
||||
exports.dooGenresList = [];
|
||||
79
dist/dooflix/dooGetInfo.js
vendored
79
dist/dooflix/dooGetInfo.js
vendored
@@ -1,79 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.dooGetInfo = void 0;
|
||||
const headers = {
|
||||
'Accept-Encoding': 'gzip',
|
||||
'API-KEY': '2pm95lc6prpdbk0ppji9rsqo',
|
||||
Connection: 'Keep-Alive',
|
||||
'If-Modified-Since': 'Wed, 14 Aug 2024 13:00:04 GMT',
|
||||
'User-Agent': 'okhttp/3.14.9',
|
||||
};
|
||||
const dooGetInfo = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(link, { headers });
|
||||
const resData = res.data;
|
||||
const jsonStart = resData?.indexOf('{');
|
||||
const jsonEnd = resData?.lastIndexOf('}') + 1;
|
||||
const data = JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.title
|
||||
? JSON?.parse(resData?.substring(jsonStart, jsonEnd))
|
||||
: resData;
|
||||
const title = data?.title || '';
|
||||
const synopsis = data?.description || '';
|
||||
const image = data?.poster_url || '';
|
||||
const cast = data?.cast || [];
|
||||
const rating = data?.imdb_rating || '';
|
||||
const type = Number(data?.is_tvseries) ? 'series' : 'movie';
|
||||
const tags = data?.genre?.map((genre) => genre?.name) || [];
|
||||
const links = [];
|
||||
if (type === 'series') {
|
||||
data?.season?.map((season) => {
|
||||
const title = season?.seasons_name || '';
|
||||
const directLinks = season?.episodes?.map((episode) => ({
|
||||
title: episode?.episodes_name,
|
||||
link: episode?.file_url,
|
||||
})) || [];
|
||||
links.push({
|
||||
title: title,
|
||||
directLinks: directLinks,
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
data?.videos?.map((video) => {
|
||||
links.push({
|
||||
title: title + ' ' + video?.label,
|
||||
directLinks: [
|
||||
{
|
||||
title: 'Play',
|
||||
link: video?.file_url,
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
}
|
||||
return {
|
||||
image: image?.includes('https') ? image : image?.replace('http', 'https'),
|
||||
synopsis: synopsis,
|
||||
title: title,
|
||||
rating: rating,
|
||||
imdbId: '',
|
||||
cast: cast,
|
||||
tags: tags,
|
||||
type: type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.dooGetInfo = dooGetInfo;
|
||||
140
dist/dooflix/dooGetPosts.js
vendored
140
dist/dooflix/dooGetPosts.js
vendored
@@ -1,140 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.dooGetSearchPost = exports.dooGetPost = void 0;
|
||||
const headers = {
|
||||
'Accept-Encoding': 'gzip',
|
||||
'API-KEY': '2pm95lc6prpdbk0ppji9rsqo',
|
||||
Connection: 'Keep-Alive',
|
||||
'If-Modified-Since': 'Wed, 14 Aug 2024 13:00:04 GMT',
|
||||
'User-Agent': 'okhttp/3.14.9',
|
||||
};
|
||||
const dooGetPost = async function ({ filter, page, signal, providerContext, }) {
|
||||
try {
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl('dooflix');
|
||||
const catalog = [];
|
||||
const url = `${baseUrl + filter + `?page=${page}`}`;
|
||||
const res = await axios.get(url, { headers, signal });
|
||||
const resData = res.data;
|
||||
if (!resData || typeof resData !== 'string') {
|
||||
console.warn('Unexpected response format from dooflix API');
|
||||
return [];
|
||||
}
|
||||
let data;
|
||||
try {
|
||||
const jsonStart = resData.indexOf('[');
|
||||
const jsonEnd = resData.lastIndexOf(']') + 1;
|
||||
if (jsonStart === -1 || jsonEnd <= jsonStart) {
|
||||
// If we can't find valid JSON array markers, try parsing the entire response
|
||||
data = JSON.parse(resData);
|
||||
}
|
||||
else {
|
||||
const jsonSubstring = resData.substring(jsonStart, jsonEnd);
|
||||
const parsedArray = JSON.parse(jsonSubstring);
|
||||
data = parsedArray.length > 0 ? parsedArray : resData;
|
||||
}
|
||||
}
|
||||
catch (parseError) {
|
||||
console.error('Error parsing dooflix response:', parseError);
|
||||
return [];
|
||||
}
|
||||
if (!Array.isArray(data)) {
|
||||
console.warn('Unexpected data format from dooflix API');
|
||||
return [];
|
||||
}
|
||||
data.forEach((result) => {
|
||||
const id = result?.videos_id;
|
||||
if (!id)
|
||||
return;
|
||||
const type = !result?.is_tvseries ? 'tvseries' : 'movie';
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`;
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes('https')
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace('http', 'https');
|
||||
catalog.push({
|
||||
title: result?.title || '',
|
||||
link,
|
||||
image,
|
||||
});
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('dooflix error:', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.dooGetPost = dooGetPost;
|
||||
const dooGetSearchPost = async function ({ searchQuery, page, providerContext, signal, }) {
|
||||
try {
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const catalog = [];
|
||||
const baseUrl = await getBaseUrl('dooflix');
|
||||
const url = `${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`;
|
||||
const res = await axios.get(url, { headers, signal });
|
||||
const resData = res.data;
|
||||
if (!resData || typeof resData !== 'string') {
|
||||
console.warn('Unexpected search response format from dooflix API');
|
||||
return [];
|
||||
}
|
||||
let data;
|
||||
try {
|
||||
const jsonStart = resData.indexOf('{');
|
||||
const jsonEnd = resData.lastIndexOf('}') + 1;
|
||||
if (jsonStart === -1 || jsonEnd <= jsonStart) {
|
||||
data = resData;
|
||||
}
|
||||
else {
|
||||
const jsonSubstring = resData.substring(jsonStart, jsonEnd);
|
||||
const parsedData = JSON.parse(jsonSubstring);
|
||||
data = parsedData?.movie ? parsedData : resData;
|
||||
}
|
||||
}
|
||||
catch (parseError) {
|
||||
console.error('Error parsing dooflix search response:', parseError);
|
||||
return [];
|
||||
}
|
||||
// Process movies
|
||||
data?.movie?.forEach((result) => {
|
||||
const id = result?.videos_id;
|
||||
if (!id)
|
||||
return;
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`;
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes('https')
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace('http', 'https');
|
||||
catalog.push({
|
||||
title: result?.title || '',
|
||||
link,
|
||||
image,
|
||||
});
|
||||
});
|
||||
// Process TV series
|
||||
data?.tvseries?.forEach((result) => {
|
||||
const id = result?.videos_id;
|
||||
if (!id)
|
||||
return;
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`;
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes('https')
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace('http', 'https');
|
||||
catalog.push({
|
||||
title: result?.title || '',
|
||||
link,
|
||||
image,
|
||||
});
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (error) {
|
||||
console.error('dooflix search error:', error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.dooGetSearchPost = dooGetSearchPost;
|
||||
26
dist/dooflix/dooGetSteam.js
vendored
26
dist/dooflix/dooGetSteam.js
vendored
@@ -1,26 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.dooGetStream = void 0;
|
||||
const dooGetStream = async function ({ link, }) {
|
||||
try {
|
||||
const streams = [];
|
||||
streams.push({
|
||||
server: 'Dooflix',
|
||||
link: link,
|
||||
type: 'm3u8',
|
||||
headers: {
|
||||
Connection: 'Keep-Alive',
|
||||
'User-Agent': 'Mozilla/5.0 (WindowsNT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.37',
|
||||
Referer: 'https://molop.art/',
|
||||
Cookie: 'cf_clearance=M2_2Hy4lKRy_ruRX3dzOgm3iho1FHe2DUC1lq28BUtI-1737377622-1.2.1.1-6R8RaH94._H2BuNuotsjTZ3fAF6cLwPII0guemu9A5Xa46lpCJPuELycojdREwoonYS2kRTYcZ9_1c4h4epi2LtDvMM9jIoOZKE9pIdWa30peM1hRMpvffTjGUCraHsJNCJez8S_QZ6XkkdP7GeQ5iwiYaI6Grp6qSJWoq0Hj8lS7EITZ1LzyrALI6iLlYjgLmgLGa1VuhORWJBN8ZxrJIZ_ba_pqbrR9fjnyToqxZ0XQaZfk1d3rZyNWoZUjI98GoAxVjnKtcBQQG6b2jYPJuMbbYraGoa54N7E7BR__7o',
|
||||
},
|
||||
});
|
||||
console.log('doo streams', streams);
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.dooGetStream = dooGetStream;
|
||||
15
dist/dooflix/index.js
vendored
15
dist/dooflix/index.js
vendored
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.dooflixProvider = void 0;
|
||||
const dooCatalog_1 = require("./dooCatalog");
|
||||
const dooGetInfo_1 = require("./dooGetInfo");
|
||||
const dooGetPosts_1 = require("./dooGetPosts");
|
||||
const dooGetSteam_1 = require("./dooGetSteam");
|
||||
exports.dooflixProvider = {
|
||||
catalog: dooCatalog_1.dooCatalog,
|
||||
genres: dooCatalog_1.dooGenresList,
|
||||
GetMetaData: dooGetInfo_1.dooGetInfo,
|
||||
GetStream: dooGetSteam_1.dooGetStream,
|
||||
GetHomePosts: dooGetPosts_1.dooGetPost,
|
||||
GetSearchPosts: dooGetPosts_1.dooGetSearchPost,
|
||||
};
|
||||
79
dist/dooflix/meta.js
vendored
79
dist/dooflix/meta.js
vendored
@@ -1,79 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const headers = {
|
||||
"Accept-Encoding": "gzip",
|
||||
"API-KEY": "2pm95lc6prpdbk0ppji9rsqo",
|
||||
Connection: "Keep-Alive",
|
||||
"If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT",
|
||||
"User-Agent": "okhttp/3.14.9",
|
||||
};
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(link, { headers });
|
||||
const resData = res.data;
|
||||
const jsonStart = resData?.indexOf("{");
|
||||
const jsonEnd = resData?.lastIndexOf("}") + 1;
|
||||
const data = JSON?.parse(resData?.substring(jsonStart, jsonEnd))?.title
|
||||
? JSON?.parse(resData?.substring(jsonStart, jsonEnd))
|
||||
: resData;
|
||||
const title = data?.title || "";
|
||||
const synopsis = data?.description || "";
|
||||
const image = data?.poster_url || "";
|
||||
const cast = data?.cast || [];
|
||||
const rating = data?.imdb_rating || "";
|
||||
const type = Number(data?.is_tvseries) ? "series" : "movie";
|
||||
const tags = data?.genre?.map((genre) => genre?.name) || [];
|
||||
const links = [];
|
||||
if (type === "series") {
|
||||
data?.season?.map((season) => {
|
||||
const title = season?.seasons_name || "";
|
||||
const directLinks = season?.episodes?.map((episode) => ({
|
||||
title: episode?.episodes_name,
|
||||
link: episode?.file_url,
|
||||
})) || [];
|
||||
links.push({
|
||||
title: title,
|
||||
directLinks: directLinks,
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
data?.videos?.map((video) => {
|
||||
links.push({
|
||||
title: title + " " + video?.label,
|
||||
directLinks: [
|
||||
{
|
||||
title: "Play",
|
||||
link: video?.file_url,
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
}
|
||||
return {
|
||||
image: image?.includes("https") ? image : image?.replace("http", "https"),
|
||||
synopsis: synopsis,
|
||||
title: title,
|
||||
rating: rating,
|
||||
imdbId: "",
|
||||
cast: cast,
|
||||
tags: tags,
|
||||
type: type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
140
dist/dooflix/posts.js
vendored
140
dist/dooflix/posts.js
vendored
@@ -1,140 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const headers = {
|
||||
"Accept-Encoding": "gzip",
|
||||
"API-KEY": "2pm95lc6prpdbk0ppji9rsqo",
|
||||
Connection: "Keep-Alive",
|
||||
"If-Modified-Since": "Wed, 14 Aug 2024 13:00:04 GMT",
|
||||
"User-Agent": "okhttp/3.14.9",
|
||||
};
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
try {
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("dooflix");
|
||||
const catalog = [];
|
||||
const url = `${baseUrl + filter + `?page=${page}`}`;
|
||||
const res = await axios.get(url, { headers, signal });
|
||||
const resData = res.data;
|
||||
if (!resData || typeof resData !== "string") {
|
||||
console.warn("Unexpected response format from dooflix API");
|
||||
return [];
|
||||
}
|
||||
let data;
|
||||
try {
|
||||
const jsonStart = resData.indexOf("[");
|
||||
const jsonEnd = resData.lastIndexOf("]") + 1;
|
||||
if (jsonStart === -1 || jsonEnd <= jsonStart) {
|
||||
// If we can't find valid JSON array markers, try parsing the entire response
|
||||
data = JSON.parse(resData);
|
||||
}
|
||||
else {
|
||||
const jsonSubstring = resData.substring(jsonStart, jsonEnd);
|
||||
const parsedArray = JSON.parse(jsonSubstring);
|
||||
data = parsedArray.length > 0 ? parsedArray : resData;
|
||||
}
|
||||
}
|
||||
catch (parseError) {
|
||||
console.error("Error parsing dooflix response:", parseError);
|
||||
return [];
|
||||
}
|
||||
if (!Array.isArray(data)) {
|
||||
console.warn("Unexpected data format from dooflix API");
|
||||
return [];
|
||||
}
|
||||
data.forEach((result) => {
|
||||
const id = result?.videos_id;
|
||||
if (!id)
|
||||
return;
|
||||
const type = !result?.is_tvseries ? "tvseries" : "movie";
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=${type}&id=${id}`;
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes("https")
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace("http", "https");
|
||||
catalog.push({
|
||||
title: result?.title || "",
|
||||
link,
|
||||
image,
|
||||
});
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("dooflix error:", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, providerContext, signal, }) {
|
||||
try {
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const catalog = [];
|
||||
const baseUrl = await getBaseUrl("dooflix");
|
||||
const url = `${baseUrl}/rest-api//v130/search?q=${searchQuery}&type=movietvserieslive&range_to=0&range_from=0&tv_category_id=0&genre_id=0&country_id=0`;
|
||||
const res = await axios.get(url, { headers, signal });
|
||||
const resData = res.data;
|
||||
if (!resData || typeof resData !== "string") {
|
||||
console.warn("Unexpected search response format from dooflix API");
|
||||
return [];
|
||||
}
|
||||
let data;
|
||||
try {
|
||||
const jsonStart = resData.indexOf("{");
|
||||
const jsonEnd = resData.lastIndexOf("}") + 1;
|
||||
if (jsonStart === -1 || jsonEnd <= jsonStart) {
|
||||
data = resData;
|
||||
}
|
||||
else {
|
||||
const jsonSubstring = resData.substring(jsonStart, jsonEnd);
|
||||
const parsedData = JSON.parse(jsonSubstring);
|
||||
data = parsedData?.movie ? parsedData : resData;
|
||||
}
|
||||
}
|
||||
catch (parseError) {
|
||||
console.error("Error parsing dooflix search response:", parseError);
|
||||
return [];
|
||||
}
|
||||
// Process movies
|
||||
data?.movie?.forEach((result) => {
|
||||
const id = result?.videos_id;
|
||||
if (!id)
|
||||
return;
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=movie&id=${id}`;
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes("https")
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace("http", "https");
|
||||
catalog.push({
|
||||
title: result?.title || "",
|
||||
link,
|
||||
image,
|
||||
});
|
||||
});
|
||||
// Process TV series
|
||||
data?.tvseries?.forEach((result) => {
|
||||
const id = result?.videos_id;
|
||||
if (!id)
|
||||
return;
|
||||
const link = `${baseUrl}/rest-api//v130/single_details?type=tvseries&id=${id}`;
|
||||
const thumbnailUrl = result?.thumbnail_url;
|
||||
const image = thumbnailUrl?.includes("https")
|
||||
? thumbnailUrl
|
||||
: thumbnailUrl?.replace("http", "https");
|
||||
catalog.push({
|
||||
title: result?.title || "",
|
||||
link,
|
||||
image,
|
||||
});
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (error) {
|
||||
console.error("dooflix search error:", error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
26
dist/dooflix/stream.js
vendored
26
dist/dooflix/stream.js
vendored
@@ -1,26 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = async function ({ link, }) {
|
||||
try {
|
||||
const streams = [];
|
||||
streams.push({
|
||||
server: "Dooflix",
|
||||
link: link,
|
||||
type: "m3u8",
|
||||
headers: {
|
||||
Connection: "Keep-Alive",
|
||||
"User-Agent": "Mozilla/5.0 (WindowsNT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.37",
|
||||
Referer: "https://molop.art/",
|
||||
Cookie: "cf_clearance=M2_2Hy4lKRy_ruRX3dzOgm3iho1FHe2DUC1lq28BUtI-1737377622-1.2.1.1-6R8RaH94._H2BuNuotsjTZ3fAF6cLwPII0guemu9A5Xa46lpCJPuELycojdREwoonYS2kRTYcZ9_1c4h4epi2LtDvMM9jIoOZKE9pIdWa30peM1hRMpvffTjGUCraHsJNCJez8S_QZ6XkkdP7GeQ5iwiYaI6Grp6qSJWoq0Hj8lS7EITZ1LzyrALI6iLlYjgLmgLGa1VuhORWJBN8ZxrJIZ_ba_pqbrR9fjnyToqxZ0XQaZfk1d3rZyNWoZUjI98GoAxVjnKtcBQQG6b2jYPJuMbbYraGoa54N7E7BR__7o",
|
||||
},
|
||||
});
|
||||
console.log("doo streams", streams);
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
63
dist/drive/catalog.js
vendored
63
dist/drive/catalog.js
vendored
@@ -1,63 +0,0 @@
|
||||
"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",
|
||||
},
|
||||
];
|
||||
34
dist/drive/driveGetEpisodesList.js
vendored
34
dist/drive/driveGetEpisodesList.js
vendored
@@ -1,34 +0,0 @@
|
||||
"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
72
dist/drive/driveGetInfo.js
vendored
@@ -1,72 +0,0 @@
|
||||
"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
45
dist/drive/driveGetPosts.js
vendored
@@ -1,45 +0,0 @@
|
||||
"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
33
dist/drive/driveGetStream.js
vendored
@@ -1,33 +0,0 @@
|
||||
"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;
|
||||
34
dist/drive/episodes.js
vendored
34
dist/drive/episodes.js
vendored
@@ -1,34 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
const getEpisodes = 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.getEpisodes = getEpisodes;
|
||||
17
dist/drive/index.js
vendored
17
dist/drive/index.js
vendored
@@ -1,17 +0,0 @@
|
||||
"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,
|
||||
};
|
||||
72
dist/drive/meta.js
vendored
72
dist/drive/meta.js
vendored
@@ -1,72 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = 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.getMeta = getMeta;
|
||||
45
dist/drive/posts.js
vendored
45
dist/drive/posts.js
vendored
@@ -1,45 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = 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.getPosts = getPosts;
|
||||
const getSearchPosts = 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.getSearchPosts = getSearchPosts;
|
||||
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/stream.js
vendored
33
dist/drive/stream.js
vendored
@@ -1,33 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = 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.getStream = getStream;
|
||||
18
dist/filmyfly/catalog.js
vendored
18
dist/filmyfly/catalog.js
vendored
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Home",
|
||||
filter: "",
|
||||
},
|
||||
{
|
||||
title: "Web Series",
|
||||
filter: "/page-cat/42/Web-Series.html",
|
||||
},
|
||||
{
|
||||
title: "Hollywood",
|
||||
filter: "/page-cat/9/New-Hollywood-Hindi-Dubbed-Movie-2016-2025.html",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
33
dist/filmyfly/episodes.js
vendored
33
dist/filmyfly/episodes.js
vendored
@@ -1,33 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
const getEpisodes = async function ({ url, providerContext, }) {
|
||||
try {
|
||||
const headers = providerContext.commonHeaders;
|
||||
const { axios, cheerio } = providerContext;
|
||||
const res = await axios.get(url, { headers });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const episodeLinks = [];
|
||||
$(".dlink.dl").map((i, element) => {
|
||||
const title = $(element)
|
||||
.find("a")
|
||||
.text()
|
||||
?.replace("Download", "")
|
||||
?.trim();
|
||||
const link = $(element).find("a").attr("href");
|
||||
if (title && link) {
|
||||
episodeLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("cl episode links", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
18
dist/filmyfly/ffCatalog.js
vendored
18
dist/filmyfly/ffCatalog.js
vendored
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ffGenresList = exports.ffCatalog = void 0;
|
||||
exports.ffCatalog = [
|
||||
{
|
||||
title: 'Home',
|
||||
filter: '',
|
||||
},
|
||||
{
|
||||
title: 'Web Series',
|
||||
filter: '/page-cat/42/Web-Series.html',
|
||||
},
|
||||
{
|
||||
title: 'Hollywood',
|
||||
filter: '/page-cat/9/New-Hollywood-Hindi-Dubbed-Movie-2016-2025.html',
|
||||
},
|
||||
];
|
||||
exports.ffGenresList = [];
|
||||
33
dist/filmyfly/ffGetEpisodes.js
vendored
33
dist/filmyfly/ffGetEpisodes.js
vendored
@@ -1,33 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ffEpisodeLinks = void 0;
|
||||
const ffEpisodeLinks = async function ({ url, providerContext, }) {
|
||||
try {
|
||||
const headers = providerContext.commonHeaders;
|
||||
const { axios, cheerio } = providerContext;
|
||||
const res = await axios.get(url, { headers });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const episodeLinks = [];
|
||||
$('.dlink.dl').map((i, element) => {
|
||||
const title = $(element)
|
||||
.find('a')
|
||||
.text()
|
||||
?.replace('Download', '')
|
||||
?.trim();
|
||||
const link = $(element).find('a').attr('href');
|
||||
if (title && link) {
|
||||
episodeLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('cl episode links', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.ffEpisodeLinks = ffEpisodeLinks;
|
||||
52
dist/filmyfly/ffGetMeta.js
vendored
52
dist/filmyfly/ffGetMeta.js
vendored
@@ -1,52 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ffGetInfo = void 0;
|
||||
const ffGetInfo = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio, commonHeaders: headers } = providerContext;
|
||||
const url = link;
|
||||
const res = await axios.get(url, { headers });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const type = url.includes('tvshows') ? 'series' : 'movie';
|
||||
const imdbId = '';
|
||||
const title = $('.fname:contains("Name")').find('.colora').text().trim();
|
||||
const image = $('.ss').find('img').attr('src') || '';
|
||||
const synopsis = $('.fname:contains("Description")')
|
||||
.find('.colorg')
|
||||
.text()
|
||||
.trim();
|
||||
const tags = $('.fname:contains("Genre")').find('.colorb').text().split(',') || [];
|
||||
const rating = '';
|
||||
const links = [];
|
||||
const downloadLink = $('.dlbtn').find('a').attr('href');
|
||||
if (downloadLink) {
|
||||
links.push({
|
||||
title: title,
|
||||
episodesLink: downloadLink,
|
||||
});
|
||||
}
|
||||
return {
|
||||
title,
|
||||
tags,
|
||||
rating,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.ffGetInfo = ffGetInfo;
|
||||
46
dist/filmyfly/ffGetPosts.js
vendored
46
dist/filmyfly/ffGetPosts.js
vendored
@@ -1,46 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ffGetPostsSearch = exports.ffGetPosts = void 0;
|
||||
const ffGetPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl('filmyfly');
|
||||
const url = `${baseUrl + filter}/${page}`;
|
||||
return posts({ url, signal, baseUrl, providerContext });
|
||||
};
|
||||
exports.ffGetPosts = ffGetPosts;
|
||||
const ffGetPostsSearch = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl('filmyfly');
|
||||
const url = `${baseUrl}/site-1.html?to-search=${searchQuery}`;
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
return posts({ url, signal, baseUrl, providerContext });
|
||||
};
|
||||
exports.ffGetPostsSearch = ffGetPostsSearch;
|
||||
async function posts({ url, signal, baseUrl, providerContext, }) {
|
||||
try {
|
||||
const { cheerio, commonHeaders: headers } = providerContext;
|
||||
const res = await fetch(url, { headers, signal });
|
||||
const data = await res.text();
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$('.A2,.A10,.fl').map((i, element) => {
|
||||
const title = $(element).find('a').eq(1).text() || $(element).find('b').text();
|
||||
const link = $(element).find('a').attr('href');
|
||||
const image = $(element).find('img').attr('src');
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: baseUrl + link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('ff error ', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
40
dist/filmyfly/ffGetStream.js
vendored
40
dist/filmyfly/ffGetStream.js
vendored
@@ -1,40 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ffGetStream = void 0;
|
||||
const ffGetStream = async function ({ link, signal, providerContext, }) {
|
||||
try {
|
||||
const res = await providerContext.axios.get(link, { signal });
|
||||
const data = res.data;
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const streams = [];
|
||||
const elements = $('.button2,.button1,.button3,.button4,.button').toArray();
|
||||
const promises = elements.map(async (element) => {
|
||||
const title = $(element).text();
|
||||
let link = $(element).attr('href');
|
||||
if (title.includes('GDFLIX') && link) {
|
||||
const gdLinks = await providerContext.extractors.gdFlixExtracter(link, signal);
|
||||
streams.push(...gdLinks);
|
||||
}
|
||||
const alreadyAdded = streams.find(s => s.link === link);
|
||||
if (title &&
|
||||
link &&
|
||||
!title.includes('Watch') &&
|
||||
!title.includes('Login') &&
|
||||
!title.includes('GoFile') &&
|
||||
!alreadyAdded) {
|
||||
streams.push({
|
||||
server: title,
|
||||
link: link,
|
||||
type: 'mkv',
|
||||
});
|
||||
}
|
||||
});
|
||||
await Promise.all(promises);
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.ffGetStream = ffGetStream;
|
||||
17
dist/filmyfly/index.js
vendored
17
dist/filmyfly/index.js
vendored
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.filmyfly = void 0;
|
||||
const ffCatalog_1 = require("./ffCatalog");
|
||||
const ffGetEpisodes_1 = require("./ffGetEpisodes");
|
||||
const ffGetMeta_1 = require("./ffGetMeta");
|
||||
const ffGetPosts_1 = require("./ffGetPosts");
|
||||
const ffGetStream_1 = require("./ffGetStream");
|
||||
exports.filmyfly = {
|
||||
catalog: ffCatalog_1.ffCatalog,
|
||||
genres: ffCatalog_1.ffGenresList,
|
||||
GetHomePosts: ffGetPosts_1.ffGetPosts,
|
||||
GetMetaData: ffGetMeta_1.ffGetInfo,
|
||||
GetSearchPosts: ffGetPosts_1.ffGetPostsSearch,
|
||||
GetEpisodeLinks: ffGetEpisodes_1.ffEpisodeLinks,
|
||||
GetStream: ffGetStream_1.ffGetStream,
|
||||
};
|
||||
52
dist/filmyfly/meta.js
vendored
52
dist/filmyfly/meta.js
vendored
@@ -1,52 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio, commonHeaders: headers } = providerContext;
|
||||
const url = link;
|
||||
const res = await axios.get(url, { headers });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const type = url.includes("tvshows") ? "series" : "movie";
|
||||
const imdbId = "";
|
||||
const title = $('.fname:contains("Name")').find(".colora").text().trim();
|
||||
const image = $(".ss").find("img").attr("src") || "";
|
||||
const synopsis = $('.fname:contains("Description")')
|
||||
.find(".colorg")
|
||||
.text()
|
||||
.trim();
|
||||
const tags = $('.fname:contains("Genre")').find(".colorb").text().split(",") || [];
|
||||
const rating = "";
|
||||
const links = [];
|
||||
const downloadLink = $(".dlbtn").find("a").attr("href");
|
||||
if (downloadLink) {
|
||||
links.push({
|
||||
title: title,
|
||||
episodesLink: downloadLink,
|
||||
});
|
||||
}
|
||||
return {
|
||||
title,
|
||||
tags,
|
||||
rating,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
46
dist/filmyfly/posts.js
vendored
46
dist/filmyfly/posts.js
vendored
@@ -1,46 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("filmyfly");
|
||||
const url = `${baseUrl + filter}/${page}`;
|
||||
return posts({ url, signal, baseUrl, providerContext });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("filmyfly");
|
||||
const url = `${baseUrl}/site-1.html?to-search=${searchQuery}`;
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
return posts({ url, signal, baseUrl, providerContext });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, signal, baseUrl, providerContext, }) {
|
||||
try {
|
||||
const { cheerio, commonHeaders: headers } = providerContext;
|
||||
const res = await fetch(url, { headers, signal });
|
||||
const data = await res.text();
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$(".A2,.A10,.fl").map((i, element) => {
|
||||
const title = $(element).find("a").eq(1).text() || $(element).find("b").text();
|
||||
const link = $(element).find("a").attr("href");
|
||||
const image = $(element).find("img").attr("src");
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: baseUrl + link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("ff error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
40
dist/filmyfly/stream.js
vendored
40
dist/filmyfly/stream.js
vendored
@@ -1,40 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = async function ({ link, signal, providerContext, }) {
|
||||
try {
|
||||
const res = await providerContext.axios.get(link, { signal });
|
||||
const data = res.data;
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const streams = [];
|
||||
const elements = $(".button2,.button1,.button3,.button4,.button").toArray();
|
||||
const promises = elements.map(async (element) => {
|
||||
const title = $(element).text();
|
||||
let link = $(element).attr("href");
|
||||
if (title.includes("GDFLIX") && link) {
|
||||
const gdLinks = await providerContext.extractors.gdFlixExtracter(link, signal);
|
||||
streams.push(...gdLinks);
|
||||
}
|
||||
const alreadyAdded = streams.find((s) => s.link === link);
|
||||
if (title &&
|
||||
link &&
|
||||
!title.includes("Watch") &&
|
||||
!title.includes("Login") &&
|
||||
!title.includes("GoFile") &&
|
||||
!alreadyAdded) {
|
||||
streams.push({
|
||||
server: title,
|
||||
link: link,
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
});
|
||||
await Promise.all(promises);
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
18
dist/flixhq/catalog.js
vendored
18
dist/flixhq/catalog.js
vendored
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Trending",
|
||||
filter: "/trending",
|
||||
},
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/recent-movies",
|
||||
},
|
||||
{
|
||||
title: "TV Shows",
|
||||
filter: "/recent-shows",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
18
dist/flixhq/flixhqCatalog.js
vendored
18
dist/flixhq/flixhqCatalog.js
vendored
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhqGenresList = exports.flixhqCatalog = void 0;
|
||||
exports.flixhqCatalog = [
|
||||
{
|
||||
title: 'Trending',
|
||||
filter: '/trending',
|
||||
},
|
||||
{
|
||||
title: 'Movies',
|
||||
filter: '/recent-movies',
|
||||
},
|
||||
{
|
||||
title: 'TV Shows',
|
||||
filter: '/recent-shows',
|
||||
},
|
||||
];
|
||||
exports.flixhqGenresList = [];
|
||||
56
dist/flixhq/flixhqGetInfo.js
vendored
56
dist/flixhq/flixhqGetInfo.js
vendored
@@ -1,56 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhqGetInfo = void 0;
|
||||
const flixhqGetInfo = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl('consumet');
|
||||
const url = `${baseUrl}/movies/flixhq/info?id=` + id;
|
||||
const res = await axios.get(url);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: data.title,
|
||||
synopsis: data.description.replace(/<[^>]*>?/gm, '').trim(),
|
||||
image: data.cover,
|
||||
cast: data.casts,
|
||||
rating: data.rating,
|
||||
tags: [data?.type, data?.duration, data.releaseDate.split('-')[0]],
|
||||
imdbId: '',
|
||||
type: data.episodes.length > 1 ? 'series' : 'movie',
|
||||
};
|
||||
const links = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
const title = episode?.number
|
||||
? 'Season-' + episode?.season + ' Ep-' + episode.number
|
||||
: episode.title;
|
||||
const link = episode.id + '*' + data.id;
|
||||
if (link && title) {
|
||||
links.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return {
|
||||
...meta,
|
||||
linkList: [
|
||||
{
|
||||
title: meta.title,
|
||||
directLinks: links,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.flixhqGetInfo = flixhqGetInfo;
|
||||
44
dist/flixhq/flixhqGetPosts.js
vendored
44
dist/flixhq/flixhqGetPosts.js
vendored
@@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhqGetSearchPost = exports.flixhqGetPosts = void 0;
|
||||
const flixhqGetPosts = async function ({ filter, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const urlRes = await getBaseUrl('consumet');
|
||||
const baseUrl = urlRes + '/movies/flixhq';
|
||||
const url = `${baseUrl + filter}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.flixhqGetPosts = flixhqGetPosts;
|
||||
const flixhqGetSearchPost = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const urlRes = await getBaseUrl('consumet');
|
||||
const baseUrl = urlRes + '/movies/flixhq';
|
||||
const url = `${baseUrl}/${searchQuery}?page=${page}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.flixhqGetSearchPost = flixhqGetSearchPost;
|
||||
async function posts({ url, signal, providerContext, }) {
|
||||
try {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data?.results || res.data;
|
||||
const catalog = [];
|
||||
data?.map((element) => {
|
||||
const title = element.title;
|
||||
const link = element.id;
|
||||
const image = element.image;
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('flixhq error ', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
55
dist/flixhq/flixhqGetStream.js
vendored
55
dist/flixhq/flixhqGetStream.js
vendored
@@ -1,55 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhqGetStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const flixhqGetStream = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const episodeId = id.split('*')[0];
|
||||
const mediaId = id.split('*')[1];
|
||||
const baseUrl = await getBaseUrl('consumet');
|
||||
const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`;
|
||||
const res = await fetch(serverUrl);
|
||||
const servers = await res.json();
|
||||
const streamLinks = [];
|
||||
for (const server of servers) {
|
||||
const streamUrl = `${baseUrl}/movies/flixhq/watch?server=` +
|
||||
server.name +
|
||||
'&episodeId=' +
|
||||
episodeId +
|
||||
'&mediaId=' +
|
||||
mediaId;
|
||||
const streamRes = await fetch(streamUrl);
|
||||
const streamData = await streamRes.json();
|
||||
const subtitles = [];
|
||||
if (streamData?.sources?.length > 0) {
|
||||
if (streamData.subtitles) {
|
||||
streamData.subtitles.forEach((sub) => {
|
||||
subtitles.push({
|
||||
language: sub?.lang?.slice(0, 2),
|
||||
uri: sub?.url,
|
||||
type: types_1.TextTrackType.VTT,
|
||||
title: sub?.lang,
|
||||
});
|
||||
});
|
||||
}
|
||||
streamData.sources.forEach((source) => {
|
||||
streamLinks.push({
|
||||
server: server?.name +
|
||||
'-' +
|
||||
source?.quality?.replace('auto', 'MultiQuality'),
|
||||
link: source.url,
|
||||
type: source.isM3U8 ? 'm3u8' : 'mp4',
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.flixhqGetStream = flixhqGetStream;
|
||||
26
dist/flixhq/index.js
vendored
26
dist/flixhq/index.js
vendored
@@ -1,26 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhq = void 0;
|
||||
const flixhqCatalog_1 = require("./flixhqCatalog");
|
||||
const flixhqGetInfo_1 = require("./flixhqGetInfo");
|
||||
const flixhqGetPosts_1 = require("./flixhqGetPosts");
|
||||
const flixhqGetStream_1 = require("./flixhqGetStream");
|
||||
exports.flixhq = {
|
||||
catalog: flixhqCatalog_1.flixhqCatalog,
|
||||
genres: flixhqCatalog_1.flixhqGenresList,
|
||||
GetMetaData: flixhqGetInfo_1.flixhqGetInfo,
|
||||
GetHomePosts: flixhqGetPosts_1.flixhqGetPosts,
|
||||
GetStream: flixhqGetStream_1.flixhqGetStream,
|
||||
GetSearchPosts: flixhqGetPosts_1.flixhqGetSearchPost,
|
||||
nonDownloadableServer: ['upcloud-MultiQuality', 'vidcloud-MultiQuality'],
|
||||
nonStreamableServer: [
|
||||
'upcloud-1080',
|
||||
'upcloud-720',
|
||||
'upcloud-480',
|
||||
'upcloud-360',
|
||||
'vidcloud-1080',
|
||||
'vidcloud-720',
|
||||
'vidcloud-480',
|
||||
'vidcloud-360',
|
||||
],
|
||||
};
|
||||
56
dist/flixhq/meta.js
vendored
56
dist/flixhq/meta.js
vendored
@@ -1,56 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const url = `${baseUrl}/movies/flixhq/info?id=` + id;
|
||||
const res = await axios.get(url);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: data.title,
|
||||
synopsis: data.description.replace(/<[^>]*>?/gm, "").trim(),
|
||||
image: data.cover,
|
||||
cast: data.casts,
|
||||
rating: data.rating,
|
||||
tags: [data?.type, data?.duration, data.releaseDate.split("-")[0]],
|
||||
imdbId: "",
|
||||
type: data.episodes.length > 1 ? "series" : "movie",
|
||||
};
|
||||
const links = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
const title = episode?.number
|
||||
? "Season-" + episode?.season + " Ep-" + episode.number
|
||||
: episode.title;
|
||||
const link = episode.id + "*" + data.id;
|
||||
if (link && title) {
|
||||
links.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return {
|
||||
...meta,
|
||||
linkList: [
|
||||
{
|
||||
title: meta.title,
|
||||
directLinks: links,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
44
dist/flixhq/posts.js
vendored
44
dist/flixhq/posts.js
vendored
@@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const urlRes = await getBaseUrl("consumet");
|
||||
const baseUrl = urlRes + "/movies/flixhq";
|
||||
const url = `${baseUrl + filter}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const urlRes = await getBaseUrl("consumet");
|
||||
const baseUrl = urlRes + "/movies/flixhq";
|
||||
const url = `${baseUrl}/${searchQuery}?page=${page}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, signal, providerContext, }) {
|
||||
try {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data?.results || res.data;
|
||||
const catalog = [];
|
||||
data?.map((element) => {
|
||||
const title = element.title;
|
||||
const link = element.id;
|
||||
const image = element.image;
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("flixhq error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
55
dist/flixhq/stream.js
vendored
55
dist/flixhq/stream.js
vendored
@@ -1,55 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const getStream = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const episodeId = id.split("*")[0];
|
||||
const mediaId = id.split("*")[1];
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`;
|
||||
const res = await fetch(serverUrl);
|
||||
const servers = await res.json();
|
||||
const streamLinks = [];
|
||||
for (const server of servers) {
|
||||
const streamUrl = `${baseUrl}/movies/flixhq/watch?server=` +
|
||||
server.name +
|
||||
"&episodeId=" +
|
||||
episodeId +
|
||||
"&mediaId=" +
|
||||
mediaId;
|
||||
const streamRes = await fetch(streamUrl);
|
||||
const streamData = await streamRes.json();
|
||||
const subtitles = [];
|
||||
if (streamData?.sources?.length > 0) {
|
||||
if (streamData.subtitles) {
|
||||
streamData.subtitles.forEach((sub) => {
|
||||
subtitles.push({
|
||||
language: sub?.lang?.slice(0, 2),
|
||||
uri: sub?.url,
|
||||
type: types_1.TextTrackType.VTT,
|
||||
title: sub?.lang,
|
||||
});
|
||||
});
|
||||
}
|
||||
streamData.sources.forEach((source) => {
|
||||
streamLinks.push({
|
||||
server: server?.name +
|
||||
"-" +
|
||||
source?.quality?.replace("auto", "MultiQuality"),
|
||||
link: source.url,
|
||||
type: source.isM3U8 ? "m3u8" : "mp4",
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
201
dist/gdflixExtractor.js
vendored
201
dist/gdflixExtractor.js
vendored
@@ -1,201 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.gdFlixExtracter = gdFlixExtracter;
|
||||
const axios_1 = __importDefault(require("axios"));
|
||||
const cheerio = __importStar(require("cheerio"));
|
||||
const headers_1 = require("./headers");
|
||||
async function gdFlixExtracter(link, signal) {
|
||||
try {
|
||||
const streamLinks = [];
|
||||
const res = await (0, axios_1.default)(`${link}`, { headers: headers_1.headers, signal });
|
||||
console.log('gdFlixExtracter', link);
|
||||
const data = res.data;
|
||||
let $drive = cheerio.load(data);
|
||||
// handle if redirected to another link
|
||||
if ($drive('body').attr('onload')?.includes('location.replace')) {
|
||||
const newLink = $drive('body')
|
||||
.attr('onload')
|
||||
?.split("location.replace('")?.[1]
|
||||
.split("'")?.[0];
|
||||
console.log('newLink', newLink);
|
||||
if (newLink) {
|
||||
const newRes = await axios_1.default.get(newLink, { headers: headers_1.headers, signal });
|
||||
$drive = cheerio.load(newRes.data);
|
||||
}
|
||||
}
|
||||
// try {
|
||||
// const resumeBot = $drive('.fab.fa-artstation').prev().attr('href') || '';
|
||||
// console.log('resumeBot', resumeBot);
|
||||
// const resumeBotRes = await axios.get(resumeBot, {headers});
|
||||
// const resumeBotToken = resumeBotRes.data.match(
|
||||
// /formData\.append\('token', '([a-f0-9]+)'\)/,
|
||||
// )[1];
|
||||
// const resumeBotBody = new FormData();
|
||||
// resumeBotBody.append('token', resumeBotToken);
|
||||
// const resumeBotPath = resumeBotRes.data.match(
|
||||
// /fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/,
|
||||
// )[1];
|
||||
// const resumeBotBaseUrl = resumeBot.split('/download')[0];
|
||||
// // console.log(
|
||||
// // 'resumeBotPath',
|
||||
// // resumeBotBaseUrl + '/download?id=' + resumeBotPath,
|
||||
// // );
|
||||
// // console.log('resumeBotBody', resumeBotToken);
|
||||
// const resumeBotDownload = await fetch(
|
||||
// resumeBotBaseUrl + '/download?id=' + resumeBotPath,
|
||||
// {
|
||||
// method: 'POST',
|
||||
// body: resumeBotBody,
|
||||
// headers: {
|
||||
// Referer: resumeBot,
|
||||
// Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308',
|
||||
// },
|
||||
// },
|
||||
// );
|
||||
// const resumeBotDownloadData = await resumeBotDownload.json();
|
||||
// console.log('resumeBotDownloadData', resumeBotDownloadData.url);
|
||||
// streamLinks.push({
|
||||
// server: 'ResumeBot',
|
||||
// link: resumeBotDownloadData.url,
|
||||
// type: 'mkv',
|
||||
// });
|
||||
// } catch (err) {
|
||||
// console.log('ResumeBot link not found', err);
|
||||
// }
|
||||
/// resume cloud
|
||||
try {
|
||||
const baseUrl = link.split('/').slice(0, 3).join('/');
|
||||
const resumeDrive = $drive('.btn-secondary').attr('href') || '';
|
||||
console.log('resumeDrive', resumeDrive);
|
||||
if (resumeDrive.includes('indexbot')) {
|
||||
const resumeBotRes = await axios_1.default.get(resumeDrive, { headers: headers_1.headers });
|
||||
const resumeBotToken = resumeBotRes.data.match(/formData\.append\('token', '([a-f0-9]+)'\)/)[1];
|
||||
const resumeBotBody = new FormData();
|
||||
resumeBotBody.append('token', resumeBotToken);
|
||||
const resumeBotPath = resumeBotRes.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/)[1];
|
||||
const resumeBotBaseUrl = resumeDrive.split('/download')[0];
|
||||
// console.log(
|
||||
// 'resumeBotPath',
|
||||
// resumeBotBaseUrl + '/download?id=' + resumeBotPath,
|
||||
// );
|
||||
// console.log('resumeBotBody', resumeBotToken);
|
||||
const resumeBotDownload = await fetch(resumeBotBaseUrl + '/download?id=' + resumeBotPath, {
|
||||
method: 'POST',
|
||||
body: resumeBotBody,
|
||||
headers: {
|
||||
Referer: resumeDrive,
|
||||
Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308',
|
||||
},
|
||||
});
|
||||
const resumeBotDownloadData = await resumeBotDownload.json();
|
||||
console.log('resumeBotDownloadData', resumeBotDownloadData.url);
|
||||
streamLinks.push({
|
||||
server: 'ResumeBot',
|
||||
link: resumeBotDownloadData.url,
|
||||
type: 'mkv',
|
||||
});
|
||||
}
|
||||
else {
|
||||
const url = baseUrl + resumeDrive;
|
||||
const resumeDriveRes = await axios_1.default.get(url, { headers: headers_1.headers });
|
||||
const resumeDriveHtml = resumeDriveRes.data;
|
||||
const $resumeDrive = cheerio.load(resumeDriveHtml);
|
||||
const resumeLink = $resumeDrive('.btn-success').attr('href');
|
||||
// console.log('resumeLink', resumeLink);
|
||||
if (resumeLink) {
|
||||
streamLinks.push({
|
||||
server: 'ResumeCloud',
|
||||
link: resumeLink,
|
||||
type: 'mkv',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log('Resume link not found');
|
||||
}
|
||||
//instant link
|
||||
try {
|
||||
const seed = $drive('.btn-danger').attr('href') || '';
|
||||
console.log('seed', seed);
|
||||
if (!seed.includes('?url=')) {
|
||||
const newLinkRes = await axios_1.default.head(seed, { headers: headers_1.headers, signal });
|
||||
console.log('newLinkRes', newLinkRes.request?.responseURL);
|
||||
const newLink = newLinkRes.request?.responseURL?.split('?url=')?.[1] || seed;
|
||||
streamLinks.push({ server: 'G-Drive', link: newLink, type: 'mkv' });
|
||||
}
|
||||
else {
|
||||
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';
|
||||
// console.log('videoSeedUrl', videoSeedUrl);
|
||||
const instantLinkRes = await fetch(videoSeedUrl, {
|
||||
method: 'POST',
|
||||
body: InstantFromData,
|
||||
headers: {
|
||||
'x-token': videoSeedUrl,
|
||||
},
|
||||
});
|
||||
const instantLinkData = await instantLinkRes.json();
|
||||
// console.log('instantLinkData', instantLinkData);
|
||||
if (instantLinkData.error === false) {
|
||||
const instantLink = instantLinkData.url;
|
||||
streamLinks.push({
|
||||
server: 'Gdrive-Instant',
|
||||
link: instantLink,
|
||||
type: 'mkv',
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log('Instant link not found', instantLinkData);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log('Instant link not found', err);
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
catch (error) {
|
||||
console.log('gdflix error: ', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
33
dist/getBaseUrl.js
vendored
33
dist/getBaseUrl.js
vendored
@@ -1,33 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getBaseUrl = void 0;
|
||||
const storage_1 = require("../storage");
|
||||
// 1 hour
|
||||
const expireTime = 60 * 60 * 1000;
|
||||
const getBaseUrl = async (providerValue) => {
|
||||
try {
|
||||
let baseUrl = '';
|
||||
const cacheKey = 'CacheBaseUrl' + providerValue;
|
||||
const timeKey = 'baseUrlTime' + providerValue;
|
||||
const cachedUrl = storage_1.cacheStorageService.getString(cacheKey);
|
||||
const cachedTime = storage_1.cacheStorageService.getObject(timeKey);
|
||||
if (cachedUrl &&
|
||||
cachedTime &&
|
||||
Date.now() - cachedTime < expireTime) {
|
||||
baseUrl = cachedUrl;
|
||||
}
|
||||
else {
|
||||
const baseUrlRes = await fetch('https://himanshu8443.github.io/providers/modflix.json');
|
||||
const baseUrlData = await baseUrlRes.json();
|
||||
baseUrl = baseUrlData[providerValue].url;
|
||||
storage_1.cacheStorageService.setString(cacheKey, baseUrl);
|
||||
storage_1.cacheStorageService.setObject(timeKey, Date.now());
|
||||
}
|
||||
return baseUrl;
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`Error fetching baseUrl: ${providerValue}`, error);
|
||||
return '';
|
||||
}
|
||||
};
|
||||
exports.getBaseUrl = getBaseUrl;
|
||||
37
dist/gofileExtracter.js
vendored
37
dist/gofileExtracter.js
vendored
@@ -1,37 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.gofileExtracter = gofileExtracter;
|
||||
const axios_1 = __importDefault(require("axios"));
|
||||
async function gofileExtracter(id) {
|
||||
try {
|
||||
const gofileRes = await axios_1.default.get('https://gofile.io/d/' + id);
|
||||
const genAccountres = await axios_1.default.post('https://api.gofile.io/accounts');
|
||||
const token = genAccountres.data.data.token;
|
||||
console.log('gofile token', token);
|
||||
const wtRes = await axios_1.default.get('https://gofile.io/dist/js/global.js');
|
||||
const wt = wtRes.data.match(/appdata\.wt\s*=\s*["']([^"']+)["']/)[1];
|
||||
console.log('gofile wt', wt);
|
||||
const res = await axios_1.default.get(`https://api.gofile.io/contents/${id}?wt=${wt}`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
const oId = Object.keys(res.data.data.children)[0];
|
||||
console.log('gofile extracter', res.data.data.children[oId].link);
|
||||
const link = res.data.data.children[oId].link;
|
||||
return {
|
||||
link,
|
||||
token,
|
||||
};
|
||||
}
|
||||
catch (e) {
|
||||
console.log('gofile extracter err', e);
|
||||
return {
|
||||
link: '',
|
||||
token: '',
|
||||
};
|
||||
}
|
||||
}
|
||||
104
dist/guardahd/GetGuardahdStream.js
vendored
104
dist/guardahd/GetGuardahdStream.js
vendored
@@ -1,104 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuardahdGetStream = void 0;
|
||||
const GuardahdGetStream = async function ({ link: id, type, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio, extractors } = providerContext;
|
||||
const { superVideoExtractor } = extractors;
|
||||
async function ExtractGuardahd({ imdb, // type,
|
||||
// episode,
|
||||
} // season,
|
||||
) {
|
||||
try {
|
||||
const baseUrl = 'https://guardahd.stream';
|
||||
const path = '/set-movie-a/' + imdb;
|
||||
const url = baseUrl + path;
|
||||
console.log('url:', url);
|
||||
const res = await axios.get(url, { timeout: 4000 });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const superVideoUrl = $('li:contains("supervideo")').attr('data-link');
|
||||
console.log('superVideoUrl:', superVideoUrl);
|
||||
if (!superVideoUrl) {
|
||||
return null;
|
||||
}
|
||||
const controller2 = new AbortController();
|
||||
const signal2 = controller2.signal;
|
||||
setTimeout(() => controller2.abort(), 4000);
|
||||
const res2 = await fetch('https:' + superVideoUrl, { signal: signal2 });
|
||||
const data = await res2.text();
|
||||
// console.log('mostraguarda data:', data);
|
||||
const streamUrl = await superVideoExtractor(data);
|
||||
return streamUrl;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('Error in GetMostraguardaStram:', err);
|
||||
}
|
||||
}
|
||||
async function GetMostraguardaStream({ imdb, type, season, episode, }) {
|
||||
try {
|
||||
const baseUrl = 'https://mostraguarda.stream';
|
||||
const path = type === 'tv'
|
||||
? `/serie/${imdb}/${season}/${episode}`
|
||||
: `/movie/${imdb}`;
|
||||
const url = baseUrl + path;
|
||||
console.log('url:', url);
|
||||
const res = await axios(url, { timeout: 4000 });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const superVideoUrl = $('li:contains("supervideo")').attr('data-link');
|
||||
console.log('superVideoUrl:', superVideoUrl);
|
||||
if (!superVideoUrl) {
|
||||
return null;
|
||||
}
|
||||
const controller2 = new AbortController();
|
||||
const signal2 = controller2.signal;
|
||||
setTimeout(() => controller2.abort(), 4000);
|
||||
const res2 = await fetch('https:' + superVideoUrl, { signal: signal2 });
|
||||
const data = await res2.text();
|
||||
// console.log('mostraguarda data:', data);
|
||||
const streamUrl = await superVideoExtractor(data);
|
||||
return streamUrl;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('Error in GetMostraguardaStram:', err);
|
||||
}
|
||||
}
|
||||
console.log(id);
|
||||
const streams = [];
|
||||
const { imdbId, season, episode } = JSON.parse(id);
|
||||
///// mostraguarda
|
||||
const mostraguardaStream = await GetMostraguardaStream({
|
||||
imdb: imdbId,
|
||||
type: type,
|
||||
season: season,
|
||||
episode: episode,
|
||||
});
|
||||
if (mostraguardaStream) {
|
||||
streams.push({
|
||||
server: 'Supervideo 1',
|
||||
link: mostraguardaStream,
|
||||
type: 'm3u8',
|
||||
});
|
||||
}
|
||||
const guardahdStream = await ExtractGuardahd({
|
||||
imdb: imdbId,
|
||||
type: type,
|
||||
season: season,
|
||||
episode: episode,
|
||||
});
|
||||
if (guardahdStream) {
|
||||
streams.push({
|
||||
server: 'Supervideo 2',
|
||||
link: guardahdStream,
|
||||
type: 'm3u8',
|
||||
});
|
||||
}
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.GuardahdGetStream = GuardahdGetStream;
|
||||
14
dist/guardahd/catalog.js
vendored
14
dist/guardahd/catalog.js
vendored
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Popular Movies",
|
||||
filter: "/top/catalog/movie/top.json",
|
||||
},
|
||||
{
|
||||
title: "Featured Movies",
|
||||
filter: "/imdbRating/catalog/movie/imdbRating.json",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
14
dist/guardahd/guardahdCatalog.js
vendored
14
dist/guardahd/guardahdCatalog.js
vendored
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.guardahdGenresList = exports.guardahdCatalog = void 0;
|
||||
exports.guardahdCatalog = [
|
||||
{
|
||||
title: 'Popular Movies',
|
||||
filter: '/top/catalog/movie/top.json',
|
||||
},
|
||||
{
|
||||
title: 'Featured Movies',
|
||||
filter: '/imdbRating/catalog/movie/imdbRating.json',
|
||||
},
|
||||
];
|
||||
exports.guardahdGenresList = [];
|
||||
34
dist/guardahd/guardahdGetPosts.js
vendored
34
dist/guardahd/guardahdGetPosts.js
vendored
@@ -1,34 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.guardahdGetSearchPosts = void 0;
|
||||
const guardahdGetSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
try {
|
||||
const { axios, commonHeaders: headers } = providerContext;
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const catalog = [];
|
||||
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`;
|
||||
const res2 = await axios.get(url2, { headers, signal });
|
||||
const data2 = res2.data;
|
||||
data2?.metas.map((result) => {
|
||||
const title = result?.name || '';
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const image = result?.poster;
|
||||
const type = result?.type;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('AutoEmbed error ', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.guardahdGetSearchPosts = guardahdGetSearchPosts;
|
||||
16
dist/guardahd/index.js
vendored
16
dist/guardahd/index.js
vendored
@@ -1,16 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.guardahd = void 0;
|
||||
const guardahdCatalog_1 = require("./guardahdCatalog");
|
||||
const allGetInfo_1 = require("../autoEmbed/allGetInfo");
|
||||
const allGetPost_1 = require("../autoEmbed/allGetPost");
|
||||
const guardahdGetPosts_1 = require("./guardahdGetPosts");
|
||||
const GetGuardahdStream_1 = require("./GetGuardahdStream");
|
||||
exports.guardahd = {
|
||||
catalog: guardahdCatalog_1.guardahdCatalog,
|
||||
genres: guardahdCatalog_1.guardahdGenresList,
|
||||
GetMetaData: allGetInfo_1.allGetInfo,
|
||||
GetHomePosts: allGetPost_1.allGetPost,
|
||||
GetStream: GetGuardahdStream_1.GuardahdGetStream,
|
||||
GetSearchPosts: guardahdGetPosts_1.guardahdGetSearchPosts,
|
||||
};
|
||||
89
dist/guardahd/meta.js
vendored
89
dist/guardahd/meta.js
vendored
@@ -1,89 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
const axios = providerContext.axios;
|
||||
try {
|
||||
console.log("all", link);
|
||||
const res = await axios.get(link);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: data?.meta?.imdb_id || "",
|
||||
type: data?.meta?.type || "movie",
|
||||
};
|
||||
const links = [];
|
||||
let directLinks = [];
|
||||
let season = new Map();
|
||||
if (meta.type === "series") {
|
||||
data?.meta?.videos?.map((video) => {
|
||||
if (video?.season <= 0)
|
||||
return;
|
||||
if (!season.has(video?.season)) {
|
||||
season.set(video?.season, []);
|
||||
}
|
||||
season.get(video?.season).push({
|
||||
title: "Episode " + video?.episode,
|
||||
type: "series",
|
||||
link: JSON.stringify({
|
||||
title: data?.meta?.name,
|
||||
imdbId: data?.meta?.imdb_id,
|
||||
season: video?.id?.split(":")[1],
|
||||
episode: video?.id?.split(":")[2],
|
||||
type: data?.meta?.type,
|
||||
tmdbId: data?.meta?.moviedb_id?.toString() || "",
|
||||
year: data?.meta?.year,
|
||||
}),
|
||||
});
|
||||
});
|
||||
const keys = Array.from(season.keys());
|
||||
keys.sort();
|
||||
keys.map((key) => {
|
||||
directLinks = season.get(key);
|
||||
links.push({
|
||||
title: `Season ${key}`,
|
||||
directLinks: directLinks,
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log("all meta Mv🔥🔥", meta);
|
||||
links.push({
|
||||
title: data?.meta?.name,
|
||||
directLinks: [
|
||||
{
|
||||
title: "Movie",
|
||||
type: "movie",
|
||||
link: JSON.stringify({
|
||||
title: data?.meta?.name,
|
||||
imdbId: data?.meta?.imdb_id,
|
||||
season: "",
|
||||
episode: "",
|
||||
type: data?.meta?.type,
|
||||
tmdbId: data?.meta?.moviedb_id?.toString() || "",
|
||||
year: data?.meta?.year,
|
||||
}),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
return {
|
||||
...meta,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
66
dist/guardahd/posts.js
vendored
66
dist/guardahd/posts.js
vendored
@@ -1,66 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, signal, providerContext, }) {
|
||||
try {
|
||||
const catalog = [];
|
||||
const url = "https://cinemeta-catalogs.strem.io" + filter;
|
||||
console.log("allGetPostUrl", url);
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = res.data;
|
||||
data?.metas.map((result) => {
|
||||
const title = result?.name;
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const type = result?.type;
|
||||
const image = result?.poster;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log("catalog", catalog.length);
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("AutoEmbed error ", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
try {
|
||||
const { axios, commonHeaders: headers } = providerContext;
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const catalog = [];
|
||||
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`;
|
||||
const res2 = await axios.get(url2, { headers, signal });
|
||||
const data2 = res2.data;
|
||||
data2?.metas.map((result) => {
|
||||
const title = result?.name || "";
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const image = result?.poster;
|
||||
const type = result?.type;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("AutoEmbed error ", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
102
dist/guardahd/stream.js
vendored
102
dist/guardahd/stream.js
vendored
@@ -1,102 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = async function ({ link: id, type, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio, extractors } = providerContext;
|
||||
const { superVideoExtractor } = extractors;
|
||||
async function ExtractGuardahd({ imdb, // type, // season,
|
||||
}) {
|
||||
try {
|
||||
const baseUrl = "https://guardahd.stream";
|
||||
const path = "/set-movie-a/" + imdb;
|
||||
const url = baseUrl + path;
|
||||
console.log("url:", url);
|
||||
const res = await axios.get(url, { timeout: 4000 });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const superVideoUrl = $('li:contains("supervideo")').attr("data-link");
|
||||
console.log("superVideoUrl:", superVideoUrl);
|
||||
if (!superVideoUrl) {
|
||||
return null;
|
||||
}
|
||||
const controller2 = new AbortController();
|
||||
const signal2 = controller2.signal;
|
||||
setTimeout(() => controller2.abort(), 4000);
|
||||
const res2 = await fetch("https:" + superVideoUrl, { signal: signal2 });
|
||||
const data = await res2.text();
|
||||
// console.log('mostraguarda data:', data);
|
||||
const streamUrl = await superVideoExtractor(data);
|
||||
return streamUrl;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("Error in GetMostraguardaStram:", err);
|
||||
}
|
||||
}
|
||||
async function GetMostraguardaStream({ imdb, type, season, episode, }) {
|
||||
try {
|
||||
const baseUrl = "https://mostraguarda.stream";
|
||||
const path = type === "tv"
|
||||
? `/serie/${imdb}/${season}/${episode}`
|
||||
: `/movie/${imdb}`;
|
||||
const url = baseUrl + path;
|
||||
console.log("url:", url);
|
||||
const res = await axios(url, { timeout: 4000 });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const superVideoUrl = $('li:contains("supervideo")').attr("data-link");
|
||||
console.log("superVideoUrl:", superVideoUrl);
|
||||
if (!superVideoUrl) {
|
||||
return null;
|
||||
}
|
||||
const controller2 = new AbortController();
|
||||
const signal2 = controller2.signal;
|
||||
setTimeout(() => controller2.abort(), 4000);
|
||||
const res2 = await fetch("https:" + superVideoUrl, { signal: signal2 });
|
||||
const data = await res2.text();
|
||||
// console.log('mostraguarda data:', data);
|
||||
const streamUrl = await superVideoExtractor(data);
|
||||
return streamUrl;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("Error in GetMostraguardaStram:", err);
|
||||
}
|
||||
}
|
||||
console.log(id);
|
||||
const streams = [];
|
||||
const { imdbId, season, episode } = JSON.parse(id);
|
||||
///// mostraguarda
|
||||
const mostraguardaStream = await GetMostraguardaStream({
|
||||
imdb: imdbId,
|
||||
type: type,
|
||||
season: season,
|
||||
episode: episode,
|
||||
});
|
||||
if (mostraguardaStream) {
|
||||
streams.push({
|
||||
server: "Supervideo 1",
|
||||
link: mostraguardaStream,
|
||||
type: "m3u8",
|
||||
});
|
||||
}
|
||||
const guardahdStream = await ExtractGuardahd({
|
||||
imdb: imdbId,
|
||||
type: type,
|
||||
season: season,
|
||||
episode: episode,
|
||||
});
|
||||
if (guardahdStream) {
|
||||
streams.push({
|
||||
server: "Supervideo 2",
|
||||
link: guardahdStream,
|
||||
type: "m3u8",
|
||||
});
|
||||
}
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
63
dist/hdhub4u/catalog.js
vendored
63
dist/hdhub4u/catalog.js
vendored
@@ -1,63 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Latest",
|
||||
filter: "",
|
||||
},
|
||||
{
|
||||
title: "Web Series",
|
||||
filter: "/category/web-series",
|
||||
},
|
||||
{
|
||||
title: "Hollywood ",
|
||||
filter: "/category/hollywood-movies",
|
||||
},
|
||||
{
|
||||
title: "South Movies",
|
||||
filter: "/category/south-hindi-movies",
|
||||
},
|
||||
];
|
||||
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",
|
||||
},
|
||||
];
|
||||
150
dist/hdhub4u/hdhub4uGetSteam.js
vendored
150
dist/hdhub4u/hdhub4uGetSteam.js
vendored
@@ -1,150 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hdhub4uGetStream = hdhub4uGetStream;
|
||||
exports.getRedirectLinks = getRedirectLinks;
|
||||
exports.decodeString = decodeString;
|
||||
async function hdhub4uGetStream({ link, signal, providerContext, }) {
|
||||
const { axios, cheerio, extractors, commonHeaders: headers } = providerContext;
|
||||
const { hubcloudExtracter } = extractors;
|
||||
let hubdriveLink = '';
|
||||
if (link.includes('hubdrive')) {
|
||||
const hubdriveRes = await axios.get(link, { headers, signal });
|
||||
const hubdriveText = hubdriveRes.data;
|
||||
const $ = cheerio.load(hubdriveText);
|
||||
hubdriveLink =
|
||||
$('.btn.btn-primary.btn-user.btn-success1.m-1').attr('href') || link;
|
||||
}
|
||||
else {
|
||||
const res = await axios.get(link, { headers, signal });
|
||||
const text = res.data;
|
||||
const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0];
|
||||
const decodedString = decodeString(encryptedString);
|
||||
link = atob(decodedString?.o);
|
||||
const redirectLink = await getRedirectLinks(link, signal, headers);
|
||||
const redirectLinkRes = await axios.get(redirectLink, { headers, signal });
|
||||
const redirectLinkText = redirectLinkRes.data;
|
||||
const $ = cheerio.load(redirectLinkText);
|
||||
hubdriveLink =
|
||||
$('h3:contains("1080p")').find('a').attr('href') ||
|
||||
redirectLinkText.match(/href="(https:\/\/hubcloud\.[^\/]+\/drive\/[^"]+)"/)[1];
|
||||
if (hubdriveLink.includes('hubdrive')) {
|
||||
const hubdriveRes = await axios.get(hubdriveLink, { headers, signal });
|
||||
const hubdriveText = hubdriveRes.data;
|
||||
const $$ = cheerio.load(hubdriveText);
|
||||
hubdriveLink =
|
||||
$$('.btn.btn-primary.btn-user.btn-success1.m-1').attr('href') ||
|
||||
hubdriveLink;
|
||||
}
|
||||
}
|
||||
const hubdriveLinkRes = await axios.get(hubdriveLink, { headers, signal });
|
||||
const hubcloudText = hubdriveLinkRes.data;
|
||||
const hubcloudLink = hubcloudText.match(/<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i)?.[1] || hubdriveLink;
|
||||
try {
|
||||
return await hubcloudExtracter(hubcloudLink, signal);
|
||||
}
|
||||
catch (error) {
|
||||
console.log('hd hub 4 getStream error: ', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
const encode = function (value) {
|
||||
return btoa(value.toString());
|
||||
};
|
||||
const decode = function (value) {
|
||||
if (value === undefined) {
|
||||
return '';
|
||||
}
|
||||
return atob(value.toString());
|
||||
};
|
||||
const pen = function (value) {
|
||||
return value.replace(/[a-zA-Z]/g, function (_0x1a470e) {
|
||||
return String.fromCharCode((_0x1a470e <= 'Z' ? 90 : 122) >=
|
||||
(_0x1a470e = _0x1a470e.charCodeAt(0) + 13)
|
||||
? _0x1a470e
|
||||
: _0x1a470e - 26);
|
||||
});
|
||||
};
|
||||
const abortableTimeout = (ms, { signal } = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (signal && signal.aborted) {
|
||||
return reject(new Error('Aborted'));
|
||||
}
|
||||
const timer = setTimeout(resolve, ms);
|
||||
if (signal) {
|
||||
signal.addEventListener('abort', () => {
|
||||
clearTimeout(timer);
|
||||
reject(new Error('Aborted'));
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
async function getRedirectLinks(link, signal, headers) {
|
||||
try {
|
||||
const res = await fetch(link, { headers, signal });
|
||||
const resText = await res.text();
|
||||
var regex = /ck\('_wp_http_\d+','([^']+)'/g;
|
||||
var combinedString = '';
|
||||
var match;
|
||||
while ((match = regex.exec(resText)) !== null) {
|
||||
// console.log(match[1]);
|
||||
combinedString += match[1];
|
||||
}
|
||||
// console.log(decode(combinedString));
|
||||
const decodedString = decode(pen(decode(decode(combinedString))));
|
||||
// console.log(decodedString);
|
||||
const data = JSON.parse(decodedString);
|
||||
console.log(data);
|
||||
const token = encode(data?.data);
|
||||
const blogLink = data?.wp_http1 + '?re=' + token;
|
||||
// abort timeout on signal
|
||||
let wait = abortableTimeout((Number(data?.total_time) + 3) * 1000, {
|
||||
signal,
|
||||
});
|
||||
await wait;
|
||||
console.log('blogLink', blogLink);
|
||||
let vcloudLink = 'Invalid Request';
|
||||
while (vcloudLink.includes('Invalid Request')) {
|
||||
const blogRes = await fetch(blogLink, { headers, signal });
|
||||
const blogResText = (await blogRes.text());
|
||||
if (blogResText.includes('Invalid Request')) {
|
||||
console.log(blogResText);
|
||||
}
|
||||
else {
|
||||
vcloudLink = blogResText.match(/var reurl = "([^"]+)"/) || '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
// console.log('vcloudLink', vcloudLink?.[1]);
|
||||
return blogLink || link;
|
||||
}
|
||||
catch (err) {
|
||||
console.log('Error in getRedirectLinks', err);
|
||||
return link;
|
||||
}
|
||||
}
|
||||
function rot13(str) {
|
||||
return str.replace(/[a-zA-Z]/g, function (char) {
|
||||
const charCode = char.charCodeAt(0);
|
||||
const isUpperCase = char <= 'Z';
|
||||
const baseCharCode = isUpperCase ? 65 : 97;
|
||||
return String.fromCharCode(((charCode - baseCharCode + 13) % 26) + baseCharCode);
|
||||
});
|
||||
}
|
||||
function decodeString(encryptedString) {
|
||||
try {
|
||||
// First base64 decode
|
||||
let decoded = atob(encryptedString);
|
||||
// Second base64 decode
|
||||
decoded = atob(decoded);
|
||||
// ROT13 decode
|
||||
decoded = rot13(decoded);
|
||||
// Third base64 decode
|
||||
decoded = atob(decoded);
|
||||
// Parse JSON
|
||||
return JSON.parse(decoded);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Error decoding string:', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
63
dist/hdhub4u/hdhubCatalog.js
vendored
63
dist/hdhub4u/hdhubCatalog.js
vendored
@@ -1,63 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hdhub4uGenresList = exports.hdhub4uCatalog = void 0;
|
||||
exports.hdhub4uCatalog = [
|
||||
{
|
||||
title: 'Latest',
|
||||
filter: '',
|
||||
},
|
||||
{
|
||||
title: 'Web Series',
|
||||
filter: '/category/web-series',
|
||||
},
|
||||
{
|
||||
title: 'Hollywood ',
|
||||
filter: '/category/hollywood-movies',
|
||||
},
|
||||
{
|
||||
title: 'South Movies',
|
||||
filter: '/category/south-hindi-movies',
|
||||
},
|
||||
];
|
||||
exports.hdhub4uGenresList = [
|
||||
{
|
||||
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',
|
||||
},
|
||||
];
|
||||
113
dist/hdhub4u/hdhubGetInfo.js
vendored
113
dist/hdhub4u/hdhubGetInfo.js
vendored
@@ -1,113 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hdhub4uGetInfo = void 0;
|
||||
const hdbHeaders = {
|
||||
Cookie: 'xla=s4t',
|
||||
Referer: 'https://google.com',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0',
|
||||
};
|
||||
const hdhub4uGetInfo = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const url = link;
|
||||
const res = await axios.get(url, { headers: hdbHeaders });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const container = $('.page-body');
|
||||
const imdbId = container
|
||||
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
|
||||
.attr('href')
|
||||
?.split('/')[4] || '';
|
||||
const title = container
|
||||
.find('h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]')
|
||||
.text();
|
||||
const type = title.toLocaleLowerCase().includes('season')
|
||||
? 'series'
|
||||
: 'movie';
|
||||
const synopsis = container
|
||||
.find('strong:contains("DESCRIPTION")')
|
||||
.parent()
|
||||
.text()
|
||||
.replace('DESCRIPTION:', '');
|
||||
const image = container.find('img[decoding="async"]').attr('src') || '';
|
||||
// Links
|
||||
const links = [];
|
||||
const directLink = [];
|
||||
// direct link type
|
||||
$('strong:contains("EPiSODE")').map((i, element) => {
|
||||
const epTitle = $(element).parent().parent().text();
|
||||
const episodesLink = $(element)
|
||||
.parent()
|
||||
.parent()
|
||||
.parent()
|
||||
.next()
|
||||
.next()
|
||||
.find('a')
|
||||
.attr('href') ||
|
||||
$(element).parent().parent().parent().next().find('a').attr('href');
|
||||
if (episodesLink && episodesLink) {
|
||||
directLink.push({
|
||||
title: epTitle,
|
||||
link: episodesLink,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (directLink.length === 0) {
|
||||
container.find('a:contains("EPiSODE")').map((i, element) => {
|
||||
const epTitle = $(element).text();
|
||||
const episodesLink = $(element).attr('href');
|
||||
if (episodesLink) {
|
||||
directLink.push({
|
||||
title: epTitle.toLocaleUpperCase(),
|
||||
link: episodesLink,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (directLink.length > 0) {
|
||||
links.push({
|
||||
title: title,
|
||||
directLinks: directLink,
|
||||
});
|
||||
}
|
||||
if (directLink.length === 0) {
|
||||
container
|
||||
.find('a:contains("480"),a:contains("720"),a:contains("1080"),a:contains("2160"),a:contains("4K")')
|
||||
.map((i, element) => {
|
||||
const quality = $(element)
|
||||
.text()
|
||||
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || '';
|
||||
const movieLinks = $(element).attr('href');
|
||||
const title = $(element).text();
|
||||
if (movieLinks) {
|
||||
links.push({
|
||||
directLinks: [{ link: movieLinks, title: 'Movie', type: 'movie' }],
|
||||
quality: quality,
|
||||
title: title,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// console.log('drive meta', title, synopsis, image, imdbId, type, links);
|
||||
return {
|
||||
title,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.hdhub4uGetInfo = hdhub4uGetInfo;
|
||||
53
dist/hdhub4u/hdhubGetPosts.js
vendored
53
dist/hdhub4u/hdhubGetPosts.js
vendored
@@ -1,53 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hdhubGetPostsSearch = exports.hdhubGetPosts = void 0;
|
||||
const hdbHeaders = {
|
||||
Cookie: 'xla=s4t',
|
||||
Referer: 'https://google.com',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0',
|
||||
};
|
||||
const hdhubGetPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl('hdhub');
|
||||
const url = `${baseUrl + filter}/page/${page}/`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.hdhubGetPosts = hdhubGetPosts;
|
||||
const hdhubGetPostsSearch = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl('hdhub');
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.hdhubGetPostsSearch = hdhubGetPostsSearch;
|
||||
async function posts({ url, signal, providerContext, }) {
|
||||
const { cheerio } = providerContext;
|
||||
try {
|
||||
const res = await fetch(url, {
|
||||
headers: hdbHeaders,
|
||||
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('hdhubGetPosts error ', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
15
dist/hdhub4u/index.js
vendored
15
dist/hdhub4u/index.js
vendored
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hdhub4uProvider = void 0;
|
||||
const hdhubCatalog_1 = require("./hdhubCatalog");
|
||||
const hdhubGetInfo_1 = require("./hdhubGetInfo");
|
||||
const hdhub4uGetSteam_1 = require("./hdhub4uGetSteam");
|
||||
const hdhubGetPosts_1 = require("./hdhubGetPosts");
|
||||
exports.hdhub4uProvider = {
|
||||
catalog: hdhubCatalog_1.hdhub4uCatalog,
|
||||
genres: hdhubCatalog_1.hdhub4uGenresList,
|
||||
GetMetaData: hdhubGetInfo_1.hdhub4uGetInfo,
|
||||
GetStream: hdhub4uGetSteam_1.hdhub4uGetStream,
|
||||
GetHomePosts: hdhubGetPosts_1.hdhubGetPosts,
|
||||
GetSearchPosts: hdhubGetPosts_1.hdhubGetPostsSearch,
|
||||
};
|
||||
115
dist/hdhub4u/meta.js
vendored
115
dist/hdhub4u/meta.js
vendored
@@ -1,115 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const hdbHeaders = {
|
||||
Cookie: "xla=s4t",
|
||||
Referer: "https://google.com",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
|
||||
};
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const url = link;
|
||||
const res = await axios.get(url, { headers: hdbHeaders });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const container = $(".page-body");
|
||||
const imdbId = container
|
||||
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
|
||||
.attr("href")
|
||||
?.split("/")[4] || "";
|
||||
const title = container
|
||||
.find('h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]')
|
||||
.text();
|
||||
const type = title.toLocaleLowerCase().includes("season")
|
||||
? "series"
|
||||
: "movie";
|
||||
const synopsis = container
|
||||
.find('strong:contains("DESCRIPTION")')
|
||||
.parent()
|
||||
.text()
|
||||
.replace("DESCRIPTION:", "");
|
||||
const image = container.find('img[decoding="async"]').attr("src") || "";
|
||||
// Links
|
||||
const links = [];
|
||||
const directLink = [];
|
||||
// direct link type
|
||||
$('strong:contains("EPiSODE")').map((i, element) => {
|
||||
const epTitle = $(element).parent().parent().text();
|
||||
const episodesLink = $(element)
|
||||
.parent()
|
||||
.parent()
|
||||
.parent()
|
||||
.next()
|
||||
.next()
|
||||
.find("a")
|
||||
.attr("href") ||
|
||||
$(element).parent().parent().parent().next().find("a").attr("href");
|
||||
if (episodesLink && episodesLink) {
|
||||
directLink.push({
|
||||
title: epTitle,
|
||||
link: episodesLink,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (directLink.length === 0) {
|
||||
container.find('a:contains("EPiSODE")').map((i, element) => {
|
||||
const epTitle = $(element).text();
|
||||
const episodesLink = $(element).attr("href");
|
||||
if (episodesLink) {
|
||||
directLink.push({
|
||||
title: epTitle.toLocaleUpperCase(),
|
||||
link: episodesLink,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (directLink.length > 0) {
|
||||
links.push({
|
||||
title: title,
|
||||
directLinks: directLink,
|
||||
});
|
||||
}
|
||||
if (directLink.length === 0) {
|
||||
container
|
||||
.find('a:contains("480"),a:contains("720"),a:contains("1080"),a:contains("2160"),a:contains("4K")')
|
||||
.map((i, element) => {
|
||||
const quality = $(element)
|
||||
.text()
|
||||
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
|
||||
const movieLinks = $(element).attr("href");
|
||||
const title = $(element).text();
|
||||
if (movieLinks) {
|
||||
links.push({
|
||||
directLinks: [
|
||||
{ link: movieLinks, title: "Movie", type: "movie" },
|
||||
],
|
||||
quality: quality,
|
||||
title: title,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// console.log('drive meta', title, synopsis, image, imdbId, type, links);
|
||||
return {
|
||||
title,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
53
dist/hdhub4u/posts.js
vendored
53
dist/hdhub4u/posts.js
vendored
@@ -1,53 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const hdbHeaders = {
|
||||
Cookie: "xla=s4t",
|
||||
Referer: "https://google.com",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
|
||||
};
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("hdhub");
|
||||
const url = `${baseUrl + filter}/page/${page}/`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl("hdhub");
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, signal, providerContext, }) {
|
||||
const { cheerio } = providerContext;
|
||||
try {
|
||||
const res = await fetch(url, {
|
||||
headers: hdbHeaders,
|
||||
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("hdhubGetPosts error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
150
dist/hdhub4u/stream.js
vendored
150
dist/hdhub4u/stream.js
vendored
@@ -1,150 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = getStream;
|
||||
exports.getRedirectLinks = getRedirectLinks;
|
||||
exports.decodeString = decodeString;
|
||||
async function getStream({ link, signal, providerContext, }) {
|
||||
const { axios, cheerio, extractors, commonHeaders: headers, } = providerContext;
|
||||
const { hubcloudExtracter } = extractors;
|
||||
let hubdriveLink = "";
|
||||
if (link.includes("hubdrive")) {
|
||||
const hubdriveRes = await axios.get(link, { headers, signal });
|
||||
const hubdriveText = hubdriveRes.data;
|
||||
const $ = cheerio.load(hubdriveText);
|
||||
hubdriveLink =
|
||||
$(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") || link;
|
||||
}
|
||||
else {
|
||||
const res = await axios.get(link, { headers, signal });
|
||||
const text = res.data;
|
||||
const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0];
|
||||
const decodedString = decodeString(encryptedString);
|
||||
link = atob(decodedString?.o);
|
||||
const redirectLink = await getRedirectLinks(link, signal, headers);
|
||||
const redirectLinkRes = await axios.get(redirectLink, { headers, signal });
|
||||
const redirectLinkText = redirectLinkRes.data;
|
||||
const $ = cheerio.load(redirectLinkText);
|
||||
hubdriveLink =
|
||||
$('h3:contains("1080p")').find("a").attr("href") ||
|
||||
redirectLinkText.match(/href="(https:\/\/hubcloud\.[^\/]+\/drive\/[^"]+)"/)[1];
|
||||
if (hubdriveLink.includes("hubdrive")) {
|
||||
const hubdriveRes = await axios.get(hubdriveLink, { headers, signal });
|
||||
const hubdriveText = hubdriveRes.data;
|
||||
const $$ = cheerio.load(hubdriveText);
|
||||
hubdriveLink =
|
||||
$$(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href") ||
|
||||
hubdriveLink;
|
||||
}
|
||||
}
|
||||
const hubdriveLinkRes = await axios.get(hubdriveLink, { headers, signal });
|
||||
const hubcloudText = hubdriveLinkRes.data;
|
||||
const hubcloudLink = hubcloudText.match(/<META HTTP-EQUIV="refresh" content="0; url=([^"]+)">/i)?.[1] || hubdriveLink;
|
||||
try {
|
||||
return await hubcloudExtracter(hubcloudLink, signal);
|
||||
}
|
||||
catch (error) {
|
||||
console.log("hd hub 4 getStream error: ", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
const encode = function (value) {
|
||||
return btoa(value.toString());
|
||||
};
|
||||
const decode = function (value) {
|
||||
if (value === undefined) {
|
||||
return "";
|
||||
}
|
||||
return atob(value.toString());
|
||||
};
|
||||
const pen = function (value) {
|
||||
return value.replace(/[a-zA-Z]/g, function (_0x1a470e) {
|
||||
return String.fromCharCode((_0x1a470e <= "Z" ? 90 : 122) >=
|
||||
(_0x1a470e = _0x1a470e.charCodeAt(0) + 13)
|
||||
? _0x1a470e
|
||||
: _0x1a470e - 26);
|
||||
});
|
||||
};
|
||||
const abortableTimeout = (ms, { signal } = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (signal && signal.aborted) {
|
||||
return reject(new Error("Aborted"));
|
||||
}
|
||||
const timer = setTimeout(resolve, ms);
|
||||
if (signal) {
|
||||
signal.addEventListener("abort", () => {
|
||||
clearTimeout(timer);
|
||||
reject(new Error("Aborted"));
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
async function getRedirectLinks(link, signal, headers) {
|
||||
try {
|
||||
const res = await fetch(link, { headers, signal });
|
||||
const resText = await res.text();
|
||||
var regex = /ck\('_wp_http_\d+','([^']+)'/g;
|
||||
var combinedString = "";
|
||||
var match;
|
||||
while ((match = regex.exec(resText)) !== null) {
|
||||
// console.log(match[1]);
|
||||
combinedString += match[1];
|
||||
}
|
||||
// console.log(decode(combinedString));
|
||||
const decodedString = decode(pen(decode(decode(combinedString))));
|
||||
// console.log(decodedString);
|
||||
const data = JSON.parse(decodedString);
|
||||
console.log(data);
|
||||
const token = encode(data?.data);
|
||||
const blogLink = data?.wp_http1 + "?re=" + token;
|
||||
// abort timeout on signal
|
||||
let wait = abortableTimeout((Number(data?.total_time) + 3) * 1000, {
|
||||
signal,
|
||||
});
|
||||
await wait;
|
||||
console.log("blogLink", blogLink);
|
||||
let vcloudLink = "Invalid Request";
|
||||
while (vcloudLink.includes("Invalid Request")) {
|
||||
const blogRes = await fetch(blogLink, { headers, signal });
|
||||
const blogResText = (await blogRes.text());
|
||||
if (blogResText.includes("Invalid Request")) {
|
||||
console.log(blogResText);
|
||||
}
|
||||
else {
|
||||
vcloudLink = blogResText.match(/var reurl = "([^"]+)"/) || "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
// console.log('vcloudLink', vcloudLink?.[1]);
|
||||
return blogLink || link;
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Error in getRedirectLinks", err);
|
||||
return link;
|
||||
}
|
||||
}
|
||||
function rot13(str) {
|
||||
return str.replace(/[a-zA-Z]/g, function (char) {
|
||||
const charCode = char.charCodeAt(0);
|
||||
const isUpperCase = char <= "Z";
|
||||
const baseCharCode = isUpperCase ? 65 : 97;
|
||||
return String.fromCharCode(((charCode - baseCharCode + 13) % 26) + baseCharCode);
|
||||
});
|
||||
}
|
||||
function decodeString(encryptedString) {
|
||||
try {
|
||||
// First base64 decode
|
||||
let decoded = atob(encryptedString);
|
||||
// Second base64 decode
|
||||
decoded = atob(decoded);
|
||||
// ROT13 decode
|
||||
decoded = rot13(decoded);
|
||||
// Third base64 decode
|
||||
decoded = atob(decoded);
|
||||
// Parse JSON
|
||||
return JSON.parse(decoded);
|
||||
}
|
||||
catch (error) {
|
||||
console.error("Error decoding string:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
11
dist/headers.js
vendored
11
dist/headers.js
vendored
@@ -1,11 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.headers = void 0;
|
||||
exports.headers = {
|
||||
'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-Site': 'none',
|
||||
// 'Sec-Fetch-User': '?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',
|
||||
};
|
||||
54
dist/hiAnime/HiGetSteam.js
vendored
54
dist/hiAnime/HiGetSteam.js
vendored
@@ -1,54 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hiGetStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const hiGetStream = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl('consumet');
|
||||
const servers = ['vidcloud', 'vidstreaming'];
|
||||
const url = `${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`;
|
||||
const streamLinks = [];
|
||||
await Promise.all(servers.map(async (server) => {
|
||||
try {
|
||||
const res = await axios.get(url + server);
|
||||
if (res.data) {
|
||||
const subtitles = [];
|
||||
res.data?.subtitles.forEach((sub) => {
|
||||
if (sub?.lang === 'Thumbnails')
|
||||
return;
|
||||
subtitles.push({
|
||||
language: sub?.lang?.slice(0, 2) || 'Und',
|
||||
uri: sub?.url,
|
||||
title: sub?.lang || 'Undefined',
|
||||
type: sub?.url?.endsWith('.vtt')
|
||||
? types_1.TextTrackType.VTT
|
||||
: types_1.TextTrackType.SUBRIP,
|
||||
});
|
||||
});
|
||||
res.data?.sources.forEach((source) => {
|
||||
streamLinks.push({
|
||||
server: server,
|
||||
link: source?.url,
|
||||
type: source?.isM3U8 ? 'm3u8' : 'mp4',
|
||||
headers: {
|
||||
Referer: 'https://megacloud.club/',
|
||||
Origin: 'https://megacloud.club',
|
||||
},
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}));
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.hiGetStream = hiGetStream;
|
||||
22
dist/hiAnime/catalog.js
vendored
22
dist/hiAnime/catalog.js
vendored
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalogs = void 0;
|
||||
exports.catalogs = [
|
||||
{
|
||||
title: "Recent",
|
||||
filter: "/anime/zoro/recent-episodes",
|
||||
},
|
||||
{
|
||||
title: "Top Airing",
|
||||
filter: "/anime/zoro/top-airing",
|
||||
},
|
||||
{
|
||||
title: "Most Popular",
|
||||
filter: "/anime/zoro/most-popular",
|
||||
},
|
||||
{
|
||||
title: "Most Favorited",
|
||||
filter: "/anime/zoro/most-favorite",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
22
dist/hiAnime/hiCatalog.js
vendored
22
dist/hiAnime/hiCatalog.js
vendored
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hiGenresList = exports.hiCatalog = void 0;
|
||||
exports.hiCatalog = [
|
||||
{
|
||||
title: 'Recent',
|
||||
filter: '/anime/zoro/recent-episodes',
|
||||
},
|
||||
{
|
||||
title: 'Top Airing',
|
||||
filter: '/anime/zoro/top-airing',
|
||||
},
|
||||
{
|
||||
title: 'Most Popular',
|
||||
filter: '/anime/zoro/most-popular',
|
||||
},
|
||||
{
|
||||
title: 'Most Favorited',
|
||||
filter: '/anime/zoro/most-favorite',
|
||||
},
|
||||
];
|
||||
exports.hiGenresList = [];
|
||||
78
dist/hiAnime/hiGetInfo.js
vendored
78
dist/hiAnime/hiGetInfo.js
vendored
@@ -1,78 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hiGetInfo = void 0;
|
||||
const hiGetInfo = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl('consumet');
|
||||
const url = `${baseUrl}/anime/zoro/info?id=` + link;
|
||||
const res = await axios.get(url);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: data.title,
|
||||
synopsis: data.description,
|
||||
image: data.image,
|
||||
tags: [
|
||||
data?.type,
|
||||
data?.subOrDub === 'both' ? 'Sub And Dub' : data?.subOrDub,
|
||||
],
|
||||
imdbId: '',
|
||||
type: data.episodes.length > 0 ? 'series' : 'movie',
|
||||
};
|
||||
const linkList = [];
|
||||
const subLinks = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
if (!episode?.isSubbed) {
|
||||
return;
|
||||
}
|
||||
const title = 'Episode ' + episode.number + (episode?.isFiller ? ' (Filler)' : '');
|
||||
const link = episode.id + '$sub';
|
||||
if (link && title) {
|
||||
subLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
linkList.push({
|
||||
title: meta.title + ' (Sub)',
|
||||
directLinks: subLinks,
|
||||
});
|
||||
if (data?.subOrDub === 'both') {
|
||||
const dubLinks = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
if (!episode?.isDubbed) {
|
||||
return;
|
||||
}
|
||||
const title = 'Episode ' + episode.number + (episode?.isFiller ? ' (Filler)' : '');
|
||||
const link = episode.id + '$dub';
|
||||
if (link && title) {
|
||||
dubLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
linkList.push({
|
||||
title: meta.title + ' (Dub)',
|
||||
directLinks: dubLinks,
|
||||
});
|
||||
}
|
||||
return {
|
||||
...meta,
|
||||
linkList: linkList,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.hiGetInfo = hiGetInfo;
|
||||
41
dist/hiAnime/hiGetPosts.js
vendored
41
dist/hiAnime/hiGetPosts.js
vendored
@@ -1,41 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hiGetPostsSearch = exports.hiGetPosts = void 0;
|
||||
const hiGetPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl('consumet');
|
||||
const url = `${baseUrl + filter}?page=${page}`;
|
||||
return posts({ url, signal, axios });
|
||||
};
|
||||
exports.hiGetPosts = hiGetPosts;
|
||||
const hiGetPostsSearch = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl('consumet');
|
||||
const url = `${baseUrl}/anime/zoro/${searchQuery}?page=${page}`;
|
||||
return posts({ url, signal, axios });
|
||||
};
|
||||
exports.hiGetPostsSearch = hiGetPostsSearch;
|
||||
async function posts({ url, signal, axios, }) {
|
||||
try {
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data?.results;
|
||||
const catalog = [];
|
||||
data?.map((element) => {
|
||||
const title = element.title;
|
||||
const link = element.id;
|
||||
const image = element.image;
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('zoro error ', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
15
dist/hiAnime/index.js
vendored
15
dist/hiAnime/index.js
vendored
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.HiAnime = void 0;
|
||||
const hiGetInfo_1 = require("./hiGetInfo");
|
||||
const hiCatalog_1 = require("./hiCatalog");
|
||||
const HiGetSteam_1 = require("./HiGetSteam");
|
||||
const hiGetPosts_1 = require("./hiGetPosts");
|
||||
exports.HiAnime = {
|
||||
catalog: hiCatalog_1.hiCatalog,
|
||||
genres: hiCatalog_1.hiGenresList,
|
||||
GetMetaData: hiGetInfo_1.hiGetInfo,
|
||||
GetHomePosts: hiGetPosts_1.hiGetPosts,
|
||||
GetStream: HiGetSteam_1.hiGetStream,
|
||||
GetSearchPosts: hiGetPosts_1.hiGetPostsSearch,
|
||||
};
|
||||
78
dist/hiAnime/meta.js
vendored
78
dist/hiAnime/meta.js
vendored
@@ -1,78 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const url = `${baseUrl}/anime/zoro/info?id=` + link;
|
||||
const res = await axios.get(url);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: data.title,
|
||||
synopsis: data.description,
|
||||
image: data.image,
|
||||
tags: [
|
||||
data?.type,
|
||||
data?.subOrDub === "both" ? "Sub And Dub" : data?.subOrDub,
|
||||
],
|
||||
imdbId: "",
|
||||
type: data.episodes.length > 0 ? "series" : "movie",
|
||||
};
|
||||
const linkList = [];
|
||||
const subLinks = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
if (!episode?.isSubbed) {
|
||||
return;
|
||||
}
|
||||
const title = "Episode " + episode.number + (episode?.isFiller ? " (Filler)" : "");
|
||||
const link = episode.id + "$sub";
|
||||
if (link && title) {
|
||||
subLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
linkList.push({
|
||||
title: meta.title + " (Sub)",
|
||||
directLinks: subLinks,
|
||||
});
|
||||
if (data?.subOrDub === "both") {
|
||||
const dubLinks = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
if (!episode?.isDubbed) {
|
||||
return;
|
||||
}
|
||||
const title = "Episode " + episode.number + (episode?.isFiller ? " (Filler)" : "");
|
||||
const link = episode.id + "$dub";
|
||||
if (link && title) {
|
||||
dubLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
linkList.push({
|
||||
title: meta.title + " (Dub)",
|
||||
directLinks: dubLinks,
|
||||
});
|
||||
}
|
||||
return {
|
||||
...meta,
|
||||
linkList: linkList,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
41
dist/hiAnime/posts.js
vendored
41
dist/hiAnime/posts.js
vendored
@@ -1,41 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const url = `${baseUrl + filter}?page=${page}`;
|
||||
return posts({ url, signal, axios });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const url = `${baseUrl}/anime/zoro/${searchQuery}?page=${page}`;
|
||||
return posts({ url, signal, axios });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, signal, axios, }) {
|
||||
try {
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data?.results;
|
||||
const catalog = [];
|
||||
data?.map((element) => {
|
||||
const title = element.title;
|
||||
const link = element.id;
|
||||
const image = element.image;
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("zoro error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
54
dist/hiAnime/stream.js
vendored
54
dist/hiAnime/stream.js
vendored
@@ -1,54 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const getStream = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const servers = ["vidcloud", "vidstreaming"];
|
||||
const url = `${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`;
|
||||
const streamLinks = [];
|
||||
await Promise.all(servers.map(async (server) => {
|
||||
try {
|
||||
const res = await axios.get(url + server);
|
||||
if (res.data) {
|
||||
const subtitles = [];
|
||||
res.data?.subtitles.forEach((sub) => {
|
||||
if (sub?.lang === "Thumbnails")
|
||||
return;
|
||||
subtitles.push({
|
||||
language: sub?.lang?.slice(0, 2) || "Und",
|
||||
uri: sub?.url,
|
||||
title: sub?.lang || "Undefined",
|
||||
type: sub?.url?.endsWith(".vtt")
|
||||
? types_1.TextTrackType.VTT
|
||||
: types_1.TextTrackType.SUBRIP,
|
||||
});
|
||||
});
|
||||
res.data?.sources.forEach((source) => {
|
||||
streamLinks.push({
|
||||
server: server,
|
||||
link: source?.url,
|
||||
type: source?.isM3U8 ? "m3u8" : "mp4",
|
||||
headers: {
|
||||
Referer: "https://megacloud.club/",
|
||||
Origin: "https://megacloud.club",
|
||||
},
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}));
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
120
dist/hubcloudExtractor.js
vendored
120
dist/hubcloudExtractor.js
vendored
@@ -1,120 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hubcloudExtracter = hubcloudExtracter;
|
||||
const axios_1 = __importDefault(require("axios"));
|
||||
const cheerio = __importStar(require("cheerio"));
|
||||
const headers_1 = require("./headers");
|
||||
const decode = function (value) {
|
||||
if (value === undefined) {
|
||||
return '';
|
||||
}
|
||||
return atob(value.toString());
|
||||
};
|
||||
async function hubcloudExtracter(link, signal) {
|
||||
try {
|
||||
console.log('hubcloudExtracter', link);
|
||||
const baseUrl = link.split('/').slice(0, 3).join('/');
|
||||
const streamLinks = [];
|
||||
const vLinkRes = await (0, axios_1.default)(`${link}`, { headers: headers_1.headers, signal });
|
||||
const vLinkText = vLinkRes.data;
|
||||
const $vLink = cheerio.load(vLinkText);
|
||||
const vLinkRedirect = vLinkText.match(/var\s+url\s*=\s*'([^']+)';/) || [];
|
||||
let vcloudLink = decode(vLinkRedirect[1]?.split('r=')?.[1]) ||
|
||||
vLinkRedirect[1] ||
|
||||
$vLink('.fa-file-download.fa-lg').parent().attr('href') ||
|
||||
link;
|
||||
console.log('vcloudLink', vcloudLink);
|
||||
if (vcloudLink?.startsWith('/')) {
|
||||
vcloudLink = `${baseUrl}${vcloudLink}`;
|
||||
console.log('New vcloudLink', vcloudLink);
|
||||
}
|
||||
const vcloudRes = await fetch(vcloudLink, {
|
||||
headers: headers_1.headers,
|
||||
signal,
|
||||
redirect: 'follow',
|
||||
});
|
||||
const $ = cheerio.load(await vcloudRes.text());
|
||||
// console.log('vcloudRes', $.text());
|
||||
const linkClass = $('.btn-success.btn-lg.h6,.btn-danger,.btn-secondary');
|
||||
for (const element of linkClass) {
|
||||
const itm = $(element);
|
||||
let link = itm.attr('href') || '';
|
||||
if (link?.includes('.dev') && !link?.includes('/?id=')) {
|
||||
streamLinks.push({ server: 'Cf Worker', link: link, type: 'mkv' });
|
||||
}
|
||||
if (link?.includes('pixeld')) {
|
||||
if (!link?.includes('api')) {
|
||||
const token = link.split('/').pop();
|
||||
const baseUrl = link.split('/').slice(0, -2).join('/');
|
||||
link = `${baseUrl}/api/file/${token}?download`;
|
||||
}
|
||||
streamLinks.push({ server: 'Pixeldrain', link: link, type: 'mkv' });
|
||||
}
|
||||
if (link?.includes('hubcloud') || link?.includes('/?id=')) {
|
||||
try {
|
||||
const newLinkRes = await axios_1.default.head(link, { headers: headers_1.headers, signal });
|
||||
const newLink = newLinkRes.request?.responseURL?.split('link=')?.[1] || link;
|
||||
streamLinks.push({ server: 'hubcloud', link: newLink, type: 'mkv' });
|
||||
}
|
||||
catch (error) {
|
||||
console.log('hubcloudExtracter error in hubcloud link: ', error);
|
||||
}
|
||||
}
|
||||
if (link?.includes('cloudflarestorage')) {
|
||||
streamLinks.push({ server: 'CfStorage', link: link, type: 'mkv' });
|
||||
}
|
||||
if (link?.includes('fastdl')) {
|
||||
streamLinks.push({ server: 'FastDl', link: link, type: 'mkv' });
|
||||
}
|
||||
if (link.includes('hubcdn')) {
|
||||
streamLinks.push({
|
||||
server: 'HubCdn',
|
||||
link: link,
|
||||
type: 'mkv',
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log('streamLinks', streamLinks);
|
||||
return streamLinks;
|
||||
}
|
||||
catch (error) {
|
||||
console.log('hubcloudExtracter error: ', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
63
dist/katmovies/catalog.js
vendored
63
dist/katmovies/catalog.js
vendored
@@ -1,63 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.katGenresList = exports.katCatalog = void 0;
|
||||
exports.katCatalog = [
|
||||
{
|
||||
title: 'Latest',
|
||||
filter: '',
|
||||
},
|
||||
{
|
||||
title: 'Netflix',
|
||||
filter: '/category/netflix',
|
||||
},
|
||||
{
|
||||
title: 'Animated',
|
||||
filter: '/category/animated',
|
||||
},
|
||||
{
|
||||
title: 'Amazon Prime',
|
||||
filter: '/category/amazon-prime',
|
||||
},
|
||||
];
|
||||
exports.katGenresList = [
|
||||
{
|
||||
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',
|
||||
},
|
||||
];
|
||||
70
dist/katmovies/episodes.js
vendored
70
dist/katmovies/episodes.js
vendored
@@ -1,70 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
exports.extractKmhdLink = extractKmhdLink;
|
||||
const getEpisodes = async function ({ url, providerContext, }) {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const episodesLink = [];
|
||||
try {
|
||||
if (url.includes("gdflix")) {
|
||||
const baseUrl = url.split("/pack")?.[0];
|
||||
const res = await axios.get(url);
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const links = $(".list-group-item");
|
||||
links?.map((i, link) => {
|
||||
episodesLink.push({
|
||||
title: $(link).text() || "",
|
||||
link: baseUrl + $(link).find("a").attr("href") || "",
|
||||
});
|
||||
});
|
||||
if (episodesLink.length > 0) {
|
||||
return episodesLink;
|
||||
}
|
||||
}
|
||||
if (url.includes("/pack")) {
|
||||
const epIds = await extractKmhdEpisodes(url, providerContext);
|
||||
epIds?.forEach((id, index) => {
|
||||
episodesLink.push({
|
||||
title: `Episode ${index + 1}`,
|
||||
link: url.split("/pack")[0] + "/file/" + id,
|
||||
});
|
||||
});
|
||||
}
|
||||
const res = await axios.get(url, {
|
||||
headers: {
|
||||
Cookie: "_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true",
|
||||
},
|
||||
});
|
||||
const episodeData = res.data;
|
||||
const $ = cheerio.load(episodeData);
|
||||
const links = $(".autohyperlink");
|
||||
links?.map((i, link) => {
|
||||
episodesLink.push({
|
||||
title: $(link).parent().children().remove().end().text() || "",
|
||||
link: $(link).attr("href") || "",
|
||||
});
|
||||
});
|
||||
return episodesLink;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
async function extractKmhdLink(katlink, providerContext) {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(katlink);
|
||||
const data = res.data;
|
||||
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
|
||||
const hubDriveLink = data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1];
|
||||
return hubDriveLink + hubDriveRes;
|
||||
}
|
||||
async function extractKmhdEpisodes(katlink, providerContext) {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(katlink);
|
||||
const data = res.data;
|
||||
const ids = data.match(/[\w]+_[a-f0-9]{8}/g);
|
||||
return ids;
|
||||
}
|
||||
17
dist/katmovies/index.js
vendored
17
dist/katmovies/index.js
vendored
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.katMoviesHd = void 0;
|
||||
const katCatalog_1 = require("./katCatalog");
|
||||
const katGetEpsodes_1 = require("./katGetEpsodes");
|
||||
const katGetInfo_1 = require("./katGetInfo");
|
||||
const katGetPosts_1 = require("./katGetPosts");
|
||||
const katGetSteam_1 = require("./katGetSteam");
|
||||
exports.katMoviesHd = {
|
||||
catalog: katCatalog_1.katCatalog,
|
||||
genres: katCatalog_1.katGenresList,
|
||||
GetMetaData: katGetInfo_1.katGetInfo,
|
||||
GetHomePosts: katGetPosts_1.katGetPosts,
|
||||
GetStream: katGetSteam_1.katGetStream,
|
||||
GetEpisodeLinks: katGetEpsodes_1.katEpisodeLinks,
|
||||
GetSearchPosts: katGetPosts_1.katGetPostsSearch,
|
||||
};
|
||||
63
dist/katmovies/katCatalog.js
vendored
63
dist/katmovies/katCatalog.js
vendored
@@ -1,63 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.katGenresList = exports.katCatalog = void 0;
|
||||
exports.katCatalog = [
|
||||
{
|
||||
title: 'Latest',
|
||||
filter: '',
|
||||
},
|
||||
{
|
||||
title: 'Netflix',
|
||||
filter: '/category/netflix',
|
||||
},
|
||||
{
|
||||
title: 'Animated',
|
||||
filter: '/category/animated',
|
||||
},
|
||||
{
|
||||
title: 'Amazon Prime',
|
||||
filter: '/category/amazon-prime',
|
||||
},
|
||||
];
|
||||
exports.katGenresList = [
|
||||
{
|
||||
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',
|
||||
},
|
||||
];
|
||||
70
dist/katmovies/katGetEpsodes.js
vendored
70
dist/katmovies/katGetEpsodes.js
vendored
@@ -1,70 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.katEpisodeLinks = void 0;
|
||||
exports.extractKmhdLink = extractKmhdLink;
|
||||
const katEpisodeLinks = async function ({ url, providerContext, }) {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const episodesLink = [];
|
||||
try {
|
||||
if (url.includes('gdflix')) {
|
||||
const baseUrl = url.split('/pack')?.[0];
|
||||
const res = await axios.get(url);
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const links = $('.list-group-item');
|
||||
links?.map((i, link) => {
|
||||
episodesLink.push({
|
||||
title: $(link).text() || '',
|
||||
link: baseUrl + $(link).find('a').attr('href') || '',
|
||||
});
|
||||
});
|
||||
if (episodesLink.length > 0) {
|
||||
return episodesLink;
|
||||
}
|
||||
}
|
||||
if (url.includes('/pack')) {
|
||||
const epIds = await extractKmhdEpisodes(url, providerContext);
|
||||
epIds?.forEach((id, index) => {
|
||||
episodesLink.push({
|
||||
title: `Episode ${index + 1}`,
|
||||
link: url.split('/pack')[0] + '/file/' + id,
|
||||
});
|
||||
});
|
||||
}
|
||||
const res = await axios.get(url, {
|
||||
headers: {
|
||||
Cookie: '_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true',
|
||||
},
|
||||
});
|
||||
const episodeData = res.data;
|
||||
const $ = cheerio.load(episodeData);
|
||||
const links = $('.autohyperlink');
|
||||
links?.map((i, link) => {
|
||||
episodesLink.push({
|
||||
title: $(link).parent().children().remove().end().text() || '',
|
||||
link: $(link).attr('href') || '',
|
||||
});
|
||||
});
|
||||
return episodesLink;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.katEpisodeLinks = katEpisodeLinks;
|
||||
async function extractKmhdLink(katlink, providerContext) {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(katlink);
|
||||
const data = res.data;
|
||||
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
|
||||
const hubDriveLink = data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1];
|
||||
return hubDriveLink + hubDriveRes;
|
||||
}
|
||||
async function extractKmhdEpisodes(katlink, providerContext) {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(katlink);
|
||||
const data = res.data;
|
||||
const ids = data.match(/[\w]+_[a-f0-9]{8}/g);
|
||||
return ids;
|
||||
}
|
||||
115
dist/katmovies/katGetInfo.js
vendored
115
dist/katmovies/katGetInfo.js
vendored
@@ -1,115 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.katGetInfo = void 0;
|
||||
const katGetInfo = 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 container = $('.yQ8hqd.ksSzJd.LoQAYe').html()
|
||||
? $('.yQ8hqd.ksSzJd.LoQAYe')
|
||||
: $('.FxvUNb');
|
||||
const imdbId = container
|
||||
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
|
||||
.attr('href')
|
||||
?.split('/')[4] || '';
|
||||
const title = container
|
||||
.find('li:contains("Name")')
|
||||
.children()
|
||||
.remove()
|
||||
.end()
|
||||
.text();
|
||||
const type = $('.yQ8hqd.ksSzJd.LoQAYe').html() ? 'series' : 'movie';
|
||||
const synopsis = container.find('li:contains("Stars")').text();
|
||||
const image = $('h4:contains("SCREENSHOTS")').next().find('img').attr('src') || '';
|
||||
console.log('katGetInfo', title, synopsis, image, imdbId, type);
|
||||
// Links
|
||||
const links = [];
|
||||
const directLink = [];
|
||||
// direct links
|
||||
$('.entry-content')
|
||||
.find('p:contains("Episode")')
|
||||
.each((i, element) => {
|
||||
const dlLink = $(element)
|
||||
.nextAll('h3,h2')
|
||||
.first()
|
||||
.find('a:contains("1080"),a:contains("720"),a:contains("480")')
|
||||
.attr('href') || '';
|
||||
const dlTitle = $(element).find('span').text();
|
||||
if (link.trim().length > 0 && dlTitle.includes('Episode ')) {
|
||||
directLink.push({
|
||||
title: dlTitle,
|
||||
link: dlLink,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (directLink.length > 0) {
|
||||
links.push({
|
||||
quality: '',
|
||||
title: title,
|
||||
directLinks: directLink,
|
||||
});
|
||||
}
|
||||
$('.entry-content')
|
||||
.find('pre')
|
||||
.nextUntil('div')
|
||||
.filter('h2')
|
||||
.each((i, element) => {
|
||||
const link = $(element).find('a').attr('href');
|
||||
const quality = $(element)
|
||||
.text()
|
||||
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || '';
|
||||
const title = $(element).text();
|
||||
if (link && title.includes('')) {
|
||||
links.push({
|
||||
quality,
|
||||
title,
|
||||
episodesLink: link,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (links.length === 0 && type === 'movie') {
|
||||
$('.entry-content')
|
||||
.find('h2:contains("DOWNLOAD"),h3:contains("DOWNLOAD")')
|
||||
.nextUntil('pre,div')
|
||||
.filter('h2')
|
||||
.each((i, element) => {
|
||||
const link = $(element).find('a').attr('href');
|
||||
const quality = $(element)
|
||||
.text()
|
||||
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || '';
|
||||
const title = $(element).text();
|
||||
if (link && !title.includes('Online')) {
|
||||
links.push({
|
||||
quality,
|
||||
title,
|
||||
directLinks: [{ link, title, type: 'movie' }],
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// console.log('drive meta', title, synopsis, image, imdbId, type, links);
|
||||
return {
|
||||
title,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.katGetInfo = katGetInfo;
|
||||
44
dist/katmovies/katGetPosts.js
vendored
44
dist/katmovies/katGetPosts.js
vendored
@@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.katGetPostsSearch = exports.katGetPosts = void 0;
|
||||
const katGetPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl('kat');
|
||||
const url = `${baseUrl + filter}/page/${page}/`;
|
||||
return posts({ url, signal, cheerio });
|
||||
};
|
||||
exports.katGetPosts = katGetPosts;
|
||||
const katGetPostsSearch = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl('kat');
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, cheerio });
|
||||
};
|
||||
exports.katGetPostsSearch = katGetPostsSearch;
|
||||
async function posts({ url, signal, cheerio, }) {
|
||||
try {
|
||||
const res = await fetch(url, { signal });
|
||||
const data = await res.text();
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$('.recent-posts')
|
||||
.children()
|
||||
.map((i, element) => {
|
||||
const title = $(element).find('img').attr('alt');
|
||||
const link = $(element).find('a').attr('href');
|
||||
const image = $(element).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('katmovies error ', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
90
dist/katmovies/katGetSteam.js
vendored
90
dist/katmovies/katGetSteam.js
vendored
@@ -1,90 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.katGetStream = katGetStream;
|
||||
async function extractKmhdLink(katlink, providerContext) {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(katlink);
|
||||
const data = res.data;
|
||||
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
|
||||
const hubDriveLink = data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1];
|
||||
return hubDriveLink + hubDriveRes;
|
||||
}
|
||||
async function katGetStream({ link, signal, providerContext, }) {
|
||||
const { axios, cheerio, extractors } = providerContext;
|
||||
const { hubcloudExtracter, gdFlixExtracter } = extractors;
|
||||
const streamLinks = [];
|
||||
console.log('katGetStream', link);
|
||||
try {
|
||||
if (link.includes('gdflix')) {
|
||||
return await gdFlixExtracter(link, signal);
|
||||
}
|
||||
if (link.includes('kmhd')) {
|
||||
const hubcloudLink = await extractKmhdLink(link, providerContext);
|
||||
return await hubcloudExtracter(hubcloudLink, signal);
|
||||
}
|
||||
if (link.includes('gdflix')) {
|
||||
// resume link
|
||||
try {
|
||||
const resumeDrive = link.replace('/file', '/zfile');
|
||||
// console.log('resumeDrive', resumeDrive);
|
||||
const resumeDriveRes = await axios.get(resumeDrive);
|
||||
const resumeDriveHtml = resumeDriveRes.data;
|
||||
const $resumeDrive = cheerio.load(resumeDriveHtml);
|
||||
const resumeLink = $resumeDrive('.btn-success').attr('href');
|
||||
console.log('resumeLink', resumeLink);
|
||||
if (resumeLink) {
|
||||
streamLinks.push({
|
||||
server: 'ResumeCloud',
|
||||
link: resumeLink,
|
||||
type: 'mkv',
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log('Resume link not found');
|
||||
}
|
||||
//instant link
|
||||
try {
|
||||
const driveres = await axios.get(link, { timeout: 10000 });
|
||||
const $drive = cheerio.load(driveres.data);
|
||||
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';
|
||||
// console.log('videoSeedUrl', videoSeedUrl);
|
||||
const instantLinkRes = await fetch(videoSeedUrl, {
|
||||
method: 'POST',
|
||||
body: InstantFromData,
|
||||
headers: {
|
||||
'x-token': videoSeedUrl,
|
||||
},
|
||||
});
|
||||
const instantLinkData = await instantLinkRes.json();
|
||||
console.log('instantLinkData', instantLinkData);
|
||||
if (instantLinkData.error === false) {
|
||||
const instantLink = instantLinkData.url;
|
||||
streamLinks.push({
|
||||
server: 'Gdrive-Instant',
|
||||
link: instantLink,
|
||||
type: 'mkv',
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log('Instant link not found', instantLinkData);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log('Instant link not found', err);
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
const stereams = await hubcloudExtracter(link, signal);
|
||||
return stereams;
|
||||
}
|
||||
catch (error) {
|
||||
console.log('katgetStream error: ', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
115
dist/katmovies/meta.js
vendored
115
dist/katmovies/meta.js
vendored
@@ -1,115 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = 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 container = $(".yQ8hqd.ksSzJd.LoQAYe").html()
|
||||
? $(".yQ8hqd.ksSzJd.LoQAYe")
|
||||
: $(".FxvUNb");
|
||||
const imdbId = container
|
||||
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
|
||||
.attr("href")
|
||||
?.split("/")[4] || "";
|
||||
const title = container
|
||||
.find('li:contains("Name")')
|
||||
.children()
|
||||
.remove()
|
||||
.end()
|
||||
.text();
|
||||
const type = $(".yQ8hqd.ksSzJd.LoQAYe").html() ? "series" : "movie";
|
||||
const synopsis = container.find('li:contains("Stars")').text();
|
||||
const image = $('h4:contains("SCREENSHOTS")').next().find("img").attr("src") || "";
|
||||
console.log("katGetInfo", title, synopsis, image, imdbId, type);
|
||||
// Links
|
||||
const links = [];
|
||||
const directLink = [];
|
||||
// direct links
|
||||
$(".entry-content")
|
||||
.find('p:contains("Episode")')
|
||||
.each((i, element) => {
|
||||
const dlLink = $(element)
|
||||
.nextAll("h3,h2")
|
||||
.first()
|
||||
.find('a:contains("1080"),a:contains("720"),a:contains("480")')
|
||||
.attr("href") || "";
|
||||
const dlTitle = $(element).find("span").text();
|
||||
if (link.trim().length > 0 && dlTitle.includes("Episode ")) {
|
||||
directLink.push({
|
||||
title: dlTitle,
|
||||
link: dlLink,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (directLink.length > 0) {
|
||||
links.push({
|
||||
quality: "",
|
||||
title: title,
|
||||
directLinks: directLink,
|
||||
});
|
||||
}
|
||||
$(".entry-content")
|
||||
.find("pre")
|
||||
.nextUntil("div")
|
||||
.filter("h2")
|
||||
.each((i, element) => {
|
||||
const link = $(element).find("a").attr("href");
|
||||
const quality = $(element)
|
||||
.text()
|
||||
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
|
||||
const title = $(element).text();
|
||||
if (link && title.includes("")) {
|
||||
links.push({
|
||||
quality,
|
||||
title,
|
||||
episodesLink: link,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (links.length === 0 && type === "movie") {
|
||||
$(".entry-content")
|
||||
.find('h2:contains("DOWNLOAD"),h3:contains("DOWNLOAD")')
|
||||
.nextUntil("pre,div")
|
||||
.filter("h2")
|
||||
.each((i, element) => {
|
||||
const link = $(element).find("a").attr("href");
|
||||
const quality = $(element)
|
||||
.text()
|
||||
.match(/\b(480p|720p|1080p|2160p)\b/i)?.[0] || "";
|
||||
const title = $(element).text();
|
||||
if (link && !title.includes("Online")) {
|
||||
links.push({
|
||||
quality,
|
||||
title,
|
||||
directLinks: [{ link, title, type: "movie" }],
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// console.log('drive meta', title, synopsis, image, imdbId, type, links);
|
||||
return {
|
||||
title,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
44
dist/katmovies/posts.js
vendored
44
dist/katmovies/posts.js
vendored
@@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("kat");
|
||||
const url = `${baseUrl + filter}/page/${page}/`;
|
||||
return posts({ url, signal, cheerio });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("kat");
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, cheerio });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, signal, cheerio, }) {
|
||||
try {
|
||||
const res = await fetch(url, { signal });
|
||||
const data = await res.text();
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$(".recent-posts")
|
||||
.children()
|
||||
.map((i, element) => {
|
||||
const title = $(element).find("img").attr("alt");
|
||||
const link = $(element).find("a").attr("href");
|
||||
const image = $(element).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("katmovies error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user