This commit is contained in:
4DBug committed 2026-10-27 05:49:38 -05:00
1 parent bcf05e8063
commit f37985b4c8
109 files changed
+22810 -6143

No files matched your search

+490 -1
View File
@@ -1 +1,490 @@
const _0x242fc1=_0x35c1;(function(_0x3e594b,_0x19aec9){const _0x2b9eba={_0x4ee093:0x117,_0x57b392:0x10b,_0x2e0f2c:0x114},_0x33e261=_0x35c1,_0x165159=_0x3e594b();while(!![]){try{const _0x333e0c=parseInt(_0x33e261(_0x2b9eba._0x4ee093))/0x1+-parseInt(_0x33e261(0xf3))/0x2+-parseInt(_0x33e261(0xc3))/0x3*(parseInt(_0x33e261(0xea))/0x4)+parseInt(_0x33e261(0x122))/0x5*(parseInt(_0x33e261(_0x2b9eba._0x57b392))/0x6)+-parseInt(_0x33e261(_0x2b9eba._0x2e0f2c))/0x7+parseInt(_0x33e261(0xc5))/0x8*(parseInt(_0x33e261(0xc9))/0x9)+parseInt(_0x33e261(0xdd))/0xa;if(_0x333e0c===_0x19aec9)break;else _0x165159['push'](_0x165159['shift']());}catch(_0x4f1033){_0x165159['push'](_0x165159['shift']());}}}(_0x4846,0x1bbe8));var __create=Object[_0x242fc1(0x123)],__defProp=Object[_0x242fc1(0xf1)],__defProps=Object[_0x242fc1(0x107)],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__getOwnPropDescs=Object[_0x242fc1(0xd1)],__getOwnPropNames=Object['getOwnPropertyNames'],__getOwnPropSymbols=Object['getOwnPropertySymbols'],__getProtoOf=Object['getPrototypeOf'],__hasOwnProp=Object['prototype']['hasOwnProperty'],__propIsEnum=Object['prototype']['propertyIsEnumerable'],__defNormalProp=(_0x4e72ae,_0x3282fc,_0x221b73)=>_0x3282fc in _0x4e72ae?__defProp(_0x4e72ae,_0x3282fc,{'enumerable':!![],'configurable':!![],'writable':!![],'value':_0x221b73}):_0x4e72ae[_0x3282fc]=_0x221b73,__spreadValues=(_0x4d6a07,_0x5914a3)=>{const _0x22aeaf=_0x242fc1;for(var _0x32fca5 in _0x5914a3||(_0x5914a3={}))if(__hasOwnProp['call'](_0x5914a3,_0x32fca5))__defNormalProp(_0x4d6a07,_0x32fca5,_0x5914a3[_0x32fca5]);if(__getOwnPropSymbols)for(var _0x32fca5 of __getOwnPropSymbols(_0x5914a3)){if(__propIsEnum[_0x22aeaf(0xf8)](_0x5914a3,_0x32fca5))__defNormalProp(_0x4d6a07,_0x32fca5,_0x5914a3[_0x32fca5]);}return _0x4d6a07;},__spreadProps=(_0x52825b,_0xd74939)=>__defProps(_0x52825b,__getOwnPropDescs(_0xd74939)),__copyProps=(_0x4cbd15,_0x15a416,_0x5eab40,_0x1f3bf3)=>{const _0x3b3296={_0x4e968b:0xf2,_0x370629:0xf8},_0x4410db=_0x242fc1;if(_0x15a416&&typeof _0x15a416===_0x4410db(_0x3b3296._0x4e968b)||typeof _0x15a416==='function'){for(let _0x1989d1 of __getOwnPropNames(_0x15a416))if(!__hasOwnProp[_0x4410db(_0x3b3296._0x370629)](_0x4cbd15,_0x1989d1)&&_0x1989d1!==_0x5eab40)__defProp(_0x4cbd15,_0x1989d1,{'get':()=>_0x15a416[_0x1989d1],'enumerable':!(_0x1f3bf3=__getOwnPropDesc(_0x15a416,_0x1989d1))||_0x1f3bf3['enumerable']});}return _0x4cbd15;},__toESM=(_0x39ed5c,_0x3259c6,_0x27c5fe)=>(_0x27c5fe=_0x39ed5c!=null?__create(__getProtoOf(_0x39ed5c)):{},__copyProps(_0x3259c6||!_0x39ed5c||!_0x39ed5c['__esModule']?__defProp(_0x27c5fe,'default',{'value':_0x39ed5c,'enumerable':!![]}):_0x27c5fe,_0x39ed5c)),__async=(_0x4c12ba,_0x33dc1c,_0x14776b)=>{const _0x5f32e6={_0x30a4f4:0x129};return new Promise((_0x1a2e5a,_0x54d7fb)=>{const _0x2d4df6=_0x35c1;var _0x269212=_0x4db031=>{try{_0x4492b0(_0x14776b['next'](_0x4db031));}catch(_0x343140){_0x54d7fb(_0x343140);}},_0x46683d=_0xbc53a0=>{try{_0x4492b0(_0x14776b['throw'](_0xbc53a0));}catch(_0x328dfc){_0x54d7fb(_0x328dfc);}},_0x4492b0=_0x1c8fe3=>_0x1c8fe3[_0x2d4df6(0xc4)]?_0x1a2e5a(_0x1c8fe3[_0x2d4df6(0x100)]):Promise[_0x2d4df6(0xcf)](_0x1c8fe3[_0x2d4df6(0x100)])[_0x2d4df6(0xe5)](_0x269212,_0x46683d);_0x4492b0((_0x14776b=_0x14776b[_0x2d4df6(0x104)](_0x4c12ba,_0x33dc1c))[_0x2d4df6(_0x5f32e6._0x30a4f4)]());});},import_cheerio_without_node_native=__toESM(require(_0x242fc1(0x102))),PROVIDER_NAME=_0x242fc1(0xce),BASE_URL='https://4khdhub.one',TMDB_URL=_0x242fc1(0x111),TMDB_KEY='439c478a771f35c05022f9feabcca01c',USER_AGENT=_0x242fc1(0x12f),HEADERS={'User-Agent':USER_AGENT,'Referer':BASE_URL+'/'};function getInvertedSortTag(_0x368260,_0x392912=0xf423f){const _0x3fca6c={_0x4f6a2d:0xf5},_0xe3375f=_0x242fc1,_0x2c6b4d=Math[_0xe3375f(0xf6)](0x0,parseInt(_0x368260,0xa)||0x0),_0x1aaba3=Math[_0xe3375f(0xf6)](0x0,_0x392912-_0x2c6b4d),_0x5cc5d7=_0x1aaba3[_0xe3375f(0xc6)](0x2)[_0xe3375f(_0x3fca6c._0x4f6a2d)](0x14,'0');return _0x5cc5d7[_0xe3375f(0xf9)]('')['map'](_0x3fbe34=>_0x3fbe34==='1'?'\ufeff':'​')['join']('');}function resolveSettings(_0x1910f8){const _0x1c8f73={_0x4dea26:0xda,_0xd7994c:0xbf,_0x58a36a:0xd0,_0x13172f:0xde,_0x42cca7:0x108,_0x10b3c2:0xf2,_0xe839ba:0xe0,_0x4a0d2e:0x108},_0x552eb6=_0x242fc1;let _0x34e00e={'sortBy':_0x552eb6(_0x1c8f73._0x4dea26)};try{let _0x1ec629=_0x1910f8;!_0x1ec629&&typeof globalThis!==_0x552eb6(_0x1c8f73._0xd7994c)&&(_0x1ec629=globalThis['SCRAPER_SETTINGS']||globalThis[_0x552eb6(_0x1c8f73._0x58a36a)]||globalThis['settings']);!_0x1ec629&&typeof global!=='undefined'&&(_0x1ec629=global['SCRAPER_SETTINGS']||global['SETTINGS']||global['settings']);!_0x1ec629&&typeof window!=='undefined'&&(_0x1ec629=window[_0x552eb6(_0x1c8f73._0x13172f)]||window[_0x552eb6(_0x1c8f73._0x58a36a)]||window['settings']);if(_0x1ec629){var _0x269144=_0x1ec629[_0x552eb6(_0x1c8f73._0x42cca7)]||_0x1ec629['sort_by']||_0x1ec629[_0x552eb6(0xf4)]||'';typeof _0x269144===_0x552eb6(_0x1c8f73._0x10b3c2)&&_0x269144!==null&&(_0x269144=_0x269144[_0x552eb6(0x100)]||_0x269144[_0x552ebLine truncated
"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
var BASE_URL = "https://4khdhub.click";
var TMDB_API_KEY = "439c478a771f35c05022f9feabcca01c";
var USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36";
var DOMAINS_URL = "https://raw.githubusercontent.com/phisher98/TVVVV/refs/heads/main/domains.json";
var domainCache = { url: BASE_URL, ts: 0 };
function fetchLatestDomain() {
return __async(this, null, function* () {
const now = Date.now();
if (now - domainCache.ts < 36e5)
return domainCache.url;
try {
const response = yield fetch(DOMAINS_URL);
const data = yield response.json();
if (data && data["4khdhub"]) {
domainCache.url = data["4khdhub"];
domainCache.ts = now;
}
} catch (e) {
}
return domainCache.url;
});
}
function fetchText(_0) {
return __async(this, arguments, function* (url, options = {}) {
const retries = options.retries !== void 0 ? options.retries : 2;
const delay = options.delay !== void 0 ? options.delay : 1e3;
for (let i = 0; i <= retries; i++) {
try {
const response = yield fetch(url, {
headers: __spreadValues({
"User-Agent": USER_AGENT
}, options.headers)
});
return yield response.text();
} catch (err) {
console.log(`[4KHDHub] Request failed for ${url}: ${err.message}${i < retries ? `, retrying (${i + 1}/${retries})...` : ""}`);
}
if (i < retries) {
yield new Promise((r) => setTimeout(r, delay * Math.pow(2, i)));
}
}
return null;
});
}
function getTmdbDetails(tmdbId, type) {
return __async(this, null, function* () {
const isSeries = type === "series" || type === "tv";
const endpoint = isSeries ? "tv" : "movie";
const url = `https://api.themoviedb.org/3/${endpoint}/${tmdbId}?api_key=${TMDB_API_KEY}`;
console.log(`[4KHDHub] Fetching TMDB details from: ${url}`);
try {
const response = yield fetch(url);
const data = yield response.json();
if (isSeries) {
return {
title: data.name,
year: data.first_air_date ? parseInt(data.first_air_date.split("-")[0]) : 0
};
} else {
return {
title: data.title,
year: data.release_date ? parseInt(data.release_date.split("-")[0]) : 0
};
}
} catch (error) {
console.log(`[4KHDHub] TMDB request failed: ${error.message}`);
return null;
}
});
}
function atob(input) {
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
let str = String(input).replace(/=+$/, "");
if (str.length % 4 === 1) {
throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");
}
let output = "";
for (let bc = 0, bs, buffer, i = 0; buffer = str.charAt(i++); ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0) {
buffer = chars.indexOf(buffer);
}
return output;
}
function rot13Cipher(str) {
return str.replace(/[a-zA-Z]/g, function(c) {
return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
});
}
function levenshteinDistance(s, t) {
if (s === t)
return 0;
const n = s.length;
const m = t.length;
if (n === 0)
return m;
if (m === 0)
return n;
const d = [];
for (let i = 0; i <= n; i++) {
d[i] = [];
d[i][0] = i;
}
for (let j = 0; j <= m; j++) {
d[0][j] = j;
}
for (let i = 1; i <= n; i++) {
for (let j = 1; j <= m; j++) {
const cost = s.charAt(i - 1) === t.charAt(j - 1) ? 0 : 1;
d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
}
}
return d[n][m];
}
function parseBytes(val) {
if (typeof val === "number")
return val;
if (!val)
return 0;
const match = val.match(/^([0-9.]+)\s*([a-zA-Z]+)$/);
if (!match)
return 0;
const num = parseFloat(match[1]);
const unit = match[2].toLowerCase();
let multiplier = 1;
if (unit.indexOf("k") === 0)
multiplier = 1024;
else if (unit.indexOf("m") === 0)
multiplier = 1024 * 1024;
else if (unit.indexOf("g") === 0)
multiplier = 1024 * 1024 * 1024;
else if (unit.indexOf("t") === 0)
multiplier = 1024 * 1024 * 1024 * 1024;
return num * multiplier;
}
function formatBytes(val) {
if (val === 0)
return "0 B";
const k = 1024;
const sizes = ["B", "KB", "MB", "GB", "TB"];
let i = Math.floor(Math.log(val) / Math.log(k));
if (i < 0)
i = 0;
return parseFloat((val / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
}
var cheerio = require("cheerio-without-node-native");
function fetchPageUrl(name, year, isSeries) {
return __async(this, null, function* () {
const domain = yield fetchLatestDomain();
const searchUrl = `${domain}/?s=${encodeURIComponent(name + " " + year)}`;
console.log(`[4KHDHub] Search Request URL: ${searchUrl}`);
const html = yield fetchText(searchUrl);
if (!html) {
console.log("[4KHDHub] Search failed: No HTML response");
return null;
}
const $ = cheerio.load(html);
const targetType = isSeries ? "Series" : "Movies";
console.log(`[4KHDHub] Parsing search results for type: ${targetType}`);
const matchingCards = $(".movie-card").filter((_, el) => {
const hasFormat = $(el).find(`.movie-card-format:contains("${targetType}")`).length > 0;
if (!hasFormat) {
}
return hasFormat;
}).filter((_, el) => {
const metaText = $(el).find(".movie-card-meta").text();
const movieCardYear = parseInt(metaText);
const yearMatch = !isNaN(movieCardYear) && Math.abs(movieCardYear - year) <= 1;
if (!yearMatch) {
console.log(`[4KHDHub] Skip: Year mismatch (${movieCardYear} vs ${year}) - ${$(el).find(".movie-card-title").text().trim()}`);
}
return yearMatch;
}).filter((_, el) => {
const movieCardTitle = $(el).find(".movie-card-title").text().replace(/\[.*?]/g, "").trim();
const distance = levenshteinDistance(movieCardTitle.toLowerCase(), name.toLowerCase());
const match = distance < 5;
console.log(`[4KHDHub] Checking: "${movieCardTitle}" (Dist: ${distance}) vs "${name}"`);
return match;
}).map((_, el) => {
let href = $(el).attr("href");
if (href && !href.startsWith("http")) {
href = domain + (href.startsWith("/") ? "" : "/") + href;
}
return href;
}).get();
if (matchingCards.length === 0) {
console.log("[4KHDHub] No matching cards found after filtering");
} else {
console.log(`[4KHDHub] Found ${matchingCards.length} matching cards`);
}
return matchingCards.length > 0 ? matchingCards[0] : null;
});
}
var cheerio2 = require("cheerio-without-node-native");
function resolveRedirectUrl(redirectUrl) {
return __async(this, null, function* () {
if (redirectUrl.includes("hubcloud.") || redirectUrl.includes("hubdrive.")) {
return redirectUrl;
}
const redirectHtml = yield fetchText(redirectUrl);
if (!redirectHtml)
return redirectUrl;
try {
const redirectDataMatch = redirectHtml.match(/'o','(.*?)'/);
if (!redirectDataMatch)
return redirectUrl;
const step1 = atob(redirectDataMatch[1]);
const step2 = atob(step1);
const step3 = rot13Cipher(step2);
const step4 = atob(step3);
const redirectData = JSON.parse(step4);
if (redirectData && redirectData.o) {
return atob(redirectData.o);
}
} catch (e) {
console.log(`[4KHDHub] Error resolving redirect: ${e.message}`);
}
return redirectUrl;
});
}
function extractSourceResults($, el) {
return __async(this, null, function* () {
const localHtml = $(el).html();
const sizeMatch = localHtml.match(/([\d.]+ ?[GM]B)/);
const heightMatch = localHtml.match(/\d{3,}p/);
const title = $(el).find(".file-title, .episode-file-title").text().trim();
let height = heightMatch ? parseInt(heightMatch[0]) : 0;
if (height === 0 && (title.includes("4K") || title.includes("4k") || localHtml.includes("4K") || localHtml.includes("4k"))) {
height = 2160;
}
const meta = {
bytes: sizeMatch ? parseBytes(sizeMatch[1]) : 0,
height,
title
};
const hblinksLink = $(el).find("a").filter((_, a) => {
const href = $(a).attr("href") || "";
return href.includes("hblinks") || href.includes("hubstream.dad");
}).attr("href");
if (hblinksLink) {
return { url: new URL(hblinksLink, BASE_URL).toString(), meta, extractor: "hblinks" };
}
const hubCloudLink = $(el).find("a").filter((_, a) => {
const text = $(a).text();
const href = $(a).attr("href") || "";
return text.includes("HubCloud") || href.includes("hubcloud.") || href.includes("hubcloud/");
}).attr("href");
if (hubCloudLink) {
const resolved = yield resolveRedirectUrl(hubCloudLink);
return { url: resolved, meta };
}
const hubDriveLink = $(el).find("a").filter((_, a) => {
const text = $(a).text();
const href = $(a).attr("href") || "";
return text.includes("HubDrive") || href.includes("hubdrive.") || href.includes("hubdrive/");
}).attr("href");
if (hubDriveLink) {
const resolvedDrive = yield resolveRedirectUrl(hubDriveLink);
if (resolvedDrive) {
const hubDriveHtml = yield fetchText(resolvedDrive);
if (hubDriveHtml) {
const $2 = cheerio2.load(hubDriveHtml);
const innerCloudLink = $2('a:contains("HubCloud")').attr("href") || $2("a").filter((_, a) => {
const text = $2(a).text();
const href = $2(a).attr("href") || "";
return text.includes("HubCloud") || href.includes("hubcloud.") || href.includes("hubcloud/");
}).attr("href");
if (innerCloudLink) {
return { url: innerCloudLink, meta };
}
}
}
}
return null;
});
}
function extractHubCloud(hubCloudUrl, baseMeta) {
return __async(this, null, function* () {
if (!hubCloudUrl)
return [];
const redirectHtml = yield fetchText(hubCloudUrl, { headers: { Referer: hubCloudUrl } });
if (!redirectHtml)
return [];
const redirectUrlMatch = redirectHtml.match(/var url ?= ?'(.*?)'/);
if (!redirectUrlMatch)
return [];
const finalLinksUrl = redirectUrlMatch[1];
const linksHtml = yield fetchText(finalLinksUrl, { headers: { Referer: hubCloudUrl } });
if (!linksHtml)
return [];
const $ = cheerio2.load(linksHtml);
const results = [];
const sizeText = $("#size").text();
const titleText = $("title").text().trim();
const currentMeta = __spreadProps(__spreadValues({}, baseMeta), {
bytes: parseBytes(sizeText) || baseMeta.bytes,
title: titleText || baseMeta.title
});
$("a").each((_, el) => {
const text = $(el).text().trim();
const href = $(el).attr("href");
if (!href)
return;
if (text.includes("10Gbps") || text.includes("PixelServer") || href.includes("hubcloud.cx")) {
results.push({
source: "HubCloud 10Gbps",
url: href,
meta: currentMeta
});
} else if (text.includes("Download File") || href.includes("r2.dev")) {
results.push({
source: "Direct R2",
url: href,
meta: currentMeta
});
} else if (text.includes("ZipDisk") || href.includes("workers.dev")) {
results.push({
source: "ZipDisk Server",
url: href,
meta: currentMeta
});
} else if (text.includes("FSL")) {
results.push({
source: "FSL",
url: href,
meta: currentMeta
});
}
});
return results;
});
}
function extractHblinks(hblinksUrl, baseMeta, depth = 0) {
return __async(this, null, function* () {
if (!hblinksUrl || depth > 2)
return [];
try {
const html = yield fetchText(hblinksUrl, { headers: { Referer: hblinksUrl } });
if (!html)
return [];
const $ = cheerio2.load(html);
const links = [...new Set($("h3 a, h5 a, div.entry-content p a, div.entry-content a").map((_, el) => $(el).attr("href")).get().filter(Boolean))];
const results = [];
for (const rawLink of links) {
try {
const absoluteLink = new URL(rawLink, hblinksUrl).toString();
const resolvedLink = yield resolveRedirectUrl(absoluteLink);
const link = resolvedLink || absoluteLink;
const hostname = new URL(link).hostname.toLowerCase();
if (hostname.includes("hblinks") || hostname.includes("hubstream.dad")) {
const nestedResults = yield extractHblinks(link, baseMeta, depth + 1);
results.push(...nestedResults);
} else if (hostname.includes("hubcloud")) {
const cloudResults = yield extractHubCloud(link, baseMeta);
results.push(...cloudResults);
} else if (hostname.includes("hubdrive")) {
const driveHtml = yield fetchText(link, { headers: { Referer: hblinksUrl } });
if (driveHtml) {
const $drive = cheerio2.load(driveHtml);
const cloudLink = $drive("a").filter((_, a) => {
const text = $drive(a).text();
const href = $drive(a).attr("href") || "";
return text.includes("HubCloud") || href.includes("hubcloud.") || href.includes("hubcloud/");
}).attr("href");
if (cloudLink) {
const absoluteCloudLink = new URL(cloudLink, link).toString();
const cloudResults = yield extractHubCloud(absoluteCloudLink, baseMeta);
results.push(...cloudResults);
}
}
} else if (/\.(m3u8|mpd|mp4|mkv)(?:$|\?)/i.test(link)) {
results.push({ source: "Hblinks Direct", url: link, meta: baseMeta });
}
} catch (e) {
}
}
return results;
} catch (e) {
return [];
}
});
}
var cheerio3 = require("cheerio-without-node-native");
function getStreams(tmdbId, type, season, episode) {
return __async(this, null, function* () {
const tmdbDetails = yield getTmdbDetails(tmdbId, type);
if (!tmdbDetails)
return [];
const { title, year } = tmdbDetails;
console.log(`[4KHDHub] Search: ${title} (${year})`);
const isSeries = type === "series" || type === "tv";
const pageUrl = yield fetchPageUrl(title, year, isSeries);
if (!pageUrl) {
console.log("[4KHDHub] Page not found");
return [];
}
console.log(`[4KHDHub] Found page: ${pageUrl}`);
const html = yield fetchText(pageUrl);
if (!html)
return [];
const $ = cheerio3.load(html);
const itemsToProcess = [];
if (isSeries && season && episode) {
const seasonStr = "S" + String(season).padStart(2, "0");
const episodeStr = "Episode-" + String(episode).padStart(2, "0");
$(".episode-item").each((_, el) => {
if ($(".episode-title", el).text().includes(seasonStr)) {
const downloadItems = $(".episode-download-item", el).filter((_2, item) => $(item).text().includes(episodeStr));
downloadItems.each((_2, item) => {
itemsToProcess.push(item);
});
}
});
} else {
$(".download-item").each((_, el) => {
itemsToProcess.push(el);
});
}
console.log(`[4KHDHub] Processing ${itemsToProcess.length} items`);
const streamPromises = itemsToProcess.map((item) => __async(this, null, function* () {
try {
const sourceResult = yield extractSourceResults($, item);
if (sourceResult && sourceResult.url) {
console.log(`[4KHDHub] Extracting from ${sourceResult.extractor === "hblinks" ? "Hblinks" : "HubCloud"}: ${sourceResult.url}`);
let extractedLinks;
if (sourceResult.extractor === "hblinks") {
extractedLinks = yield extractHblinks(sourceResult.url, sourceResult.meta);
} else {
extractedLinks = yield extractHubCloud(sourceResult.url, sourceResult.meta);
}
return extractedLinks.map((link) => ({
name: `4KHDHub - ${link.source}${sourceResult.meta.height ? ` ${sourceResult.meta.height}p` : ""}`,
title: `${link.meta.title}
${formatBytes(link.meta.bytes || 0)}`,
url: link.url,
quality: sourceResult.meta.height ? `${sourceResult.meta.height}p` : void 0,
behaviorHints: {
bingeGroup: `4khdhub-${link.source}`
}
}));
}
return [];
} catch (err) {
console.log(`[4KHDHub] Item processing error: ${err.message}`);
return [];
}
}));
const results = yield Promise.all(streamPromises);
return results.reduce((acc, val) => acc.concat(val), []);
});
}
module.exports = { getStreams };
+695
View File
@@ -0,0 +1,695 @@
/**
* animedekho - Built from src/animedekho/
* Generated: 2026-09-22T20:41:44.640Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/animedekho/index.js
var import_cheerio_without_node_native2 = __toESM(require("cheerio-without-node-native"));
// src/animedekho/constants.js
var MAIN_URL = "https://animedekho.app";
var TMDB_API_KEY = "1865f43a0549ca50d341dd9ab8b29f49";
var TMDB_BASE_URL = "https://api.themoviedb.org/3";
var 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";
var HEADERS = {
"User-Agent": USER_AGENT,
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5"
};
// src/animedekho/utils.js
function fetchTmdbDetails(tmdbId, mediaType) {
return __async(this, null, function* () {
var _a;
const endpoint = mediaType === "movie" ? "movie" : "tv";
const url = `${TMDB_BASE_URL}/${endpoint}/${tmdbId}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
try {
const res = yield fetch(url, { headers: HEADERS });
if (!res.ok)
return null;
const data = yield res.json();
return {
title: mediaType === "movie" ? data.title || data.original_title : data.name || data.original_name,
year: parseInt((data.release_date || data.first_air_date || "").substring(0, 4)) || null,
imdbId: ((_a = data.external_ids) == null ? void 0 : _a.imdb_id) || null
};
} catch (e) {
return null;
}
});
}
function cleanTitle(str) {
return (str || "").toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, " ").trim();
}
function titleSimilarity(a, b) {
const cleanA = cleanTitle(a);
const cleanB = cleanTitle(b);
if (!cleanA || !cleanB)
return 0;
if (cleanA === cleanB)
return 1;
if (cleanA.includes(cleanB) || cleanB.includes(cleanA))
return 0.8;
const wordsA = new Set(cleanA.split(" "));
const wordsB = new Set(cleanB.split(" "));
let intersection = 0;
for (const w of wordsA) {
if (wordsB.has(w))
intersection++;
}
return intersection * 2 / (wordsA.size + wordsB.size);
}
function unpack(code) {
try {
const match = code.match(/}\((['"])([\s\S]*?)\1,\s*(\d+),\s*(\d+),\s*(['"])([\s\S]*?)\5\.split\((['"])\|\7\)/);
if (match) {
let [_, quote1, p, a, c, quote2, kStr] = match;
p = p.replace(/\\'/g, "'").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
const radix = parseInt(a);
let count = parseInt(c);
const k = kStr.split("|");
const e = (c2) => (c2 < radix ? "" : e(parseInt(c2 / radix))) + ((c2 = c2 % radix) > 35 ? String.fromCharCode(c2 + 29) : c2.toString(36));
const d = {};
while (count--)
d[e(count)] = k[count] || e(count);
return p.replace(/\b\w+\b/g, (w) => d[w]);
}
} catch (e) {
}
return code;
}
function isRealStreamUrl(url) {
if (!url || typeof url !== "string")
return false;
if (!url.startsWith("http://") && !url.startsWith("https://"))
return false;
const lowercase = url.toLowerCase();
if (lowercase.includes("/embed/") || lowercase.includes("/embed-") || lowercase.includes("/e/") || lowercase.includes("/play.php") || lowercase.includes("/player.php") || lowercase.includes("abyssplayer.com") || lowercase.includes("short.icu") || lowercase.includes("cloudy.upns.one") || lowercase.includes("vidcloud.upns.ink") || lowercase.includes("filesforever.link") || lowercase.includes("strmup.to") || lowercase.includes("emturbovid.com") || lowercase.includes("animedekho.app") || lowercase.includes("animesalt.cx") || lowercase.includes("youtube.com") || lowercase.includes("youtu.be") || lowercase.includes("vimeo.com") || lowercase.includes(".html") || lowercase.includes(".htm") || lowercase.includes(".php") || lowercase.includes("#")) {
return false;
}
const isHls = lowercase.includes(".m3u8");
const isMp4 = lowercase.includes(".mp4") || lowercase.includes("/sora/") || lowercase.includes("/stream/");
return isHls || isMp4 || lowercase.includes(".mkv") || lowercase.includes(".mpd");
}
function isPlayableStream(stream) {
return __async(this, null, function* () {
if (!isRealStreamUrl(stream == null ? void 0 : stream.url))
return false;
try {
const headers = __spreadProps(__spreadValues({
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
}, stream.headers || {}), {
"Range": "bytes=0-10"
});
const res = yield fetch(stream.url, {
headers,
signal: AbortSignal.timeout(3e3)
});
if (!res.ok && res.status !== 206)
return false;
const contentType = res.headers.get("content-type") || "";
if (contentType.includes("text/html"))
return false;
return true;
} catch (e) {
return false;
}
});
}
// src/animedekho/extractors.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
function extractStreamRuby(url) {
return __async(this, null, function* () {
try {
const cleanedUrl = url.replace("/e/", "/");
const res = yield fetch(cleanedUrl, {
headers: __spreadProps(__spreadValues({}, HEADERS), {
"X-Requested-With": "XMLHttpRequest",
"Referer": cleanedUrl
})
});
if (!res.ok)
return null;
const html = yield res.text();
let m3u8 = null;
const packedMatch = html.match(/eval\(function\(p,a,c,k,e,d\)[\s\S]*?\.split\(['"]\|['"]\)\)/);
if (packedMatch) {
const unpacked = unpack(packedMatch[0]);
const match = unpacked.match(/file\s*:\s*["'](https?:\/\/[^"']+\.m3u8[^"']*)["']/);
if (match)
m3u8 = match[1];
}
if (!m3u8) {
const directMatch = html.match(/file\s*:\s*["'](https?:\/\/[^"']+\.m3u8[^"']*)["']/);
if (directMatch)
m3u8 = directMatch[1];
}
if (!m3u8)
return null;
const origin = new URL(cleanedUrl).origin;
return {
name: "AnimeDekho [StreamRuby] (Auto M3U8)",
url: m3u8,
quality: "720p",
headers: {
"Origin": origin,
"Referer": `${cleanedUrl}/`,
"User-Agent": HEADERS["User-Agent"]
},
type: "m3u8"
};
} catch (e) {
return null;
}
});
}
function extractVidmoly(url) {
return __async(this, null, function* () {
try {
const res = yield fetch(url, {
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Referer": "https://animedekho.app/"
})
});
if (!res.ok)
return null;
const html = yield res.text();
const match = html.match(/file\s*:\s*["'](https?:\/\/[^"'\s]+\.m3u8[^"'\s]*)["']/);
if (!match || !match[1])
return null;
const origin = new URL(url).origin;
return {
name: "AnimeDekho [Vidmoly] (Auto M3U8)",
url: match[1],
quality: "1080p",
headers: {
"Referer": `${origin}/`,
"Origin": origin,
"User-Agent": HEADERS["User-Agent"]
},
type: "m3u8"
};
} catch (e) {
return null;
}
});
}
function extractAbyss(url, langName = "Default") {
return __async(this, null, function* () {
var _a;
try {
const cleanUrl = url.replace("https://short.icu", "https://abyssplayer.com");
const reqHeaders = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36",
"Origin": "https://playhydrax.com",
"Referer": "https://playhydrax.com/"
};
const res = yield fetch(cleanUrl, { headers: reqHeaders });
if (!res.ok)
return [];
const html = yield res.text();
const match = html.match(/const\s+datas\s*=\s*"([^"]*)"/);
if (!match || !match[1])
return [];
const decRes = yield fetch("https://enc-dec.app/api/dec-abyss", {
method: "POST",
headers: __spreadProps(__spreadValues({}, reqHeaders), {
"Content-Type": "application/json"
}),
body: JSON.stringify({ text: match[1] })
});
if (!decRes.ok)
return [];
const decData = yield decRes.json();
const sources = ((_a = decData == null ? void 0 : decData.result) == null ? void 0 : _a.sources) || [];
return sources.filter((s) => s && s.url && s.status).map((s) => {
const codec = (s.codec || "MP4").toUpperCase();
const quality = s.type || "720p";
return {
name: `AnimeDekho [${langName}] (${codec} ${quality})`,
url: s.url,
quality,
headers: {
"Referer": "https://playhydrax.com/",
"Origin": "https://playhydrax.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
},
type: s.url.includes(".m3u8") ? "m3u8" : "mp4"
};
});
} catch (e) {
return [];
}
});
}
function extractAwsStream(url) {
return __async(this, null, function* () {
try {
const hash = url.split("/").filter(Boolean).pop();
if (!hash)
return null;
const origin = new URL(url).origin;
const res = yield fetch(url, { headers: HEADERS });
if (!res.ok)
return null;
const html = yield res.text();
const postUrl = `${origin}/player/index.php?data=${hash}&do=getVideo`;
const postRes = yield fetch(postUrl, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), {
"x-requested-with": "XMLHttpRequest",
"Origin": origin,
"Referer": url,
"Content-Type": "application/x-www-form-urlencoded"
}),
body: `hash=${encodeURIComponent(hash)}&r=${encodeURIComponent(origin)}`
});
if (!postRes.ok)
return null;
const json = yield postRes.json();
const m3u8 = json == null ? void 0 : json.videoSource;
if (!m3u8)
return null;
let subtitle = null;
const packedMatch = html.match(/eval\(function\(p,a,c,k,e,d\)[\s\S]*?\.split\(['"]\|['"]\)\)/);
if (packedMatch) {
const unpacked = unpack(packedMatch[0]);
const subMatch = unpacked.match(/"kind":\s*"captions"\s*,\s*"file":\s*"(https?:\/\/[^"]+)"/);
if (subMatch) {
subtitle = subMatch[1].replace(/\\/g, "");
}
}
return {
name: "AnimeDekho [AWSStream] (Auto M3U8)",
url: m3u8,
quality: "1080p",
headers: {
"Referer": `${origin}/`,
"Origin": origin,
"User-Agent": HEADERS["User-Agent"]
},
subtitles: subtitle ? [{ lang: "English", url: subtitle }] : [],
type: "m3u8"
};
} catch (e) {
return null;
}
});
}
function extractStreamWish(url) {
return __async(this, null, function* () {
try {
const embedUrl = url.includes("/e/") ? url : url.includes("/embed/") ? url : url.replace("/f/", "/e/");
const res = yield fetch(embedUrl, { headers: HEADERS });
if (!res.ok)
return null;
const html = yield res.text();
const packedMatch = html.match(/eval\(function\(p,a,c,k,e,d\)[\s\S]*?\.split\(['"]\|['"]\)\)/);
if (packedMatch) {
const unpacked = unpack(packedMatch[0]);
const fileMatch = unpacked.match(/file\s*:\s*["'](https?:\/\/[^"'\s]+\.m3u8(?:\?[^"'\s]*)?)["']/);
if (fileMatch) {
const origin = new URL(embedUrl).origin;
return {
name: "AnimeDekho [StreamWish] (Auto M3U8)",
url: fileMatch[1],
quality: "720p",
headers: {
"Referer": `${origin}/`,
"Origin": origin,
"User-Agent": HEADERS["User-Agent"]
},
type: "m3u8"
};
}
}
} catch (e) {
}
return null;
});
}
function extractBlakite(url) {
return __async(this, null, function* () {
var _a;
try {
const id = url.split("/").filter(Boolean).pop();
const tmdbMatch = url.match(/embed\/([^/]+)/);
const tmdbId = tmdbMatch ? tmdbMatch[1] : "";
const apiUrl = `https://blakiteapi.xyz/api/get.php?id=${id}&tmdbId=${tmdbId}`;
const res = yield fetch(apiUrl, { headers: HEADERS });
if (!res.ok)
return null;
const json = yield res.json();
if (!(json == null ? void 0 : json.success) || !((_a = json == null ? void 0 : json.data) == null ? void 0 : _a.dataId))
return null;
const dataId = json.data.dataId;
const format = json.data.format || "mp4";
const quality = json.data.quality || "720p";
const streamUrl = `https://blakiteapi.xyz/stream/${dataId}.${format}`;
return {
name: `AnimeDekho [Blakite] (${quality})`,
url: streamUrl,
quality,
headers: {
"Referer": "https://blakiteapi.xyz/",
"User-Agent": HEADERS["User-Agent"]
},
type: format.toLowerCase().includes("m3u8") ? "m3u8" : "mp4"
};
} catch (e) {
return null;
}
});
}
function extractVidStack(url) {
return __async(this, null, function* () {
try {
const hash = url.split("#").pop().split("/").pop();
if (!hash)
return null;
const origin = new URL(url).origin;
const res = yield fetch(`${origin}/api/v1/video?id=${hash}`, {
headers: HEADERS
});
if (!res.ok)
return null;
const text = (yield res.text()).trim();
const match = text.match(/https?:\/\/[^"'\s]+\.m3u8[^"'\s]*/);
if (!match)
return null;
return {
name: "AnimeDekho [VidStack] (Auto M3U8)",
url: match[0],
quality: "720p",
headers: {
"Referer": `${origin}/`,
"User-Agent": HEADERS["User-Agent"]
},
type: "m3u8"
};
} catch (e) {
return null;
}
});
}
// src/animedekho/index.js
function searchAnimeDekho(query) {
return __async(this, null, function* () {
try {
const url = `${MAIN_URL}/?s=${encodeURIComponent(query)}`;
const res = yield fetch(url, { headers: HEADERS });
if (!res.ok)
return [];
const html = yield res.text();
const $ = import_cheerio_without_node_native2.default.load(html);
const results = [];
$("ul[data-results] li article, article.post, article").each((_, el) => {
const title = $(el).find("header h2, h2").text().trim();
const href = $(el).find("a.lnk-blk, a").first().attr("href");
if (title && href) {
results.push({ title, href });
}
});
return results;
} catch (e) {
return [];
}
});
}
function getStreams(tmdbId, mediaType, seasonNum = 1, episodeNum = 1) {
return __async(this, null, function* () {
try {
const details = yield fetchTmdbDetails(tmdbId, mediaType);
if (!details || !details.title)
return [];
let results = yield searchAnimeDekho(details.title);
if (results.length === 0) {
const cleaned = cleanTitle(details.title);
if (cleaned && cleaned !== details.title.toLowerCase()) {
results = yield searchAnimeDekho(cleaned);
}
}
if (results.length === 0)
return [];
let bestMatch = null;
let highestSim = 0;
for (const item of results) {
const sim = titleSimilarity(details.title, item.title);
if (sim > highestSim) {
highestSim = sim;
bestMatch = item;
}
}
if (!bestMatch || highestSim < 0.2) {
bestMatch = results[0];
}
let targetUrl = bestMatch.href;
const mediaTypeVal = mediaType === "movie" ? 1 : 2;
if (mediaType === "tv") {
const seriesRes = yield fetch(bestMatch.href, {
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Cookie": "toronites_server=vidstream"
})
});
if (!seriesRes.ok)
return [];
const seriesHtml = yield seriesRes.text();
const $series = import_cheerio_without_node_native2.default.load(seriesHtml);
let targetEpUrl = null;
const epElements = $series("ul.seasons-lst li");
epElements.each((_, el) => {
const epText = $series(el).find("h3.title").text().trim();
const epHref = $series(el).find("a").first().attr("href");
if (epText && epHref) {
const sMatch = epText.match(/S(\d+)[\s-]*E(\d+)/i) || epText.match(/(\d+)x(\d+)/i);
if (sMatch) {
const s = parseInt(sMatch[1]);
const e = parseInt(sMatch[2]);
if (s === seasonNum && e === episodeNum) {
targetEpUrl = epHref;
}
} else if (epText.includes(`E${episodeNum}`) || epText.includes(`Episode ${episodeNum}`)) {
if (seasonNum === 1)
targetEpUrl = epHref;
}
}
});
if (!targetEpUrl && epElements.length >= episodeNum && seasonNum === 1) {
targetEpUrl = $series(epElements[episodeNum - 1]).find("a").first().attr("href");
}
if (targetEpUrl) {
targetUrl = targetEpUrl;
}
}
const pageRes = yield fetch(targetUrl, {
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Cookie": "toronites_server=vidstream"
})
});
if (!pageRes.ok)
return [];
const pageHtml = yield pageRes.text();
const $page = import_cheerio_without_node_native2.default.load(pageHtml);
const iframeUrls = /* @__PURE__ */ new Set();
const serverPromises = [];
$page("iframe.serversel[src], iframe[src]").each((_, el) => {
const src = $page(el).attr("src");
if (src && !src.startsWith("about:") && !src.startsWith("javascript:")) {
const fullSrc = src.startsWith("//") ? `https:${src}` : src.startsWith("http") ? src : `${MAIN_URL}${src}`;
if (fullSrc.includes("animedekho.app/embed/")) {
serverPromises.push(
fetch(fullSrc, { headers: HEADERS }).then((r) => __async(this, null, function* () {
if (!r.ok)
return;
const h = yield r.text();
const $inner = import_cheerio_without_node_native2.default.load(h);
$inner("iframe[src]").each((_2, iEl) => {
const iSrc = $inner(iEl).attr("src");
if (iSrc && !iSrc.startsWith("about:"))
iframeUrls.add(iSrc);
});
})).catch(() => {
})
);
} else {
iframeUrls.add(fullSrc);
}
}
});
yield Promise.allSettled(serverPromises);
const bodyClass = $page("body").attr("class") || "";
const termMatch = bodyClass.match(/(?:term|postid)-(\d+)/);
if (termMatch && termMatch[1]) {
const termId = termMatch[1];
const trdekhoPromises = [];
for (let i = 0; i <= 10; i++) {
const trUrl = `${MAIN_URL}/?trdekho=${i}&trid=${termId}&trtype=${mediaTypeVal}`;
trdekhoPromises.push(
fetch(trUrl, { headers: HEADERS }).then((r) => __async(this, null, function* () {
if (!r.ok)
return;
const h = yield r.text();
const $tr = import_cheerio_without_node_native2.default.load(h);
const iSrc = $tr("iframe").attr("src");
if (iSrc && !iSrc.startsWith("about:")) {
const full = iSrc.startsWith("//") ? `https:${iSrc}` : iSrc.startsWith("http") ? iSrc : `${MAIN_URL}${iSrc}`;
iframeUrls.add(full);
}
})).catch(() => {
})
);
}
yield Promise.allSettled(trdekhoPromises);
}
const streams = [];
const extractPromises = [];
for (const iframeUrl of iframeUrls) {
if (iframeUrl.includes("rubystm.com") || iframeUrl.includes("streamruby")) {
extractPromises.push(
extractStreamRuby(iframeUrl).then((s) => {
if (s)
streams.push(s);
})
);
} else if (iframeUrl.includes("vidmoly")) {
extractPromises.push(
extractVidmoly(iframeUrl).then((s) => {
if (s)
streams.push(s);
})
);
} else if (iframeUrl.includes("abyssplayer.com") || iframeUrl.includes("short.icu")) {
extractPromises.push(
extractAbyss(iframeUrl, "Default").then((res) => {
if (Array.isArray(res))
streams.push(...res);
})
);
} else if (iframeUrl.includes("as-cdn") || iframeUrl.includes("awstream") || iframeUrl.includes("zephyrflick")) {
extractPromises.push(
extractAwsStream(iframeUrl).then((s) => {
if (s)
streams.push(s);
})
);
} else if (iframeUrl.includes("filesforever.link") || iframeUrl.includes("cdnwish") || iframeUrl.includes("multimovies") || iframeUrl.includes("streamwish")) {
extractPromises.push(
extractStreamWish(iframeUrl).then((s) => {
if (s)
streams.push(s);
})
);
} else if (iframeUrl.includes("blakiteapi.xyz")) {
extractPromises.push(
extractBlakite(iframeUrl).then((s) => {
if (s)
streams.push(s);
})
);
} else if (iframeUrl.includes("cloudy.upns.one") || iframeUrl.includes("vidcloud.upns.ink")) {
extractPromises.push(
extractVidStack(iframeUrl).then((s) => {
if (s)
streams.push(s);
})
);
}
}
yield Promise.allSettled(extractPromises);
const seenUrls = /* @__PURE__ */ new Set();
const candidateStreams = [];
for (const s of streams) {
if (s && s.url && !seenUrls.has(s.url) && isRealStreamUrl(s.url)) {
seenUrls.add(s.url);
candidateStreams.push({
name: s.name || "AnimeDekho",
title: mediaType === "movie" ? details.title : `${details.title} - S${seasonNum}E${episodeNum}`,
url: s.url,
quality: s.quality || "Auto",
headers: s.headers,
subtitles: s.subtitles || [],
provider: "animedekho",
type: s.type || "m3u8"
});
}
}
const probeResults = yield Promise.all(
candidateStreams.map((s) => __async(this, null, function* () {
return { stream: s, playable: yield isPlayableStream(s) };
}))
);
let finalStreams = probeResults.filter((r) => r.playable).map((r) => r.stream);
if (finalStreams.length === 0)
finalStreams = candidateStreams;
const qualityOrder = { "1080p": 4, "720p": 3, "480p": 2, "360p": 1, "Auto": 0 };
return finalStreams.sort((a, b) => {
var _a, _b;
return ((_a = qualityOrder[b.quality]) != null ? _a : 0) - ((_b = qualityOrder[a.quality]) != null ? _b : 0);
});
} catch (e) {
return [];
}
});
}
module.exports = { getStreams };
+593 -1
View File
@@ -1 +1,593 @@
const _0x1d73f4=_0x3e95;(function(_0x59e55d,_0x1dbedb){const _0x18c825=_0x3e95,_0x510f3b=_0x59e55d();while(!![]){try{const _0x3d1169=parseInt(_0x18c825(0x1be))/0x1+parseInt(_0x18c825(0x1ba))/0x2*(parseInt(_0x18c825(0x1e5))/0x3)+-parseInt(_0x18c825(0x202))/0x4*(-parseInt(_0x18c825(0x1ec))/0x5)+-parseInt(_0x18c825(0x1f7))/0x6*(-parseInt(_0x18c825(0x1cb))/0x7)+parseInt(_0x18c825(0x1b7))/0x8+parseInt(_0x18c825(0x1d8))/0x9*(-parseInt(_0x18c825(0x1d1))/0xa)+parseInt(_0x18c825(0x213))/0xb*(-parseInt(_0x18c825(0x1f8))/0xc);if(_0x3d1169===_0x1dbedb)break;else _0x510f3b['push'](_0x510f3b['shift']());}catch(_0x15a0de){_0x510f3b['push'](_0x510f3b['shift']());}}}(_0x131e,0x6e357));var __create=Object[_0x1d73f4(0x1d3)],__defProp=Object[_0x1d73f4(0x1d6)],__defProps=Object[_0x1d73f4(0x1a9)],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__getOwnPropDescs=Object[_0x1d73f4(0x20e)],__getOwnPropNames=Object[_0x1d73f4(0x1fd)],__getOwnPropSymbols=Object[_0x1d73f4(0x1f2)],__getProtoOf=Object[_0x1d73f4(0x1ed)],__hasOwnProp=Object[_0x1d73f4(0x1dd)]['hasOwnProperty'],__propIsEnum=Object['prototype']['propertyIsEnumerable'],__defNormalProp=(_0x537b5d,_0x312257,_0x145bab)=>_0x312257 in _0x537b5d?__defProp(_0x537b5d,_0x312257,{'enumerable':!![],'configurable':!![],'writable':!![],'value':_0x145bab}):_0x537b5d[_0x312257]=_0x145bab,__spreadValues=(_0x454d4c,_0x10c821)=>{const _0x1d55b3=_0x1d73f4;for(var _0x5ca226 in _0x10c821||(_0x10c821={}))if(__hasOwnProp[_0x1d55b3(0x214)](_0x10c821,_0x5ca226))__defNormalProp(_0x454d4c,_0x5ca226,_0x10c821[_0x5ca226]);if(__getOwnPropSymbols)for(var _0x5ca226 of __getOwnPropSymbols(_0x10c821)){if(__propIsEnum['call'](_0x10c821,_0x5ca226))__defNormalProp(_0x454d4c,_0x5ca226,_0x10c821[_0x5ca226]);}return _0x454d4c;},__spreadProps=(_0x3a8cb0,_0x2a9c46)=>__defProps(_0x3a8cb0,__getOwnPropDescs(_0x2a9c46)),__objRest=(_0x267409,_0x2a986e)=>{const _0x1f55b1=_0x1d73f4;var _0x4078ae={};for(var _0x37e51c in _0x267409)if(__hasOwnProp[_0x1f55b1(0x214)](_0x267409,_0x37e51c)&&_0x2a986e[_0x1f55b1(0x1ea)](_0x37e51c)<0x0)_0x4078ae[_0x37e51c]=_0x267409[_0x37e51c];if(_0x267409!=null&&__getOwnPropSymbols)for(var _0x37e51c of __getOwnPropSymbols(_0x267409)){if(_0x2a986e[_0x1f55b1(0x1ea)](_0x37e51c)<0x0&&__propIsEnum[_0x1f55b1(0x214)](_0x267409,_0x37e51c))_0x4078ae[_0x37e51c]=_0x267409[_0x37e51c];}return _0x4078ae;},__copyProps=(_0x257f25,_0x2649d8,_0xdbf521,_0x41706a)=>{const _0x4bd517=_0x1d73f4;if(_0x2649d8&&typeof _0x2649d8===_0x4bd517(0x212)||typeof _0x2649d8===_0x4bd517(0x1cf)){for(let _0x5e4956 of __getOwnPropNames(_0x2649d8))if(!__hasOwnProp[_0x4bd517(0x214)](_0x257f25,_0x5e4956)&&_0x5e4956!==_0xdbf521)__defProp(_0x257f25,_0x5e4956,{'get':()=>_0x2649d8[_0x5e4956],'enumerable':!(_0x41706a=__getOwnPropDesc(_0x2649d8,_0x5e4956))||_0x41706a[_0x4bd517(0x1c6)]});}return _0x257f25;},__toESM=(_0x55ba45,_0x23f426,_0x31a83c)=>(_0x31a83c=_0x55ba45!=null?__create(__getProtoOf(_0x55ba45)):{},__copyProps(_0x23f426||!_0x55ba45||!_0x55ba45['__esModule']?__defProp(_0x31a83c,_0x1d73f4(0x1b4),{'value':_0x55ba45,'enumerable':!![]}):_0x31a83c,_0x55ba45)),__async=(_0x1abd7c,_0x51d469,_0x4db3b0)=>{return new Promise((_0x1cb0f7,_0x58ba9a)=>{const _0x5006dd=_0x3e95;var _0x16f488=_0x2becae=>{const _0x4f80c0=_0x3e95;try{_0x3ddc4b(_0x4db3b0[_0x4f80c0(0x1b0)](_0x2becae));}catch(_0x4fff13){_0x58ba9a(_0x4fff13);}},_0x446bda=_0x2a96d8=>{try{_0x3ddc4b(_0x4db3b0['throw'](_0x2a96d8));}catch(_0x4ee400){_0x58ba9a(_0x4ee400);}},_0x3ddc4b=_0x28cd85=>_0x28cd85['done']?_0x1cb0f7(_0x28cd85[_0x5006dd(0x1ae)]):Promise[_0x5006dd(0x1ca)](_0x28cd85[_0x5006dd(0x1ae)])[_0x5006dd(0x1f6)](_0x16f488,_0x446bda);_0x3ddc4b((_0x4db3b0=_0x4db3b0[_0x5006dd(0x1fb)](_0x1abd7c,_0x51d469))[_0x5006dd(0x1b0)]());});},import_cheerio_without_node_native=__toESM(require(_0x1d73f4(0x1ff))),MAIN_URL=_0x1d73f4(0x207),PROXY_URL=_0x1d73f4(0x1c1),HEADERS={'User-Agent':'Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20Chrome/120.0.0.0\x20Safari/537.36','Cookie':_0x1d73f4(0x201),'Referer':_0x1d73f4(0x1e1)};function fetchText(_0x53d5e8){return __async(this,arguments,function*(_0x3a9d6b,_0x3f7815={}){const _0x22182a=_0x3e95,_0x263547=_0x3f7815,{useProxy:useProxy=!![]}=_0x263547,_0x5368ce=__objRest(_0x263547,[_0x22182a(0x20a)]),_0x3553fa=_0x3a9d6b[_0x22182a(0x1e3)](_0x22182a(0x1cd))?_0x3a9d6b:''+MAIN_URL+_0x3a9d6b,_0x23e259=useProxy?''+PROXY_URL+encodeURIComponent(_0x3553fa):_0x3553fa,_0x53e991=yield fetch(_0x23e259,__spreadValues({'headers':HEADERS},_0x5368ce));if(!_0x53e991['ok'])throw new Error('HTTP\x20'+_0x53e991[_0x22182a(0x1fc)]+_0x22182a(0x1c5)+_0x3553fa);return yield _0x53e991[_0x22182a(0x210)]();});}function fetchJson(_0xbe08be){return __async(this,arguments,function*(_0x290be1,_0x1fec65={}){const _0x6a80f1=_0x3e95,_0x562e16=yield fetchText(_0x290be1,_0x1fec65);return JSON[_0x6a80f1(0x1bd)](_0x562e16);});}function getImdbId(_0x34ed2f,_0x226466){return __async(this,null,function*(){const _0x404dbd=_0x3e95;try{const _0x42212d=_0x404dbd(0x1e6)+(_0x226466==='tv'?'tv':'movieLine truncated
/**
* animepahe - Built from src/animepahe/
* Generated: 2026-09-22T10:30:55.503Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/animepahe/index.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
// src/animepahe/constants.js
var ANIMEPAHE_DOMAINS = [
"https://animepahe.pw",
"https://animepahe.com",
"https://animepahe.org"
];
var MAIN_URL = "https://animepahe.pw";
var TMDB_API_KEY = "439c478a771f35c05022f9feabcca01c";
var USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36";
var HEADERS = {
"User-Agent": USER_AGENT,
"Accept": "application/json, text/plain, */*",
"Referer": `${MAIN_URL}/`
};
// src/animepahe/utils.js
var activeDomain = MAIN_URL;
function fetchText(_0) {
return __async(this, arguments, function* (url, options = {}) {
const isAbsolute = url.startsWith("http");
const urlsToTry = isAbsolute ? [url] : ANIMEPAHE_DOMAINS.map((d) => `${d}${url.startsWith("/") ? "" : "/"}${url}`);
let lastError = null;
for (const tryUrl of urlsToTry) {
try {
const isPaheUrl = tryUrl.includes("animepahe.");
const mergedHeaders = __spreadValues(__spreadProps(__spreadValues({}, HEADERS), {
"Referer": `${activeDomain}/`
}), options.headers || {});
let response = yield fetch(tryUrl, __spreadValues({
headers: mergedHeaders,
cfKiller: isPaheUrl,
skipSizeCheck: true
}, options));
if ((response.status === 403 || response.status === 503) && typeof Cloudflare !== "undefined" && Cloudflare.solve) {
try {
const solvedHeaders = yield Cloudflare.solve(tryUrl);
if (solvedHeaders["Cookie"])
mergedHeaders["Cookie"] = solvedHeaders["Cookie"];
if (solvedHeaders["User-Agent"])
mergedHeaders["User-Agent"] = solvedHeaders["User-Agent"];
response = yield fetch(tryUrl, __spreadValues({
headers: mergedHeaders,
skipSizeCheck: true
}, options));
} catch (_) {
}
}
if (response.ok) {
if (!isAbsolute) {
const match = tryUrl.match(/^(https?:\/\/[^\/]+)/);
if (match)
activeDomain = match[1];
}
return yield response.text();
}
lastError = new Error(`HTTP ${response.status} on ${tryUrl}`);
} catch (e) {
lastError = e;
}
}
throw lastError || new Error(`Failed to fetch: ${url}`);
});
}
function fetchJson(_0) {
return __async(this, arguments, function* (url, options = {}) {
const text = yield fetchText(url, options);
return JSON.parse(text);
});
}
function getImdbId(tmdbId, mediaType) {
return __async(this, null, function* () {
try {
const url = `https://api.themoviedb.org/3/${mediaType === "tv" ? "tv" : "movie"}/${tmdbId}/external_ids?api_key=${TMDB_API_KEY}`;
const res = yield fetch(url);
const data = yield res.json();
return data.imdb_id;
} catch (_) {
return null;
}
});
}
function resolveMapping(imdbId, season, episode) {
return __async(this, null, function* () {
try {
const url = `https://id-mapping-api-malid.hf.space/api/resolve?id=${imdbId}&s=${season}&e=${episode}`;
const res = yield fetch(url);
if (!res.ok)
return null;
return yield res.json();
} catch (_) {
return null;
}
});
}
function getMalTitle(malId) {
return __async(this, null, function* () {
var _a, _b;
try {
const res = yield fetch(`https://api.jikan.moe/v4/anime/${malId}`);
if (!res.ok)
return null;
const data = yield res.json();
return ((_a = data.data) == null ? void 0 : _a.title) || ((_b = data.data) == null ? void 0 : _b.title_english);
} catch (_) {
return null;
}
});
}
function searchAnime(query, page = 1) {
return __async(this, null, function* () {
const timeSuffix = Math.floor(Date.now() / 1e3) + page * 3;
const url = `/api?m=search&q=${encodeURIComponent(query + " " + timeSuffix)}&page=${page}`;
return yield fetchJson(url);
});
}
function extractQuality(text) {
const match = text.match(/(\d{3,4}p)/);
return match ? match[1] : "720p";
}
// src/animepahe/extractors.js
function unpack(code) {
try {
const match = code.match(/}\((['"])([\s\S]*?)\1,\s*(\d+),\s*(\d+),\s*(['"])([\s\S]*?)\5\.split\((['"])\|\7\)/);
if (match) {
let [_, quote1, p, a, c, quote2, kStr] = match;
p = p.replace(/\\'/g, "'").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
a = parseInt(a, 10);
c = parseInt(c, 10);
const k = kStr.split("|");
const e = (c2) => (c2 < a ? "" : e(parseInt(c2 / a, 10))) + ((c2 = c2 % a) > 35 ? String.fromCharCode(c2 + 29) : c2.toString(36));
const d = {};
while (c--)
d[e(c)] = k[c] || e(c);
return p.replace(/\b\w+\b/g, (w) => d[w] !== void 0 ? d[w] : w);
}
} catch (_) {
}
return code;
}
function extractKwik(url) {
return __async(this, null, function* () {
try {
const res = yield fetch(url, {
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Referer": `${MAIN_URL}/`,
"User-Agent": USER_AGENT
}),
cfKiller: true,
skipSizeCheck: true
});
const finalUrl = res.url || url;
const html = yield res.text();
const scripts = html.match(/<script.*?>([\s\S]*?)<\/script>/g) || [];
const matches = [];
for (const script of scripts) {
if (script.includes("eval(function(p,a,c,k,e,d)")) {
let pos = 0;
while (true) {
const start = script.indexOf("eval(function(p,a,c,k,e,d)", pos);
if (start === -1)
break;
const end = script.indexOf(".split('|')", start);
if (end === -1)
break;
const closeParen = script.indexOf("))", end);
if (closeParen === -1)
break;
matches.push(script.substring(start, closeParen + 2));
pos = closeParen + 2;
}
}
}
for (const scriptContent of matches) {
const unpacked = unpack(scriptContent);
const srcMatch = unpacked.match(/(?:const\s+)?source\s*=\s*\\?['"]([^\\'"]+)\\?['"]/);
if (srcMatch) {
const streamUrl = srcMatch[1];
const titleMatch = html.match(/<title>([\s\S]*?)<\/title>/);
const title = titleMatch ? titleMatch[1].trim() : "video";
const fileName = title.endsWith(".mp4") ? title : `${title}.mp4`;
let mp4Url = null;
if (streamUrl.includes("/stream/")) {
const urlParts = streamUrl.replace("/stream/", "/mp4/").split("/");
urlParts.pop();
const mp4Base = urlParts.join("/");
mp4Url = `${mp4Base}?file=${encodeURIComponent(fileName)}`;
}
return {
m3u8: streamUrl,
mp4: mp4Url,
headers: {
"Referer": finalUrl,
"Origin": "https://kwik.cx",
"User-Agent": USER_AGENT
}
};
}
}
} catch (_) {
}
return null;
});
}
function paheDecrypt(fullString, key, v1, v2) {
const keyIndexMap = {};
for (let i2 = 0; i2 < key.length; i2++)
keyIndexMap[key[i2]] = i2;
let result = "";
let i = 0;
const toFind = key[v2];
while (i < fullString.length) {
const nextIndex = fullString.indexOf(toFind, i);
if (nextIndex === -1)
break;
let decodedCharStr = "";
for (let j = i; j < nextIndex; j++) {
decodedCharStr += keyIndexMap[fullString[j]];
}
i = nextIndex + 1;
const decodedChar = String.fromCharCode(parseInt(decodedCharStr, v2) - v1);
result += decodedChar;
}
return result;
}
function extractPahe(url) {
return __async(this, null, function* () {
try {
const initUrl = url.endsWith("/i") ? url : `${url}/i`;
const initRes = yield fetch(initUrl, {
method: "GET",
redirect: "manual",
headers: {
"User-Agent": USER_AGENT,
"Referer": "https://pahe.win/"
},
cfKiller: true,
skipSizeCheck: true
});
const redirectLoc = initRes.headers.get("location") || initRes.headers.get("Location");
if (!redirectLoc)
return null;
let kwikUrl = redirectLoc;
if (kwikUrl.includes("https://")) {
kwikUrl = "https://" + kwikUrl.split("https://").pop();
} else if (kwikUrl.includes("http://")) {
kwikUrl = "http://" + kwikUrl.split("http://").pop();
} else {
kwikUrl = `https://${kwikUrl.replace(/^\/+/, "")}`;
}
const kwikRes = yield fetch(kwikUrl, {
method: "GET",
headers: {
"User-Agent": USER_AGENT,
"Referer": "https://kwik.cx/",
"Origin": "https://kwik.cx"
},
cfKiller: true,
skipSizeCheck: true
});
const html = yield kwikRes.text();
let cookie = "";
if (typeof kwikRes.headers.getSetCookie === "function") {
cookie = kwikRes.headers.getSetCookie().map((c) => c.split(";")[0]).join("; ");
}
if (!cookie) {
const setCookieHeader = kwikRes.headers.get("set-cookie") || kwikRes.headers.get("Set-Cookie");
if (setCookieHeader) {
cookie = setCookieHeader.split(";")[0];
}
}
const kwikParamsRegex = /\("(\w+)",\d+,"(\w+)",(\d+),(\d+),\d+\)/;
const match = html.match(kwikParamsRegex);
if (!match)
return null;
const [_, fullString, key, v1, v2] = match;
const decrypted = paheDecrypt(fullString, key, parseInt(v1, 10), parseInt(v2, 10));
const actionMatch = decrypted.match(/action="([^"]+)"/);
const tokenMatch = decrypted.match(/value="([^"]+)"/);
if (!actionMatch || !tokenMatch)
return null;
const postUri = actionMatch[1];
const token = tokenMatch[1];
const formData = new URLSearchParams();
formData.append("_token", token);
let tries = 0;
let location = null;
while (tries < 3) {
tries++;
const postRes = yield fetch(postUri, {
method: "POST",
redirect: "manual",
headers: __spreadProps(__spreadValues({
"User-Agent": USER_AGENT,
"Referer": kwikUrl,
"Origin": "https://kwik.cx"
}, cookie ? { "Cookie": cookie } : {}), {
"Content-Type": "application/x-www-form-urlencoded"
}),
body: formData.toString(),
cfKiller: true,
skipSizeCheck: true
});
if (postRes.status === 302 || postRes.status === 301) {
location = postRes.headers.get("location") || postRes.headers.get("Location");
break;
}
}
if (location) {
return {
url: location,
headers: {
"Referer": "https://kwik.cx/",
"Origin": "https://kwik.cx",
"User-Agent": USER_AGENT
}
};
}
} catch (_) {
}
return null;
});
}
// src/animepahe/index.js
function getStreams(tmdbId, mediaType, season, episode) {
return __async(this, null, function* () {
try {
let animeSession = null;
let animeTitle = "";
let mappedEp = episode;
let targetMalId = null;
if (mediaType === "tv") {
const imdbId = yield getImdbId(tmdbId, mediaType);
if (!imdbId)
return [];
const mapping = yield resolveMapping(imdbId, season, episode);
if (!mapping || !mapping.mal_id)
return [];
targetMalId = mapping.mal_id;
mappedEp = mapping.mal_episode || episode;
animeTitle = yield getMalTitle(targetMalId);
if (!animeTitle)
return [];
let searchResults = yield searchAnime(animeTitle);
if (!searchResults.data || searchResults.data.length === 0) {
const clean = animeTitle.replace(/[^a-zA-Z0-9\s]+/g, " ").replace(/\s+/g, " ").trim();
if (clean !== animeTitle) {
searchResults = yield searchAnime(clean);
}
}
if (!searchResults.data || searchResults.data.length === 0) {
const words = animeTitle.split(/\s+/).filter(Boolean);
if (words.length > 3) {
const shortQuery = words.slice(-3).join(" ");
searchResults = yield searchAnime(shortQuery);
}
}
if (searchResults.data && searchResults.data.length > 0) {
for (let i = 0; i < Math.min(searchResults.data.length, 5); i++) {
const item = searchResults.data[i];
try {
const pageHtml = yield fetchText(`/anime/${item.session}`);
if (pageHtml.includes(`myanimelist.net/anime/${targetMalId}`) || item.id && String(item.id) === String(targetMalId)) {
animeSession = item.session;
break;
}
} catch (_) {
}
}
if (!animeSession) {
const normTarget = animeTitle.toLowerCase().replace(/[^a-z0-9]+/g, "");
const titleMatch = searchResults.data.find((r) => {
const normR = (r.title || "").toLowerCase().replace(/[^a-z0-9]+/g, "");
return normR.includes(normTarget) || normTarget.includes(normR);
});
animeSession = titleMatch ? titleMatch.session : searchResults.data[0].session;
}
}
} else {
const tmdbUrl = `https://api.themoviedb.org/3/movie/${tmdbId}?api_key=439c478a771f35c05022f9feabcca01c`;
const tmdbRes = yield fetch(tmdbUrl);
const tmdbData = yield tmdbRes.json();
animeTitle = tmdbData.title || tmdbData.original_title;
mappedEp = 1;
if (!animeTitle)
return [];
let searchResults = yield searchAnime(animeTitle);
if (!searchResults.data || searchResults.data.length === 0) {
const clean = animeTitle.replace(/[^a-zA-Z0-9\s]+/g, " ").replace(/\s+/g, " ").trim();
if (clean !== animeTitle) {
searchResults = yield searchAnime(clean);
}
}
if (searchResults.data && searchResults.data.length > 0) {
const normTarget = animeTitle.toLowerCase().replace(/[^a-z0-9]+/g, "");
const match = searchResults.data.find((r) => {
const normR = (r.title || "").toLowerCase().replace(/[^a-z0-9]+/g, "");
return normR === normTarget || normR.includes(normTarget) || normTarget.includes(normR);
}) || searchResults.data[0];
animeSession = match.session;
}
}
if (!animeSession)
return [];
const firstPageUrl = `/api?m=release&id=${animeSession}&sort=episode_asc&page=1`;
const firstPageData = yield fetchJson(firstPageUrl);
if (!firstPageData.data || firstPageData.data.length === 0)
return [];
const targetEpNum = Number(mappedEp);
let episodeSession = null;
const epInFirstPage = firstPageData.data.find((e) => Math.floor(Number(e.episode)) === targetEpNum || Number(e.episode) === targetEpNum);
if (epInFirstPage) {
episodeSession = epInFirstPage.session;
} else {
const perPage = firstPageData.per_page || 30;
const targetPage = Math.ceil(targetEpNum / perPage) || 1;
const lastPage = firstPageData.last_page || 1;
if (targetPage !== 1 && targetPage <= lastPage) {
const targetPageUrl = `/api?m=release&id=${animeSession}&sort=episode_asc&page=${targetPage}`;
const targetPageData = yield fetchJson(targetPageUrl);
if (targetPageData && targetPageData.data) {
const foundEp = targetPageData.data.find((e) => Math.floor(Number(e.episode)) === targetEpNum || Number(e.episode) === targetEpNum);
if (foundEp)
episodeSession = foundEp.session;
}
}
if (!episodeSession) {
for (let p = 2; p <= Math.min(lastPage, 6); p++) {
if (p === targetPage)
continue;
const pData = yield fetchJson(`/api?m=release&id=${animeSession}&sort=episode_asc&page=${p}`);
if (pData && pData.data) {
const foundEp = pData.data.find((e) => Math.floor(Number(e.episode)) === targetEpNum || Number(e.episode) === targetEpNum);
if (foundEp) {
episodeSession = foundEp.session;
break;
}
}
}
}
}
if (!episodeSession)
return [];
const playUrl = `/play/${animeSession}/${episodeSession}`;
const playHtml = yield fetchText(playUrl);
const $ = import_cheerio_without_node_native.default.load(playHtml);
const streams = [];
const promises = [];
const seen = /* @__PURE__ */ new Set();
const downloadLinks = $("div#pickDownload > a");
const buttons = $("#resolutionMenu > button");
buttons.each((index, el) => {
const $btn = $(el);
const kwikUrl = $btn.attr("data-src");
const fullText = $btn.text().trim();
const qualityText = fullText.includes(" \xB7 ") ? fullText.substring(fullText.indexOf(" \xB7 ") + 3) : fullText;
const isDub = qualityText.toLowerCase().includes("eng");
const isKor = qualityText.toLowerCase().includes("kor");
const isChi = qualityText.toLowerCase().includes("chi");
const langLabel = isDub ? "DUB" : isKor ? "KOR" : isChi ? "CHI" : "SUB";
const cleanQualityText = qualityText.replace(/eng/gi, "").replace(/kor/gi, "").replace(/chi/gi, "").replace(/\s+/g, " ").trim();
const quality = extractQuality(cleanQualityText);
const paheWinLink = downloadLinks.eq(index).attr("href");
if (kwikUrl && kwikUrl.includes("kwik")) {
promises.push(
extractKwik(kwikUrl).then((res) => {
if (res && res.m3u8 && !seen.has(res.m3u8)) {
seen.add(res.m3u8);
streams.push({
name: `AnimePahe [${langLabel}] (${quality} HLS)`,
title: mediaType === "movie" ? `${animeTitle} (${langLabel})` : `${animeTitle} - Episode ${mappedEp} (${langLabel})`,
url: res.m3u8,
quality,
headers: res.headers,
provider: "animepahe",
type: "m3u8"
});
}
if (res && res.mp4 && !seen.has(res.mp4)) {
seen.add(res.mp4);
streams.push({
name: `AnimePahe [${langLabel}] (${quality} MP4)`,
title: mediaType === "movie" ? `${animeTitle} (${langLabel})` : `${animeTitle} - Episode ${mappedEp} (${langLabel})`,
url: res.mp4,
quality,
headers: __spreadProps(__spreadValues({}, res.headers), {
"Referer": kwikUrl
}),
provider: "animepahe",
type: "mp4"
});
}
}).catch(() => {
})
);
}
if (paheWinLink && (paheWinLink.includes("pahe.win") || paheWinLink.includes("pahe.me") || paheWinLink.includes("pahe.li") || paheWinLink.includes("kwik"))) {
promises.push(
extractPahe(paheWinLink).then((res) => {
if (res && res.url && !seen.has(res.url)) {
seen.add(res.url);
streams.push({
name: `AnimePahe [${langLabel}] (${quality} Direct)`,
title: mediaType === "movie" ? `${animeTitle} (${langLabel})` : `${animeTitle} - Episode ${mappedEp} (${langLabel})`,
url: res.url,
quality,
headers: res.headers,
provider: "animepahe",
type: "mp4"
});
}
}).catch(() => {
})
);
}
});
yield Promise.all(promises);
const qualityOrder = { "1080p": 3, "720p": 2, "360p": 1 };
return streams.sort((a, b) => (qualityOrder[b.quality] || 0) - (qualityOrder[a.quality] || 0));
} catch (_) {
return [];
}
});
}
module.exports = { getStreams };
+625 -1
View File
@@ -1 +1,625 @@
var _0x557dba=_0x11a3;(function(_0x4c1790,_0x5872e1){var _0x197a18={_0x4f7961:0x20d,_0x21c64b:0x20c,_0x5a8745:0x21a},_0x1cfb1f=_0x11a3,_0x18776a=_0x4c1790();while(!![]){try{var _0x1aacd2=-parseInt(_0x1cfb1f(_0x197a18._0x4f7961))/0x1+parseInt(_0x1cfb1f(_0x197a18._0x21c64b))/0x2+-parseInt(_0x1cfb1f(0x200))/0x3+parseInt(_0x1cfb1f(0x225))/0x4*(parseInt(_0x1cfb1f(_0x197a18._0x5a8745))/0x5)+-parseInt(_0x1cfb1f(0x1f5))/0x6+-parseInt(_0x1cfb1f(0x221))/0x7*(-parseInt(_0x1cfb1f(0x216))/0x8)+parseInt(_0x1cfb1f(0x219))/0x9;if(_0x1aacd2===_0x5872e1)break;else _0x18776a['push'](_0x18776a['shift']());}catch(_0x4b34ca){_0x18776a['push'](_0x18776a['shift']());}}}(_0xa7e9,0x8c273));var TMDB_KEY=_0x557dba(0x21e),BASE='https://animesalt.link',CDN=_0x557dba(0x214),UA=_0x557dba(0x226);function getInvertedSortTag(_0xe5663d,_0x1e3e19){var _0x3c7972={_0x1c36ad:0x202,_0xc87f6a:0x210},_0x51811b=_0x557dba;if(!_0x1e3e19)_0x1e3e19=0xf423f;var _0x39e711=Math['max'](0x0,parseInt(_0xe5663d,0xa)||0x0),_0x217f5a=Math[_0x51811b(_0x3c7972._0x1c36ad)](0x0,_0x1e3e19-_0x39e711),_0x5c2b65=_0x217f5a[_0x51811b(0x1f3)](0x2);while(_0x5c2b65['length']<0x14){_0x5c2b65='0'+_0x5c2b65;}return _0x5c2b65[_0x51811b(_0x3c7972._0xc87f6a)]('')['map'](function(_0x1f86b8){return _0x1f86b8==='1'?'\ufeff':'​';})['join']('');}function getResolutionEmoji(_0x4a47bf){var _0x3387d9={_0x2ca470:0x208,_0x446cad:0x1f7,_0x5e41db:0x21c,_0x3067c5:0x208,_0x28b51a:0x21f,_0x1613bf:0x231},_0x5db03d=_0x557dba,_0x32a132=String(_0x4a47bf||'')['toLowerCase']();if(_0x32a132[_0x5db03d(_0x3387d9._0x2ca470)](_0x5db03d(0x20e))||_0x32a132['includes']('4k')||_0x32a132[_0x5db03d(_0x3387d9._0x2ca470)]('uhd'))return _0x5db03d(0x22a);if(_0x32a132[_0x5db03d(0x208)](_0x5db03d(0x232))||_0x32a132['includes'](_0x5db03d(0x22f)))return _0x5db03d(_0x3387d9._0x446cad);if(_0x32a132['includes'](_0x5db03d(_0x3387d9._0x5e41db))||_0x32a132[_0x5db03d(_0x3387d9._0x3067c5)]('hd'))return'💎\x20720p';if(_0x32a132['includes'](_0x5db03d(_0x3387d9._0x28b51a))||_0x32a132[_0x5db03d(0x208)]('sd'))return _0x5db03d(_0x3387d9._0x1613bf);return'📺\x20'+(_0x4a47bf||'1080p');}function qualityRank(_0x41fc5e){var _0x4aeea4=_0x557dba;if(/2160p|4k/i['test'](_0x41fc5e))return 0x4;if(/1080p/i[_0x4aeea4(0x21d)](_0x41fc5e))return 0x3;if(/720p/i['test'](_0x41fc5e))return 0x2;if(/480p/i['test'](_0x41fc5e))return 0x1;return 0x0;}function httpGet(_0x420b31,_0x57deb1){var _0xb8e8ef={_0xd72923:0x20b},_0x28356a=_0x557dba;return fetch(_0x420b31,{'headers':Object['assign']({'User-Agent':UA},_0x57deb1||{})})[_0x28356a(_0xb8e8ef._0xd72923)](function(_0x534919){var _0x513635=_0x28356a;if(!_0x534919['ok'])throw new Error('HTTP\x20'+_0x534919[_0x513635(0x1f6)]);return _0x534919[_0x513635(0x1fb)]();});}function _0x11a3(_0x479722,_0x33ee57){_0x479722=_0x479722-0x1ef;var _0xa7e9a4=_0xa7e9();var _0x11a3f4=_0xa7e9a4[_0x479722];if(_0x11a3['ZGiWMW']===undefined){var _0x3ca26c=function(_0x1db348){var _0x16b95f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xe5663d='',_0x1e3e19='';for(var _0x39e711=0x0,_0x217f5a,_0x5c2b65,_0x1f86b8=0x0;_0x5c2b65=_0x1db348['charAt'](_0x1f86b8++);~_0x5c2b65&&(_0x217f5a=_0x39e711%0x4?_0x217f5a*0x40+_0x5c2b65:_0x5c2b65,_0x39e711++%0x4)?_0xe5663d+=String['fromCharCode'](0xff&_0x217f5a>>(-0x2*_0x39e711&0x6)):0x0){_0x5c2b65=_0x16b95f['indexOf'](_0x5c2b65);}for(var _0x4a47bf=0x0,_0x32a132=_0xe5663d['length'];_0x4a47bf<_0x32a132;_0x4a47bf++){_0x1e3e19+='%'+('00'+_0xe5663d['charCodeAt'](_0x4a47bf)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1e3e19);};_0x11a3['QUsIIC']=_0x3ca26c,_0x11a3['hkNbvk']={},_0x11a3['ZGiWMW']=!![];}var _0x22daf0=_0xa7e9a4[0x0],_0x3b9c80=_0x479722+_0x22daf0,_0x1e71b2=_0x11a3['hkNbvk'][_0x3b9c80];return!_0x1e71b2?(_0x11a3f4=_0x11a3['QUsIIC'](_0x11a3f4),_0x11a3['hkNbvk'][_0x3b9c80]=_0x11a3f4):_0x11a3f4=_0x1e71b2,_0x11a3f4;}function httpPost(_0x30217a,_0x2a874f,_0x5d2c7b){var _0x4ba3ab={_0x8622c8:0x20b},_0x8b1ada=_0x557dba;return fetch(_0x30217a,{'method':'POST','headers':Object['assign']({'User-Agent':UA,'Content-Type':'application/x-www-form-urlencoded'},_0x5d2c7b||{}),'body':_0x2a874f})[_0x8b1ada(_0x4ba3ab._0x8622c8)](function(_0x248002){var _0x5d3ded=_0x8b1ada;if(!_0x248002['ok'])throw new Error('HTTP\x20'+_0x248002[_0x5d3ded(0x1f6)]);return _0x248002['json']();});}function cleanTitle(_0x5b441f){return _0x5b441f['toLowerCase']()['replace'](/[^a-z0-9\s]/g,'')['replace'](/\s+/g,'\x20')['trim']();}function searchSite(_0x2a21aa,_0x31db93,_0x3faa33){var _0x4a25ab={_0x6d2555:0x203,_0x504a4d:0x227,_0x570a08:0x1f0,_0x2a521d:0x20f,_0x5715b1:0x1fd,_0x4afc3c:0x211,_0x417df0:0x228,_0x106144:0x1f0},_0xb8ef2e={_0x153a14:0x22b},_0x438d59={_0x2459ae:0x1f9},_0x461a90=BASE+'/?s='+encodeURIComponent(_0x2a21aa);return httpGet(_0x461a90,{'Referer':BASE+'/'})['then'](function(_0x41a043){var _0x50788c=_0x11a3,_0x5bcabd=[],_0x32361a=_0x41a043[_0x50788c(_0x4a25ab._0x6d2555)](/id="movies-a"([\s\S]*?)(?=<footer|id="footer|class="footer)/m),_0xb286f3=_0x32361a?_0x32361a[0x1]:_0x41a043Line truncated
/**
* animesalt - Built from src/animesalt/
* Generated: 2026-09-22T20:41:44.444Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/animesalt/index.js
var import_cheerio_without_node_native2 = __toESM(require("cheerio-without-node-native"));
// src/animesalt/constants.js
var MAIN_URL = "https://animesalt.cx";
var TMDB_API_KEY = "1865f43a0549ca50d341dd9ab8b29f49";
var TMDB_BASE_URL = "https://api.themoviedb.org/3";
var 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";
var HEADERS = {
"User-Agent": USER_AGENT,
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5"
};
// src/animesalt/utils.js
function fetchTmdbDetails(tmdbId, mediaType) {
return __async(this, null, function* () {
var _a;
const endpoint = mediaType === "movie" ? "movie" : "tv";
const url = `${TMDB_BASE_URL}/${endpoint}/${tmdbId}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
try {
const res = yield fetch(url, { headers: HEADERS });
if (!res.ok)
return null;
const data = yield res.json();
return {
title: mediaType === "movie" ? data.title || data.original_title : data.name || data.original_name,
year: parseInt((data.release_date || data.first_air_date || "").substring(0, 4)) || null,
imdbId: ((_a = data.external_ids) == null ? void 0 : _a.imdb_id) || null
};
} catch (e) {
return null;
}
});
}
function cleanTitle(str) {
return (str || "").toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, " ").trim();
}
function titleSimilarity(a, b) {
const cleanA = cleanTitle(a);
const cleanB = cleanTitle(b);
if (!cleanA || !cleanB)
return 0;
if (cleanA === cleanB)
return 1;
if (cleanA.includes(cleanB) || cleanB.includes(cleanA))
return 0.8;
const wordsA = new Set(cleanA.split(" "));
const wordsB = new Set(cleanB.split(" "));
let intersection = 0;
for (const w of wordsA) {
if (wordsB.has(w))
intersection++;
}
return intersection * 2 / (wordsA.size + wordsB.size);
}
function unpack(code) {
try {
const match = code.match(/}\((['"])([\s\S]*?)\1,\s*(\d+),\s*(\d+),\s*(['"])([\s\S]*?)\5\.split\((['"])\|\7\)/);
if (match) {
let [_, quote1, p, a, c, quote2, kStr] = match;
p = p.replace(/\\'/g, "'").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
const radix = parseInt(a);
let count = parseInt(c);
const k = kStr.split("|");
const e = (c2) => (c2 < radix ? "" : e(parseInt(c2 / radix))) + ((c2 = c2 % radix) > 35 ? String.fromCharCode(c2 + 29) : c2.toString(36));
const d = {};
while (count--)
d[e(count)] = k[count] || e(count);
return p.replace(/\b\w+\b/g, (w) => d[w]);
}
} catch (e) {
}
return code;
}
function isRealStreamUrl(url) {
if (!url || typeof url !== "string")
return false;
if (!url.startsWith("http://") && !url.startsWith("https://"))
return false;
const lowercase = url.toLowerCase();
if (lowercase.includes("/embed/") || lowercase.includes("/embed-") || lowercase.includes("/e/") || lowercase.includes("/play.php") || lowercase.includes("/player.php") || lowercase.includes("abyssplayer.com") || lowercase.includes("short.icu") || lowercase.includes("cloudy.upns.one") || lowercase.includes("vidcloud.upns.ink") || lowercase.includes("filesforever.link") || lowercase.includes("strmup.to") || lowercase.includes("emturbovid.com") || lowercase.includes("animedekho.app") || lowercase.includes("animesalt.cx") || lowercase.includes("youtube.com") || lowercase.includes("youtu.be") || lowercase.includes("vimeo.com") || lowercase.includes(".html") || lowercase.includes(".htm") || lowercase.includes(".php") || lowercase.includes("#")) {
return false;
}
const isHls = lowercase.includes(".m3u8");
const isMp4 = lowercase.includes(".mp4") || lowercase.includes("/sora/") || lowercase.includes("/stream/");
return isHls || isMp4 || lowercase.includes(".mkv") || lowercase.includes(".mpd");
}
function isPlayableStream(stream) {
return __async(this, null, function* () {
if (!isRealStreamUrl(stream == null ? void 0 : stream.url))
return false;
try {
const headers = __spreadProps(__spreadValues({
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
}, stream.headers || {}), {
"Range": "bytes=0-10"
});
const res = yield fetch(stream.url, {
headers,
signal: AbortSignal.timeout(3e3)
});
if (!res.ok && res.status !== 206)
return false;
const contentType = res.headers.get("content-type") || "";
if (contentType.includes("text/html"))
return false;
return true;
} catch (e) {
return false;
}
});
}
// src/animesalt/extractors.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
var import_crypto_js = __toESM(require("crypto-js"));
function extractAwsStream(url) {
return __async(this, null, function* () {
try {
const hash = url.split("/").filter(Boolean).pop();
if (!hash)
return null;
const origin = new URL(url).origin;
const res = yield fetch(url, { headers: HEADERS });
if (!res.ok)
return null;
const html = yield res.text();
const postUrl = `${origin}/player/index.php?data=${hash}&do=getVideo`;
const postRes = yield fetch(postUrl, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), {
"x-requested-with": "XMLHttpRequest",
"Origin": origin,
"Referer": url,
"Content-Type": "application/x-www-form-urlencoded"
}),
body: `hash=${encodeURIComponent(hash)}&r=${encodeURIComponent(origin)}`
});
if (!postRes.ok)
return null;
const json = yield postRes.json();
const m3u8 = json == null ? void 0 : json.videoSource;
if (!m3u8)
return null;
let subtitle = null;
const packedMatch = html.match(/eval\(function\(p,a,c,k,e,d\)[\s\S]*?\.split\(['"]\|['"]\)\)/);
if (packedMatch) {
const unpacked = unpack(packedMatch[0]);
const subMatch = unpacked.match(/"kind":\s*"captions"\s*,\s*"file":\s*"(https?:\/\/[^"]+)"/);
if (subMatch) {
subtitle = subMatch[1].replace(/\\/g, "");
}
}
return {
url: m3u8,
headers: {
"Referer": `${origin}/`,
"Origin": origin,
"User-Agent": HEADERS["User-Agent"]
},
subtitles: subtitle ? [{ lang: "English", url: subtitle }] : []
};
} catch (e) {
return null;
}
});
}
function extractAbyss(url, langName = "Default") {
return __async(this, null, function* () {
var _a;
try {
const cleanUrl = url.replace("https://short.icu", "https://abyssplayer.com");
const reqHeaders = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36",
"Origin": "https://playhydrax.com",
"Referer": "https://playhydrax.com/"
};
const res = yield fetch(cleanUrl, { headers: reqHeaders });
if (!res.ok)
return [];
const html = yield res.text();
const match = html.match(/const\s+datas\s*=\s*"([^"]*)"/);
if (!match || !match[1])
return [];
const decRes = yield fetch("https://enc-dec.app/api/dec-abyss", {
method: "POST",
headers: __spreadProps(__spreadValues({}, reqHeaders), {
"Content-Type": "application/json"
}),
body: JSON.stringify({ text: match[1] })
});
if (!decRes.ok)
return [];
const decData = yield decRes.json();
const sources = ((_a = decData == null ? void 0 : decData.result) == null ? void 0 : _a.sources) || [];
return sources.filter((s) => s && s.url && s.status).map((s) => {
const codec = (s.codec || "MP4").toUpperCase();
const quality = s.type || "720p";
return {
name: `AnimeSalt [${langName}] (${codec} ${quality})`,
url: s.url,
quality,
headers: {
"Referer": "https://playhydrax.com/",
"Origin": "https://playhydrax.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
},
type: s.url.includes(".m3u8") ? "m3u8" : "mp4"
};
});
} catch (e) {
return [];
}
});
}
function extractMultiLang(dataParam) {
return __async(this, null, function* () {
try {
let decodedStr = "";
if (typeof atob === "function") {
decodedStr = atob(dataParam);
} else {
decodedStr = Buffer.from(dataParam, "base64").toString("utf-8");
}
const list = JSON.parse(decodedStr);
if (!Array.isArray(list))
return [];
const streamPromises = list.map((item) => {
const lang = item.language || "Default";
const link = item.link;
if (!link)
return Promise.resolve([]);
return extractAbyss(link, lang);
});
const nested = yield Promise.all(streamPromises);
return nested.flat();
} catch (e) {
return [];
}
});
}
function extractMegaPlay(url) {
return __async(this, null, function* () {
var _a;
try {
let streamPageUrl = url;
if (!url.includes("/stream/s-")) {
const pageRes = yield fetch(url, { headers: HEADERS });
if (!pageRes.ok)
return [];
const html = yield pageRes.text();
const $ = import_cheerio_without_node_native.default.load(html);
const embedSrc = $("iframe.s5-embed").attr("src");
if (!embedSrc)
return [];
streamPageUrl = embedSrc;
}
const idMatch = streamPageUrl.match(/\/stream\/s-\d+\/(\d+)\//);
if (!idMatch || !idMatch[1])
return [];
const id = idMatch[1];
const origin = new URL(streamPageUrl).origin;
const apiHeaders = {
"Accept": "*/*",
"X-Requested-With": "XMLHttpRequest",
"Referer": origin,
"User-Agent": HEADERS["User-Agent"]
};
const apiRes = yield fetch(`${origin}/stream/getSources?id=${id}`, { headers: apiHeaders });
if (!apiRes.ok)
return [];
const resJson = yield apiRes.json();
let file = (_a = resJson == null ? void 0 : resJson.sources) == null ? void 0 : _a.file;
const enc = resJson == null ? void 0 : resJson.enc;
if (!file && enc) {
const keyStr = "i?LMTAx0Q6,:}50U";
const keyHex = import_crypto_js.default.enc.Utf8.parse(keyStr).toString(import_crypto_js.default.enc.Hex).padEnd(64, "0");
const key = import_crypto_js.default.enc.Hex.parse(keyHex);
const iv = import_crypto_js.default.enc.Utf8.parse("W0;27ToaUpl_P%'c");
const normalized = enc.replace(/-/g, "+").replace(/_/g, "/");
const padded = normalized + "=".repeat((4 - normalized.length % 4) % 4);
const decrypted = import_crypto_js.default.AES.decrypt(padded, key, {
iv,
mode: import_crypto_js.default.mode.CBC,
padding: import_crypto_js.default.pad.Pkcs7
});
const decObj = JSON.parse(decrypted.toString(import_crypto_js.default.enc.Utf8));
file = decObj == null ? void 0 : decObj.file;
}
if (!file)
return [];
const tokenMatch = file.match(/\/([a-f0-9]{32})\/([a-f0-9]{32})\//i);
if (tokenMatch && !file.includes("token=")) {
const secret = "MpCdnT0k3n!9f2K#xQ7vL5mR8wN1pY4s";
const expires = Math.floor(Date.now() / 1e3) + 90;
const payload = `${expires}|${tokenMatch[1]}/${tokenMatch[2]}`;
const hash = import_crypto_js.default.HmacSHA256(payload, secret);
const b64Payload = import_crypto_js.default.enc.Base64.stringify(import_crypto_js.default.enc.Utf8.parse(payload)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
const b64Sig = import_crypto_js.default.enc.Base64.stringify(hash).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
const token = `${b64Payload}.${b64Sig}`;
file = `${file}${file.includes("?") ? "&" : "?"}token=${token}`;
}
const subtitles = ((resJson == null ? void 0 : resJson.tracks) || []).filter((t) => t.file && t.kind !== "thumbnails").map((t) => ({ lang: t.label || "English", url: t.file }));
return [{
name: "AnimeSalt [MegaPlay] (Auto M3U8)",
url: file,
quality: "1080p",
headers: {
"Referer": `${origin}/`,
"Origin": origin,
"User-Agent": HEADERS["User-Agent"]
},
subtitles,
type: "m3u8"
}];
} catch (e) {
return [];
}
});
}
function extractStreamWish(url) {
return __async(this, null, function* () {
try {
const embedUrl = url.includes("/e/") ? url : url.replace("/f/", "/e/");
const res = yield fetch(embedUrl, { headers: HEADERS });
if (!res.ok)
return null;
const html = yield res.text();
const packedMatch = html.match(/eval\(function\(p,a,c,k,e,d\)[\s\S]*?\.split\(['"]\|['"]\)\)/);
if (packedMatch) {
const unpacked = unpack(packedMatch[0]);
const fileMatch = unpacked.match(/file\s*:\s*["'](https?:\/\/[^"'\s]+\.m3u8(?:\?[^"'\s]*)?)["']/);
if (fileMatch) {
const origin = new URL(embedUrl).origin;
return {
name: "AnimeSalt [StreamWish] (Auto M3U8)",
url: fileMatch[1],
quality: "720p",
headers: {
"Referer": `${origin}/`,
"Origin": origin,
"User-Agent": HEADERS["User-Agent"]
},
type: "m3u8"
};
}
}
} catch (e) {
}
return null;
});
}
// src/animesalt/index.js
function searchAnimeSalt(query) {
return __async(this, null, function* () {
var _a;
try {
const body = `action=torofilm_infinite_scroll&page=1&per_page=12&query_type=search&query_args[s]=${encodeURIComponent(query)}`;
const res = yield fetch(`${MAIN_URL}/wp-admin/admin-ajax.php`, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"Referer": `${MAIN_URL}/`
}),
body
});
if (!res.ok)
return [];
const json = yield res.json();
if (!(json == null ? void 0 : json.success) || !((_a = json == null ? void 0 : json.data) == null ? void 0 : _a.content))
return [];
const $ = import_cheerio_without_node_native2.default.load(json.data.content);
const results = [];
$("article").each((_, el) => {
const title = $(el).find("header h2").text().trim();
const href = $(el).find("a").first().attr("href");
if (title && href) {
results.push({ title, href });
}
});
return results;
} catch (e) {
return [];
}
});
}
function getStreams(tmdbId, mediaType, seasonNum = 1, episodeNum = 1) {
return __async(this, null, function* () {
try {
const details = yield fetchTmdbDetails(tmdbId, mediaType);
if (!details || !details.title)
return [];
let results = yield searchAnimeSalt(details.title);
if (results.length === 0) {
const cleaned = cleanTitle(details.title);
if (cleaned && cleaned !== details.title.toLowerCase()) {
results = yield searchAnimeSalt(cleaned);
}
}
if (results.length === 0)
return [];
let bestMatch = null;
let highestSim = 0;
for (const item of results) {
const sim = titleSimilarity(details.title, item.title);
if (sim > highestSim) {
highestSim = sim;
bestMatch = item;
}
}
if (!bestMatch || highestSim < 0.2) {
bestMatch = results[0];
}
let targetUrl = bestMatch.href;
if (mediaType === "tv") {
const seriesRes = yield fetch(bestMatch.href, { headers: HEADERS });
if (!seriesRes.ok)
return [];
const seriesHtml = yield seriesRes.text();
const $series = import_cheerio_without_node_native2.default.load(seriesHtml);
let seasonBtn = $series(`div.season-buttons a[data-season="${seasonNum}"]`);
if (seasonBtn.length === 0) {
seasonBtn = $series("div.season-buttons a").first();
}
const postId = seasonBtn.attr("data-post");
const dataSeason = seasonBtn.attr("data-season") || seasonNum;
if (postId) {
const epRes = yield fetch(`${MAIN_URL}/wp-admin/admin-ajax.php`, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"Referer": bestMatch.href
}),
body: `action=action_select_season&season=${dataSeason}&post=${postId}`
});
if (epRes.ok) {
const epHtml = yield epRes.text();
const $ep = import_cheerio_without_node_native2.default.load(epHtml);
const epArticles = $ep("li article");
let targetEp = null;
epArticles.each((idx, el) => {
const epText = $ep(el).find("h2.entry-title").text();
if (epText.includes(`x${episodeNum}`) || epText.includes(`Episode ${episodeNum}`)) {
targetEp = $ep(el).find("a").first().attr("href");
}
});
if (!targetEp && epArticles.length >= episodeNum) {
targetEp = $ep(epArticles[episodeNum - 1]).find("a").first().attr("href");
}
if (targetEp) {
targetUrl = targetEp;
}
}
}
}
const pageRes = yield fetch(targetUrl, { headers: HEADERS });
if (!pageRes.ok)
return [];
const pageHtml = yield pageRes.text();
const $page = import_cheerio_without_node_native2.default.load(pageHtml);
const iframeUrls = /* @__PURE__ */ new Set();
$page("iframe").each((_, el) => {
const src = $page(el).attr("data-src") || $page(el).attr("src");
if (src && !src.startsWith("about:") && !src.startsWith("javascript:")) {
const fullUrl = src.startsWith("//") ? `https:${src}` : src.startsWith("http") ? src : `${MAIN_URL}${src}`;
iframeUrls.add(fullUrl);
}
});
const streams = [];
const promises = [];
for (const iframeUrl of iframeUrls) {
if (iframeUrl.includes("multi-lang-plyr/player.php")) {
const urlObj = new URL(iframeUrl);
const dataParam = urlObj.searchParams.get("data");
if (dataParam) {
promises.push(
extractMultiLang(dataParam).then((res) => {
if (Array.isArray(res))
streams.push(...res);
})
);
}
} else if (iframeUrl.includes("as-cdn") || iframeUrl.includes("awstream") || iframeUrl.includes("zephyrflick")) {
promises.push(
extractAwsStream(iframeUrl).then((res) => {
if (res && res.url) {
streams.push({
name: "AnimeSalt [AWSStream] (Auto M3U8)",
url: res.url,
quality: "1080p",
headers: res.headers,
subtitles: res.subtitles,
type: "m3u8"
});
}
})
);
} else if (iframeUrl.includes("abyssplayer.com") || iframeUrl.includes("short.icu")) {
promises.push(
extractAbyss(iframeUrl, "Default").then((res) => {
if (Array.isArray(res))
streams.push(...res);
})
);
} else if (iframeUrl.includes("megaplay.buzz") || iframeUrl.includes("rapid-cloud.co")) {
promises.push(
extractMegaPlay(iframeUrl).then((res) => {
if (Array.isArray(res))
streams.push(...res);
})
);
} else if (iframeUrl.includes("pixdrive") || iframeUrl.includes("ghbrisk") || iframeUrl.includes("streamwish") || iframeUrl.includes("filesim")) {
promises.push(
extractStreamWish(iframeUrl).then((res) => {
if (res)
streams.push(res);
})
);
}
}
yield Promise.allSettled(promises);
const seenUrls = /* @__PURE__ */ new Set();
const candidateStreams = [];
for (const s of streams) {
if (s && s.url && !seenUrls.has(s.url) && isRealStreamUrl(s.url)) {
seenUrls.add(s.url);
candidateStreams.push({
name: s.name || "AnimeSalt",
title: mediaType === "movie" ? details.title : `${details.title} - S${seasonNum}E${episodeNum}`,
url: s.url,
quality: s.quality || "Auto",
headers: s.headers,
subtitles: s.subtitles || [],
provider: "animesalt",
type: s.type || "m3u8"
});
}
}
const probeResults = yield Promise.all(
candidateStreams.map((s) => __async(this, null, function* () {
return { stream: s, playable: yield isPlayableStream(s) };
}))
);
let finalStreams = probeResults.filter((r) => r.playable).map((r) => r.stream);
if (finalStreams.length === 0)
finalStreams = candidateStreams;
const qualityOrder = { "1080p": 4, "720p": 3, "480p": 2, "360p": 1, "Auto": 0 };
return finalStreams.sort((a, b) => {
var _a, _b;
return ((_a = qualityOrder[b.quality]) != null ? _a : 0) - ((_b = qualityOrder[a.quality]) != null ? _b : 0);
});
} catch (e) {
return [];
}
});
}
module.exports = { getStreams };
+1 -1
View File
@@ -1 +1 @@
var _0x12d368=_0x6693;(function(_0x5866cb,_0x2c0651){var _0x2fa589=_0x6693,_0x22f986=_0x5866cb();while(!![]){try{var _0x44a7ff=-parseInt(_0x2fa589(0x19e))/0x1+parseInt(_0x2fa589(0x186))/0x2*(parseInt(_0x2fa589(0x18b))/0x3)+parseInt(_0x2fa589(0x18c))/0x4*(parseInt(_0x2fa589(0x1ae))/0x5)+parseInt(_0x2fa589(0x1a6))/0x6+-parseInt(_0x2fa589(0x1ab))/0x7*(parseInt(_0x2fa589(0x1a5))/0x8)+-parseInt(_0x2fa589(0x194))/0x9+-parseInt(_0x2fa589(0x198))/0xa*(-parseInt(_0x2fa589(0x1a8))/0xb);if(_0x44a7ff===_0x2c0651)break;else _0x22f986['push'](_0x22f986['shift']());}catch(_0xaf737b){_0x22f986['push'](_0x22f986['shift']());}}}(_0x1e0c,0x68dcd));function _0x1e0c(){var _0x2fb3a7=['Bw92Awu','mtbuB1rtDvm','BgvUz3rO','Ahr0Chm6lY93yxrJAgfUAw1LD29YBgqUBMv0','l3bSyxLLCI9PBMrLEc5WAha/zgf0yt0','BMfTzq','we1mshr0CfjLCxvLC3q','ntmYnZiXwLfpBMvy','l2nKBI9KB3DUlW','lZ9Zpq','DxjS','8j+xOE+4JYbbBMLTzvDVCMXK','yxnZAwDU','rw5NBgLZAa','otzAEhnRqKm','nJyYndaWrNPUBuHk','Bw92AwvZ','nZK2mdiWnvbkAgvhAq','y2f0y2G','CgfNzq','nduZndzKEfbwB0W','mta4mha','l1n1yNrPDgXLl3n1yNrPDgXLx2vUzY5ZCNq','ntq3otvqthrAwMe','zxHWB3j0CW','C2vYAwvZ','A2vLCc1HBgL2zq','zxHLyW','sfruuca','DgHLBG','Ahr0Chm6lY9HCgKUDgHLBw92AwvKyI5VCMCVmY8','Bwf0y2G','neTtwfPJAq','jNi9','tw96AwXSys81lJaGkfDPBMrVD3mGtLqGmtaUmdSGv2LUnJq7ihG2ncKGqxbWBgvxzwjlAxqVntm3lJm2icHlsfrntcWGBgLRzsbhzwnRBYKGq2HYB21LlZeYmc4WlJaUmcbtywzHCMKVntm3lJm2','DgL0Bgu','C3rHDhvZ','odm3mteXBevVCfn2','mtm2CKPZyLnl','C2vJDxjLzeXPBMS','ANnVBG','Aw5KzxHpzG','jMrVpwDLDfzPzgvV','C3vIDgL0Bgu','qw5PBwvxB3jSzcdIGkiGtxvSDgKTqxvKAw8Gmta4mha','DhLWzq','nJuYmJG0ou1rtxLStq','DMLKzw9tB3vYy2u','jNbVC3q9'];_0x1e0c=function(){return _0x2fb3a7;};return _0x1e0c();}var TMDB_KEY='d80ba92bc7cefe3359668d30d06f3305',BASE=_0x12d368(0x19a),PLAYER='https://play.zephyrflick.top',UA=_0x12d368(0x188);function httpGet(_0x4dd1ad,_0x12d8c2){var _0x5d0ff1=_0x12d368;return fetch(_0x4dd1ad,{'headers':Object[_0x5d0ff1(0x1a3)]({'User-Agent':UA},_0x12d8c2||{})})[_0x5d0ff1(0x183)](function(_0x4e8bbc){var _0x57654c=_0x5d0ff1;if(!_0x4e8bbc['ok'])throw new Error(_0x57654c(0x1b3)+_0x4e8bbc[_0x57654c(0x18a)]);return _0x4e8bbc['text']();});}function httpPost(_0x2fd8fc,_0x2e768f,_0x3ebb46){var _0x5c935b=_0x12d368;return fetch(_0x2fd8fc,{'method':'POST','headers':Object[_0x5c935b(0x1a3)]({'User-Agent':UA,'Content-Type':'application/x-www-form-urlencoded'},_0x3ebb46||{}),'body':_0x2e768f})[_0x5c935b(0x183)](function(_0x279e4c){var _0x2ca3e4=_0x5c935b;if(!_0x279e4c['ok'])throw new Error(_0x2ca3e4(0x1b3)+_0x279e4c[_0x2ca3e4(0x18a)]);return _0x279e4c['json']();});}function _0x6693(_0x4eac2a,_0x54aa47){_0x4eac2a=_0x4eac2a-0x183;var _0x1e0cef=_0x1e0c();var _0x6693a9=_0x1e0cef[_0x4eac2a];if(_0x6693['lBIKAi']===undefined){var _0x55e4ee=function(_0x4b904c){var _0x3c9b87='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x4dd1ad='',_0x12d8c2='';for(var _0x4e8bbc=0x0,_0x2fd8fc,_0x2e768f,_0x3ebb46=0x0;_0x2e768f=_0x4b904c['charAt'](_0x3ebb46++);~_0x2e768f&&(_0x2fd8fc=_0x4e8bbc%0x4?_0x2fd8fc*0x40+_0x2e768f:_0x2e768f,_0x4e8bbc++%0x4)?_0x4dd1ad+=String['fromCharCode'](0xff&_0x2fd8fc>>(-0x2*_0x4e8bbc&0x6)):0x0){_0x2e768f=_0x3c9b87['indexOf'](_0x2e768f);}for(var _0x279e4c=0x0,_0x440768=_0x4dd1ad['length'];_0x279e4c<_0x440768;_0x279e4c++){_0x12d8c2+='%'+('00'+_0x4dd1ad['charCodeAt'](_0x279e4c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12d8c2);};_0x6693['IhEcis']=_0x55e4ee,_0x6693['totfgc']={},_0x6693['lBIKAi']=!![];}var _0x665320=_0x1e0cef[0x0],_0x479db4=_0x4eac2a+_0x665320,_0x262c2e=_0x6693['totfgc'][_0x479db4];return!_0x262c2e?(_0x6693a9=_0x6693['IhEcis'](_0x6693a9),_0x6693['totfgc'][_0x479db4]=_0x6693a9):_0x6693a9=_0x262c2e,_0x6693a9;}function searchSite(_0x440768,_0x287a36){var _0x175b25=_0x12d368,_0x2f4c24=BASE+_0x175b25(0x1a0)+encodeURIComponent(_0x440768);return httpGet(_0x2f4c24,{'Referer':BASE+'/'})[_0x175b25(0x183)](function(_0x14e8ed){var _0x4b85c5=_0x175b25,_0x3df02a=[],_0x348335=/href="(https:\/\/watchanimeworld\.net\/(series|movies)\/([^\/\"]+)\/)"/g,_0x2eee89;while((_0x2eee89=_0x348335[_0x4b85c5(0x1b2)](_0x14e8ed))!==null){var _0x282822=_0x2eee89[0x1],_0x39bd5d=_0x2eee89[0x2],_0x486c63=_0x2eee89[0x3];_0x486c63&&_0x486c63!==_0x4b85c5(0x1aa)&&_0x3df02a['push']({'url':_0x282822,'type':_0x39bd5d,'slug':_0x486c63});}return _0x3df02a['filter'](function(_0x4e8238){var _0x31801e=_0x4b85c5;return _0x287a36===_0x31801e(0x197)?_0x4e8238[_0x31801e(0x193)]===_0x31801e(0x1a7):_0x4e8238[_0x31801e(0x193)]===_0x31801e(0x1b0);});});}function getEpisodeUrl(_0x251373,_0x5d2023,_0x31ccd1){return httpGet(_0x251373,{'Referer':BASE+'/'})['then'](function(_0x4bddf9){var _0x9bc76c=_0x6693,_0x1445ce=_0x4bddf9[_0x9bc76c(0x185)](/postid-(\d+)/)||_0x4bddf9[_0x9bc76c(0x185)](/data-post="(\d+)"/);if(!_0x1445ce)return null;var _0x29078a=BASE+'/wp-admin/admin-ajax.php?action=action_select_season&season='+_0x5d2023+_0x9bc76c(0x196)+_0x1445ce[0x1];return httpGet(_0x29078a,{'Referer':_0x251373})[_0x9bc76c(0x183)](function(_0x89d2aa){var _0x55a160=_0x9bc76c,_0xLine truncated
var _0x388760=_0x3571;(function(_0x5bf76f,_0x3a97b1){var _0x1a9865={_0x5721b6:0x1e4,_0x533016:0x1e1,_0x41c127:0x1c4,_0x17bb1e:0x1da,_0x40787b:0x1c5,_0xc5f98:0x1f4},_0x226b65=_0x3571,_0x194c2c=_0x5bf76f();while(!![]){try{var _0xc353c8=-parseInt(_0x226b65(_0x1a9865._0x5721b6))/0x1+-parseInt(_0x226b65(_0x1a9865._0x533016))/0x2*(parseInt(_0x226b65(_0x1a9865._0x41c127))/0x3)+parseInt(_0x226b65(0x1d3))/0x4+-parseInt(_0x226b65(0x1c8))/0x5*(parseInt(_0x226b65(0x1d2))/0x6)+-parseInt(_0x226b65(_0x1a9865._0x17bb1e))/0x7+parseInt(_0x226b65(0x1db))/0x8*(parseInt(_0x226b65(_0x1a9865._0x40787b))/0x9)+parseInt(_0x226b65(0x1d0))/0xa*(parseInt(_0x226b65(_0x1a9865._0xc5f98))/0xb);if(_0xc353c8===_0x3a97b1)break;else _0x194c2c['push'](_0x194c2c['shift']());}catch(_0x3b64af){_0x194c2c['push'](_0x194c2c['shift']());}}}(_0xf2c8,0x4bc85));var TMDB_KEY='d80ba92bc7cefe3359668d30d06f3305',BASE='https://watchanimeworld.top',PLAYER='https://play.zephyrix.top',UA=_0x388760(0x1e2);function getInvertedSortTag(_0x4c3f75,_0xfb7bb3){var _0x290f4f={_0x394ae0:0x1e3,_0x178b3e:0x1d1},_0x332005=_0x388760;if(!_0xfb7bb3)_0xfb7bb3=0xf423f;var _0x23a5d2=Math[_0x332005(0x1ce)](0x0,parseInt(_0x4c3f75,0xa)||0x0),_0x5c9928=Math['max'](0x0,_0xfb7bb3-_0x23a5d2),_0x40953a=_0x5c9928['toString'](0x2);while(_0x40953a['length']<0x14){_0x40953a='0'+_0x40953a;}return _0x40953a[_0x332005(0x1de)]('')[_0x332005(_0x290f4f._0x394ae0)](function(_0xefa4ba){return _0xefa4ba==='1'?'\ufeff':'​';})[_0x332005(_0x290f4f._0x178b3e)]('');}function _0x3571(_0x51eec8,_0x90a31b){_0x51eec8=_0x51eec8-0x1be;var _0xf2c8da=_0xf2c8();var _0x3571df=_0xf2c8da[_0x51eec8];if(_0x3571['vcGYyl']===undefined){var _0x22837f=function(_0x7e26eb){var _0x155595='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x4c3f75='',_0xfb7bb3='';for(var _0x23a5d2=0x0,_0x5c9928,_0x40953a,_0xefa4ba=0x0;_0x40953a=_0x7e26eb['charAt'](_0xefa4ba++);~_0x40953a&&(_0x5c9928=_0x23a5d2%0x4?_0x5c9928*0x40+_0x40953a:_0x40953a,_0x23a5d2++%0x4)?_0x4c3f75+=String['fromCharCode'](0xff&_0x5c9928>>(-0x2*_0x23a5d2&0x6)):0x0){_0x40953a=_0x155595['indexOf'](_0x40953a);}for(var _0x56397c=0x0,_0x631031=_0x4c3f75['length'];_0x56397c<_0x631031;_0x56397c++){_0xfb7bb3+='%'+('00'+_0x4c3f75['charCodeAt'](_0x56397c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xfb7bb3);};_0x3571['bUQCiL']=_0x22837f,_0x3571['ZYjsat']={},_0x3571['vcGYyl']=!![];}var _0x1b164b=_0xf2c8da[0x0],_0x50eb6a=_0x51eec8+_0x1b164b,_0x3fd203=_0x3571['ZYjsat'][_0x50eb6a];return!_0x3fd203?(_0x3571df=_0x3571['bUQCiL'](_0x3571df),_0x3571['ZYjsat'][_0x50eb6a]=_0x3571df):_0x3571df=_0x3fd203,_0x3571df;}function qualityRank(_0x56397c){var _0x122cb9={_0x5ab1bc:0x1e8},_0xa97dd7=_0x388760;if(/2160p|4k/i[_0xa97dd7(0x1e8)](_0x56397c))return 0x4;if(/1080p/i[_0xa97dd7(0x1e8)](_0x56397c))return 0x3;if(/720p/i[_0xa97dd7(_0x122cb9._0x5ab1bc)](_0x56397c))return 0x2;if(/480p/i['test'](_0x56397c))return 0x1;return 0x0;}function httpGet(_0x631031,_0x2c3d03){var _0x10d49e={_0x234804:0x1c0},_0x1fdc12=_0x388760;return fetch(_0x631031,{'headers':Object[_0x1fdc12(_0x10d49e._0x234804)]({'User-Agent':UA},_0x2c3d03||{})})['then'](function(_0x35fa86){var _0x4306a6=_0x1fdc12;if(!_0x35fa86['ok'])throw new Error(_0x4306a6(0x1c6)+_0x35fa86[_0x4306a6(0x1ed)]);return _0x35fa86['text']();});}function httpPost(_0x561273,_0x25b05b,_0x23cf0a){var _0x2248c9={_0x23b087:0x1e0},_0x1f5ed3={_0x1cbff5:0x1f1},_0x11f50c=_0x388760;return fetch(_0x561273,{'method':_0x11f50c(_0x2248c9._0x23b087),'headers':Object[_0x11f50c(0x1c0)]({'User-Agent':UA,'Content-Type':'application/x-www-form-urlencoded'},_0x23cf0a||{}),'body':_0x25b05b})['then'](function(_0x19d609){var _0xe21291=_0x11f50c;if(!_0x19d609['ok'])throw new Error('HTTP\x20'+_0x19d609[_0xe21291(0x1ed)]);return _0x19d609[_0xe21291(_0x1f5ed3._0x1cbff5)]();});}function searchSite(_0x351314,_0x4be9e8){var _0x31dfb5={_0x239f28:0x1bf},_0x473b77={_0x3101ee:0x1e6,_0x124cd2:0x1c2},_0x2b3cd0=BASE+'/?s='+encodeURIComponent(_0x351314);return httpGet(_0x2b3cd0,{'Referer':BASE+'/'})['then'](function(_0x9e0c7d){var _0x82d447=_0x3571,_0x2adf89=[],_0x14b4c4=/href="(https:\/\/watchanimeworld\.top\/(series|movies)\/([^\/\"]+)\/)"/g,_0x1e5b68;while((_0x1e5b68=_0x14b4c4['exec'](_0x9e0c7d))!==null){var _0x53679f=_0x1e5b68[0x1],_0x160d23=_0x1e5b68[0x2],_0x1c1991=_0x1e5b68[0x3];_0x1c1991&&_0x1c1991!=='page'&&_0x2adf89[_0x82d447(0x1d7)]({'url':_0x53679f,'type':_0x160d23,'slug':_0x1c1991});}return _0x2adf89[_0x82d447(_0x31dfb5._0x239f28)](function(_0xfcc283){var _0xee17a5=_0x82d447;return _0x4be9e8===_0xee17a5(_0x473b77._0x3101ee)?_0xfcc283['type']===_0xee17a5(0x1d5):_0xfcc283[_0xee17a5(_0x473b77._0x124cd2)]===_0xee17a5(0x1c9);});});}function _0xf2c8(){var _0x2abaea=['BwfW','mZCYmdC5z29KqLbw','8j+tIYbt','Bw92Awu','zxbPC29Kzv9UDw1Izxi','DgvZDa','iokaOIbnDwX0As1bDwrPBW','we1mshr0CfjLCxvLC3q','BgvUz3rO','EwvHCG','C3rHDhvZ','Bwf0y2G','jNi9','DxjS','ANnVBG','BMfTzq','zxHLyW','mJC1u05ouunX','8j+xOE+4JYa','zMLSDgvY','yxnZAwDU','ic0G','DhLWzq','zxbPC29Kzxm','mJCLine truncated
+800
View File
@@ -0,0 +1,800 @@
/**
* anizone - Built from src/anizone/
* Generated: 2026-09-25T19:36:47.745Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/anizone/index.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
// src/anizone/constants.js
var MAIN_URL = "https://anizone.to";
var HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0 Safari/537.36",
"Referer": "https://anizone.to/"
};
var TMDB_API_KEY = "68e094699525b18a70bab2f86b1fa706";
// src/anizone/utils.js
var HEX_ESCAPE = /\\x([0-9a-fA-F]{2})/g;
var INVALID_BACKSLASH = /\\(?!["\\/bfnrt]|u[0-9a-fA-F]{4})/g;
function sanitizeJson(raw) {
if (!raw)
return "";
return raw.replace(/\\u0022/g, '"').replace(/\\u0026/g, "&").replace(/\\'/g, "'").replace(/\\\//g, "/").replace(/\\\\/g, "\\").replace(/\\&/g, "&").replace(/\\'/g, "'").replace(/\\0/g, "\\u0000").replace(HEX_ESCAPE, (_, hex) => "\\u00" + hex).replace(INVALID_BACKSLASH, "");
}
function parseXDataJson(rawArg) {
const sanitized = sanitizeJson(rawArg);
return JSON.parse(sanitized);
}
function fetchWithTimeout(_0) {
return __async(this, arguments, function* (url, options = {}, timeoutMs = 8e3) {
const mergedHeaders = __spreadValues({
"User-Agent": HEADERS["User-Agent"],
"Referer": HEADERS["Referer"]
}, options.headers || {});
const fetchOptions = __spreadProps(__spreadValues({
skipSizeCheck: true
}, options), {
headers: mergedHeaders
});
if (typeof setTimeout !== "function") {
return fetch(url, fetchOptions);
}
let timer = null;
const timeoutPromise = new Promise((_, reject) => {
timer = setTimeout(() => reject(new Error("Timeout")), timeoutMs);
});
try {
const res = yield Promise.race([
fetch(url, fetchOptions),
timeoutPromise
]);
clearTimeout(timer);
return res;
} catch (e) {
clearTimeout(timer);
throw e;
}
});
}
function fetchText(_0) {
return __async(this, arguments, function* (url, options = {}) {
const finalUrl = url.startsWith("http") ? url : `${MAIN_URL}${url}`;
try {
const response = yield fetchWithTimeout(finalUrl, options, 1e4);
if (!response.ok)
return "";
return yield response.text();
} catch (e) {
return "";
}
});
}
function fetchWithCookies(_0) {
return __async(this, arguments, function* (url, options = {}) {
var _a, _b;
const finalUrl = url.startsWith("http") ? url : `${MAIN_URL}${url}`;
try {
const response = yield fetchWithTimeout(finalUrl, options, 1e4);
if (!response.ok)
return { text: "", cookies: "", ok: false };
const text = yield response.text();
let cookies = "";
try {
if (typeof ((_a = response.headers) == null ? void 0 : _a.getSetCookie) === "function") {
cookies = response.headers.getSetCookie().map((c) => c.split(";")[0]).join("; ");
} else if ((_b = response.headers) == null ? void 0 : _b.get) {
cookies = response.headers.get("set-cookie") || "";
}
} catch (_) {
}
return { text, cookies, ok: true };
} catch (e) {
return { text: "", cookies: "", ok: false };
}
});
}
function getImdbId(tmdbId, mediaType) {
return __async(this, null, function* () {
try {
const url = `https://api.themoviedb.org/3/${mediaType === "tv" ? "tv" : "movie"}/${tmdbId}/external_ids?api_key=${TMDB_API_KEY}`;
const res = yield fetchWithTimeout(url, {}, 5e3);
const data = yield res.json();
return data.imdb_id || null;
} catch (_) {
return null;
}
});
}
function isDateMatch(d1, d2) {
if (!d1 || !d2)
return false;
const s1 = d1.split("T")[0];
const s2 = d2.split("T")[0];
const date1 = /* @__PURE__ */ new Date(s1 + "T00:00:00Z");
const date2 = /* @__PURE__ */ new Date(s2 + "T00:00:00Z");
const diff = Math.abs(date1.getTime() - date2.getTime());
return Math.ceil(diff / (1e3 * 60 * 60 * 24)) <= 2;
}
function resolveMapping(imdbId, season, episode, tmdbId) {
return __async(this, null, function* () {
var _a, _b, _c, _d;
const seasonNum = parseInt(season, 10);
const episodeNum = parseInt(episode, 10);
const mapId = `${imdbId}:s${season}:e${episode}`;
let metaData = null;
const metaUrls = [
`https://v3-cinemeta.strem.io/meta/series/${imdbId}.json`,
`https://cinemeta-live.strem.io/meta/series/${imdbId}.json`
];
for (const url of metaUrls) {
try {
const mRes = yield fetchWithTimeout(url, {}, 5e3);
if (mRes.ok) {
const text = yield mRes.text();
const json = JSON.parse(text);
if ((_a = json == null ? void 0 : json.meta) == null ? void 0 : _a.videos) {
metaData = json.meta;
break;
}
}
} catch (_) {
}
}
if ((!metaData || !metaData.videos) && tmdbId) {
try {
const tmdbEpUrl = `https://api.themoviedb.org/3/tv/${tmdbId}/season/${seasonNum}/episode/${episodeNum}?api_key=${TMDB_API_KEY}`;
const tmdbRes = yield fetchWithTimeout(tmdbEpUrl, {}, 5e3);
if (tmdbRes.ok) {
const epData = JSON.parse(yield tmdbRes.text());
if (epData == null ? void 0 : epData.air_date) {
const tvUrl = `https://api.themoviedb.org/3/tv/${tmdbId}?api_key=${TMDB_API_KEY}`;
const tvRes = yield fetchWithTimeout(tvUrl, {}, 5e3);
const tvData = tvRes.ok ? JSON.parse(yield tvRes.text()) : {};
metaData = {
name: tvData.name || tvData.original_name,
moviedb_id: tmdbId,
videos: [{
season: seasonNum,
episode: episodeNum,
released: epData.air_date
}]
};
}
}
} catch (_) {
}
}
if (!metaData || !metaData.videos)
return null;
const video = metaData.videos.find((v) => v.season === seasonNum && v.episode === episodeNum);
if (!(video == null ? void 0 : video.released))
return null;
const airDate = video.released.split("T")[0];
const showTitle = metaData.name;
const dayIndex = metaData.videos.filter((v) => {
if (!v.released)
return false;
return v.released.split("T")[0] === airDate && (v.season < seasonNum || v.season === seasonNum && v.episode < episodeNum);
}).length;
let malIds = [];
const tId = tmdbId || metaData.moviedb_id || metaData.themoviedb_id;
const tvdbId = metaData.tvdb_id;
const armUrls = [
`https://arm.haglund.dev/api/v2/imdb?id=${imdbId}`,
tId ? `https://arm.haglund.dev/api/v2/themoviedb?id=${tId}` : null,
tvdbId ? `https://arm.haglund.dev/api/v2/thetvdb?id=${tvdbId}` : null
].filter(Boolean);
for (const url of armUrls) {
try {
const res = yield fetchWithTimeout(url, {}, 5e3);
if (res.ok) {
const data = JSON.parse(yield res.text());
if (Array.isArray(data)) {
data.forEach((e) => {
if (e.myanimelist)
malIds.push(e.myanimelist);
});
}
}
} catch (_) {
}
}
try {
const aniIdUrl = tId ? `https://api.ani.zip/mappings?themoviedb_id=${tId}` : `https://api.ani.zip/mappings?imdb_id=${imdbId}`;
const aniRes = yield fetchWithTimeout(aniIdUrl, {}, 5e3);
if (aniRes.ok) {
const aniData = JSON.parse(yield aniRes.text());
if ((_b = aniData == null ? void 0 : aniData.mappings) == null ? void 0 : _b.mal_id)
malIds.push(aniData.mappings.mal_id);
}
} catch (_) {
}
malIds = [...new Set(malIds)].filter(Boolean).sort((a, b) => b - a);
let finalResult = null;
for (const malId of malIds) {
try {
const aniRes = yield fetchWithTimeout(`https://api.ani.zip/mappings?mal_id=${malId}`, {}, 5e3);
if (aniRes.ok) {
const aniData = JSON.parse(yield aniRes.text());
const extraTitles = (aniData == null ? void 0 : aniData.titles) ? Object.values(aniData.titles).filter(Boolean) : [];
if (aniData == null ? void 0 : aniData.episodes) {
const aniEpisodes = Object.values(aniData.episodes).map((ep) => ({
mal_episode_number: parseInt(ep.episode, 10),
air_date: ep.airDateUtc || ep.airDate || ep.airdate
})).filter((ep) => !isNaN(ep.mal_episode_number));
const aniDateMatches = aniEpisodes.filter((ep) => isDateMatch(ep.air_date, airDate)).sort((a, b) => a.mal_episode_number - b.mal_episode_number);
if (aniDateMatches[dayIndex]) {
const match = aniDateMatches[dayIndex];
finalResult = {
id: mapId,
imdb_id: imdbId,
season: seasonNum,
episode: episodeNum,
mal_id: malId,
mal_episode: match.mal_episode_number,
anime_title: showTitle,
titles: extraTitles,
air_date: airDate
};
break;
}
}
}
} catch (_) {
}
try {
const jRes = yield fetchWithTimeout(`https://api.jikan.moe/v4/anime/${malId}`, {}, 5e3);
if (jRes.ok) {
const jData = JSON.parse(yield jRes.text());
if (((_d = (_c = jData == null ? void 0 : jData.data) == null ? void 0 : _c.aired) == null ? void 0 : _d.from) && isDateMatch(jData.data.aired.from, airDate)) {
finalResult = {
id: mapId,
imdb_id: imdbId,
season: seasonNum,
episode: episodeNum,
mal_id: malId,
mal_episode: dayIndex + 1,
anime_title: showTitle,
titles: [jData.data.title, jData.data.title_english, jData.data.title_japanese].filter(Boolean),
air_date: airDate
};
break;
}
}
} catch (_) {
}
}
if (!finalResult && malIds.length === 1 && seasonNum === 1) {
finalResult = {
id: mapId,
imdb_id: imdbId,
season: seasonNum,
episode: episodeNum,
mal_id: malIds[0],
mal_episode: episodeNum,
anime_title: showTitle,
titles: [],
air_date: airDate
};
}
return finalResult;
});
}
function getMalTitle(malId) {
return __async(this, null, function* () {
var _a, _b;
if (!malId)
return null;
try {
const res = yield fetchWithTimeout(`https://api.jikan.moe/v4/anime/${malId}`, {}, 5e3);
if (res.ok) {
const data = yield res.json();
return ((_a = data.data) == null ? void 0 : _a.title) || ((_b = data.data) == null ? void 0 : _b.title_english) || null;
}
} catch (_) {
}
return null;
});
}
function getTmdbInfo(tmdbId, mediaType, season = 1) {
return __async(this, null, function* () {
try {
const url = `https://api.themoviedb.org/3/${mediaType === "tv" ? "tv" : "movie"}/${tmdbId}?api_key=${TMDB_API_KEY}`;
const res = yield fetchWithTimeout(url, {}, 6e3);
if (!res.ok)
return null;
const data = yield res.json();
const info = {
title: data.name || data.title || data.original_name || data.original_title || "",
originalTitle: data.original_name || data.original_title || "",
seasonName: ""
};
if (mediaType === "tv" && season) {
try {
const sUrl = `https://api.themoviedb.org/3/tv/${tmdbId}/season/${season}?api_key=${TMDB_API_KEY}`;
const sRes = yield fetchWithTimeout(sUrl, {}, 6e3);
if (sRes.ok) {
const sData = yield sRes.json();
info.seasonName = sData.name || "";
}
} catch (e) {
}
}
return info;
} catch (e) {
return null;
}
});
}
// src/anizone/index.js
function normalize(str) {
if (!str)
return "";
return str.toLowerCase().replace(/[^a-z0-9]/g, "").trim();
}
function parseCards(html, $) {
const cards = [];
const itemsMatch = html.match(/items:\s*JSON\.parse\('((?:[^'\\]|\\.)*)'\)/);
if (itemsMatch) {
try {
const parsed = parseXDataJson(itemsMatch[1]);
if (Array.isArray(parsed)) {
for (const item of parsed) {
if (!item || !item.slug)
continue;
const titles = /* @__PURE__ */ new Set();
if (item.main_title)
titles.add(item.main_title);
if (item.title_list && typeof item.title_list === "object") {
Object.values(item.title_list).forEach((t) => {
if (t)
titles.add(t);
});
}
cards.push({
slug: item.slug,
url: item.url || `/anime/${item.slug}`,
titles: Array.from(titles)
});
}
}
} catch (e) {
}
}
if (cards.length === 0) {
$('[x-data*="anmTitles"]').each((i, el) => {
const href = $(el).find('a[href*="/anime/"]').first().attr("href");
if (!href)
return;
const parts = href.split("/");
const slug = parts[parts.length - 1] || parts[parts.length - 2];
const titles = /* @__PURE__ */ new Set();
const xData = $(el).attr("x-data") || "";
const jsonMatch = xData.match(/JSON\.parse\('((?:[^'\\]|\\.)*)'\)/);
if (jsonMatch) {
try {
const parsed = parseXDataJson(jsonMatch[1]);
Object.values(parsed).forEach((t) => {
if (t)
titles.add(t);
});
} catch (e) {
}
}
cards.push({ slug, titles: Array.from(titles) });
});
}
return cards;
}
function getSeasonRegexes(season) {
if (season === 1) {
return {
mustNot: [
/season\s*[2-9]/i,
/saison\s*[2-9]/i,
/[\s\-][iI]{2,}/,
/\s+[2-9]nd/i,
/\s+[2-9]rd/i,
/\s+[2-9]th/i,
/\s+ii\b/i,
/\s+iii\b/i,
/\s+iv\b/i,
/\s+v\b/i,
/movie/i,
/gekijouban/i,
/the movie/i
]
};
}
const patterns = [];
if (season === 2) {
patterns.push(/season\s*2/i, /saison\s*2/i, /2nd\s*season/i, /[\s\-]ii\b/i, /\b2\b/);
} else if (season === 3) {
patterns.push(/season\s*3/i, /saison\s*3/i, /3rd\s*season/i, /[\s\-]iii\b/i, /\b3\b/);
} else if (season === 4) {
patterns.push(/season\s*4/i, /saison\s*4/i, /4th\s*season/i, /[\s\-]iv\b/i, /\b4\b/, /final\s*season/i);
} else {
patterns.push(new RegExp(`(?:season|saison)\\s*${season}`, "i"), new RegExp(`\\b${season}\\b`));
}
return { must: patterns };
}
function matchCard(cards, targetTitles, baseTitle, season = 1, seasonName = "") {
const normalizedTargets = targetTitles.map(normalize).filter(Boolean);
const normalizedBase = normalize(baseTitle);
const normalizedSeasonName = normalize(seasonName);
if (normalizedSeasonName && normalizedSeasonName !== "season" + season) {
for (const card of cards) {
for (const title of card.titles) {
if (normalize(title).includes(normalizedSeasonName)) {
return card.slug;
}
}
}
}
for (const target of normalizedTargets) {
for (const card of cards) {
for (const title of card.titles) {
if (normalize(title) === target) {
return card.slug;
}
}
}
}
const seasonRules = getSeasonRegexes(season);
for (const card of cards) {
let matchesBase = false;
for (const title of card.titles) {
const norm = normalize(title);
if (norm.includes(normalizedBase) || normalizedBase.includes(norm)) {
matchesBase = true;
break;
}
}
if (!matchesBase)
continue;
let seasonMatches = false;
if (season === 1) {
let hasOtherSeason = false;
for (const title of card.titles) {
if (seasonRules.mustNot.some((regex) => regex.test(title))) {
hasOtherSeason = true;
break;
}
}
if (!hasOtherSeason)
seasonMatches = true;
} else {
for (const title of card.titles) {
if (seasonRules.must.some((regex) => regex.test(title))) {
seasonMatches = true;
break;
}
}
}
if (seasonMatches)
return card.slug;
}
return cards[0] ? cards[0].slug : null;
}
function matchMovieCard(cards, targetTitles) {
const normalizedTargets = targetTitles.map(normalize).filter(Boolean);
for (const card of cards) {
for (const title of card.titles) {
const norm = normalize(title);
if (normalizedTargets.some((t) => t === norm))
return card.slug;
}
}
for (const card of cards) {
for (const title of card.titles) {
const norm = normalize(title);
if (normalizedTargets.some((t) => norm.includes(t) || t.includes(norm)))
return card.slug;
}
}
return cards[0] ? cards[0].slug : null;
}
function parseVidstackFromHtml(html, $) {
const vidMatch = html.match(/vidstackPlayer\(JSON\.parse\('((?:[^'\\]|\\.)*)'\)\)/);
if (vidMatch) {
try {
const data = parseXDataJson(vidMatch[1]);
const masterUrl2 = data.src ? data.src.replace(/\\/g, "") : null;
const subtitles2 = (data.subtitles || []).map((s) => ({
url: s.file ? s.file.replace(/\\/g, "") : "",
name: s.title || s.language || "English",
language: s.language || "en"
})).filter((s) => s.url);
if (masterUrl2)
return { masterUrl: masterUrl2, subtitles: subtitles2 };
} catch (e) {
}
}
let masterUrl = $("media-player").attr("src");
if (!masterUrl) {
const urlMatch = html.match(/https:\/\/[^"']+\/master\.m3u8/);
if (urlMatch)
masterUrl = urlMatch[0];
}
const subtitles = [];
$("track").each((i, el) => {
const src = $(el).attr("src");
const kind = $(el).attr("kind");
if (src && (kind === "subtitles" || kind === "captions" || src.endsWith(".ass") || src.endsWith(".vtt"))) {
subtitles.push({
url: src,
name: $(el).attr("label") || "English",
language: $(el).attr("srclang") || "en"
});
}
});
return { masterUrl, subtitles };
}
function parseAudioFormat(btnText) {
const lower = btnText.toLowerCase();
const hasJap = lower.includes("japanese") || lower.includes("jpn") || lower.includes("ja");
const hasEng = lower.includes("english") || lower.includes("eng") || lower.includes("en");
if (hasEng && hasJap)
return "Dual Audio";
if (hasEng)
return "Dub";
if (hasJap)
return "Sub";
if (lower.includes("multi"))
return "Multi-Audio";
return "Sub";
}
function searchCards(query) {
return __async(this, null, function* () {
if (!query)
return [];
const searchUrl = `/anime?search=${encodeURIComponent(query)}&sort=title-asc`;
const searchHtml = yield fetchText(searchUrl);
if (!searchHtml)
return [];
const $search = import_cheerio_without_node_native.default.load(searchHtml);
return parseCards(searchHtml, $search);
});
}
function getStreams(tmdbId, mediaType = "tv", season = 1, episode = 1) {
return __async(this, null, function* () {
var _a, _b, _c;
try {
console.log(`[AniZone] Querying streams for TMDB: ${tmdbId}, Type: ${mediaType}, S${season}E${episode}`);
let animeTitle = "";
let altTitles = [];
let mappedEp = episode;
let seasonName = "";
let targetTitles = [];
if (mediaType === "tv") {
const imdbId = yield getImdbId(tmdbId, "tv");
if (imdbId) {
const mapping = yield resolveMapping(imdbId, season, episode, tmdbId);
if (mapping) {
mappedEp = mapping.mal_episode || episode;
animeTitle = mapping.anime_title || "";
if (mapping.titles && Array.isArray(mapping.titles)) {
targetTitles.push(...mapping.titles);
}
const malTitle = yield getMalTitle(mapping.mal_id);
if (malTitle) {
targetTitles.push(malTitle);
if (!animeTitle)
animeTitle = malTitle;
}
console.log(`[AniZone] AnimeSync mapped: "${animeTitle}", mappedEp=${mappedEp}`);
}
}
if (!animeTitle) {
const tmdbInfo = yield getTmdbInfo(tmdbId, mediaType, season);
if (tmdbInfo) {
animeTitle = tmdbInfo.title;
if (tmdbInfo.originalTitle)
altTitles.push(tmdbInfo.originalTitle);
seasonName = tmdbInfo.seasonName || "";
}
}
} else {
const tmdbInfo = yield getTmdbInfo(tmdbId, "movie");
if (tmdbInfo) {
animeTitle = tmdbInfo.title;
if (tmdbInfo.originalTitle)
altTitles.push(tmdbInfo.originalTitle);
}
mappedEp = 1;
}
if (!animeTitle && targetTitles.length === 0)
return [];
if (!animeTitle && targetTitles.length > 0)
animeTitle = targetTitles[0];
const specificTargetTitles = season === 1 || mediaType === "movie" ? [...targetTitles, animeTitle, ...altTitles] : [...targetTitles];
const baseCleanQuery = animeTitle.split(":")[0].replace(/season.*|\d+nd season|\d+rd season|\d+th season|saison.*/gi, "").trim();
let cards = yield searchCards(baseCleanQuery);
if (cards.length === 0 && animeTitle !== baseCleanQuery) {
cards = yield searchCards(animeTitle.split(":")[0].trim());
}
if (cards.length === 0) {
for (const t of altTitles) {
const altClean = t.split(":")[0].trim();
cards = yield searchCards(altClean);
if (cards.length > 0)
break;
}
}
if (cards.length === 0)
return [];
let animeSlug = null;
if (mediaType === "tv") {
animeSlug = matchCard(cards, specificTargetTitles, baseCleanQuery, season, seasonName);
} else {
animeSlug = matchMovieCard(cards, specificTargetTitles);
}
if (!animeSlug) {
console.log(`[AniZone] No matching slug found for "${animeTitle}"`);
return [];
}
console.log(`[AniZone] Selected slug: "${animeSlug}", mappedEp=${mappedEp}`);
const episodeUrl = `/anime/${animeSlug}/${mappedEp}`;
const epResponse = yield fetchWithCookies(episodeUrl);
if (!epResponse.ok || !epResponse.text) {
console.log(`[AniZone] Failed to load episode page: ${episodeUrl}`);
return [];
}
const epHtml = epResponse.text;
const $ep = import_cheerio_without_node_native.default.load(epHtml);
const streams = [];
const defaultStream = parseVidstackFromHtml(epHtml, $ep);
const serverButtons = $ep('button[wire\\:click*="setVideo"]');
let defaultFormat = "Sub";
let defaultServerName = "AniZone";
if (serverButtons.length > 0) {
const firstBtn = serverButtons.first();
const btnText = firstBtn.text().replace(/\s+/g, " ").trim();
defaultFormat = parseAudioFormat(btnText);
const nameMatch = btnText.match(/^([A-Za-z0-9_-]+)/);
if (nameMatch)
defaultServerName = nameMatch[1];
}
if (defaultStream.masterUrl) {
streams.push({
name: "AniZone",
title: `${animeTitle} - Episode ${mappedEp} [${defaultServerName} - ${defaultFormat}]`,
url: defaultStream.masterUrl,
quality: "Multi",
headers: HEADERS,
subtitles: defaultStream.subtitles
});
}
if (serverButtons.length > 1) {
const csrfToken = $ep("script[data-csrf]").attr("data-csrf");
const snapshotEl = $ep("main > div[wire\\:snapshot], main > ul[wire\\:snapshot], [wire\\:snapshot]");
const snapshot = snapshotEl.attr("wire:snapshot");
if (csrfToken && snapshot && epResponse.cookies) {
for (let i = 1; i < serverButtons.length; i++) {
const btn = serverButtons.eq(i);
const clickAttr = btn.attr("wire:click") || "";
const vMatch = clickAttr.match(/setVideo\((\d+)\)/);
if (!vMatch)
continue;
const videoId = parseInt(vMatch[1], 10);
const btnText = btn.text().replace(/\s+/g, " ").trim();
const sFormat = parseAudioFormat(btnText);
const nameMatch = btnText.match(/^([A-Za-z0-9_-]+)/);
const sName = nameMatch ? nameMatch[1] : `Server ${i + 1}`;
try {
const payload = {
_token: csrfToken,
components: [
{
snapshot,
updates: {},
calls: [{ path: "", method: "setVideo", params: [videoId] }]
}
]
};
const postRes = yield fetchWithTimeout(`${MAIN_URL}/livewire/update`, {
method: "POST",
headers: {
"Accept": "*/*",
"Content-Type": "application/json",
"X-Livewire": "",
"X-CSRF-TOKEN": csrfToken,
"Origin": MAIN_URL,
"Referer": `${MAIN_URL}${episodeUrl}`,
"Cookie": epResponse.cookies
},
body: JSON.stringify(payload)
}, 8e3);
if (postRes.ok) {
const postData = yield postRes.json();
const liveHtml = (_c = (_b = (_a = postData.components) == null ? void 0 : _a[0]) == null ? void 0 : _b.effects) == null ? void 0 : _c.html;
if (liveHtml) {
const $live = import_cheerio_without_node_native.default.load(liveHtml);
const extraStream = parseVidstackFromHtml(liveHtml, $live);
if (extraStream.masterUrl && extraStream.masterUrl !== defaultStream.masterUrl) {
streams.push({
name: "AniZone",
title: `${animeTitle} - Episode ${mappedEp} [${sName} - ${sFormat}]`,
url: extraStream.masterUrl,
quality: "Multi",
headers: HEADERS,
subtitles: extraStream.subtitles.length > 0 ? extraStream.subtitles : defaultStream.subtitles
});
}
}
}
} catch (e) {
}
}
}
}
console.log(`[AniZone] Total streams found: ${streams.length}`);
return streams;
} catch (error) {
console.log(`[AniZone] Error: ${error.message}`);
return [];
}
});
}
module.exports = { getStreams };
+159 -1
View File
@@ -1 +1,159 @@
const _0xf741e1=_0x2887;(function(_0x304ad9,_0x44115a){const _0x3e16ff={_0x32d8aa:0x1de,_0x42cdc4:0x214,_0x861482:0x205,_0xb988b1:0x1d3,_0x2b46cb:0x1f7,_0x1f23a8:0x1fb,_0x3e1e14:0x1ee},_0x34545a=_0x2887,_0x3c5ad8=_0x304ad9();while(!![]){try{const _0x1de960=-parseInt(_0x34545a(_0x3e16ff._0x32d8aa))/0x1+parseInt(_0x34545a(_0x3e16ff._0x42cdc4))/0x2*(parseInt(_0x34545a(0x1cc))/0x3)+-parseInt(_0x34545a(_0x3e16ff._0x861482))/0x4*(parseInt(_0x34545a(_0x3e16ff._0xb988b1))/0x5)+-parseInt(_0x34545a(0x201))/0x6+-parseInt(_0x34545a(_0x3e16ff._0x2b46cb))/0x7*(-parseInt(_0x34545a(_0x3e16ff._0x1f23a8))/0x8)+-parseInt(_0x34545a(_0x3e16ff._0x3e1e14))/0x9*(parseInt(_0x34545a(0x20c))/0xa)+-parseInt(_0x34545a(0x1fe))/0xb;if(_0x1de960===_0x44115a)break;else _0x3c5ad8['push'](_0x3c5ad8['shift']());}catch(_0x1a6883){_0x3c5ad8['push'](_0x3c5ad8['shift']());}}}(_0x3133,0xcdd99));var __async=(_0x2d675e,_0x60c5d2,_0x4d995e)=>{return new Promise((_0x4625d3,_0x318b22)=>{const _0x3ca796=_0x2887;var _0x2208ac=_0x3e7f5a=>{try{_0x4a8699(_0x4d995e['next'](_0x3e7f5a));}catch(_0x548bed){_0x318b22(_0x548bed);}},_0x27dcf1=_0x1e6249=>{try{_0x4a8699(_0x4d995e['throw'](_0x1e6249));}catch(_0x39c42){_0x318b22(_0x39c42);}},_0x4a8699=_0x278d21=>_0x278d21['done']?_0x4625d3(_0x278d21[_0x3ca796(0x216)]):Promise['resolve'](_0x278d21[_0x3ca796(0x216)])[_0x3ca796(0x1d6)](_0x2208ac,_0x27dcf1);_0x4a8699((_0x4d995e=_0x4d995e['apply'](_0x2d675e,_0x60c5d2))['next']());});},cheerio=require(_0xf741e1(0x1f5)),BASE_URL=_0xf741e1(0x1f3),TMDB_API_KEY=_0xf741e1(0x1ca),BROWSER_UA=_0xf741e1(0x20d),HEADERS={'User-Agent':BROWSER_UA,'Referer':BASE_URL+'/'},PLAYBACK_HEADERS={'User-Agent':BROWSER_UA,'Referer':'https://urlshortlink.top/','Origin':'https://urlshortlink.top'};function _0x3133(){const _0x43fded=['mtG2nwy0m2eWntq5y2e1mgqZndfKzdLHyJHImJLMndK','ic0G','m1Lot01mDq','zgL2lNzPzgvVlxrODw1IigLTzW','DxjS','CMvWBgfJzq','nZiWCa','lM0ZDtG','vw5RBM93BIbuAxrSzq','nuvjBLvvCa','zxjYB3i','C3rHCNrZv2L0Aa','DgHLBG','zw5NBgLZAa','zxbPC29Kzv9YDw5FDgLTzq','DgvSDwD1','ihWG4O+X77Ipia','DhjPBq','mta4ma','yxr0CG','odK2nduZvwngAfDt','Ahr0Chm6lY9HCgKUDgHLBw92AwvKyI5VCMCVmY8','w0zPyLDHDgnOxq','Cg9WDxa','8j+oNU+4JYa','vgfTAwW','zMLUza','Dw5KzwzPBMvK','rw5NBgLZAcdIGkiGsgLUzgK','Dg9mB3DLCKnHC2u','4PQRiezPyLDHDgnOihWG','Bwf0y2G','BMfTzq','Bg9Hza','Aw5WDxqJDMLKzw8TAwq','zhvHBa','mtm4mZn6BuH5zhu','ywrK','u2LUz2XLluf1zgLV','ChvZAa','DgL0Bgu','Ahr0Chm6lY9MAwj3yxrJAc5HCNq','ANnVBG','y2HLzxjPBY13AxrOB3v0lw5VzguTBMf0AxzL','BxvSDgK','mta3ody5nZL0v1LNzNq','tI9b','ndGW','Ahr0Ca','ofnysvvZqG','rhvHBc1bDwrPBW','BgvUz3rO','ntqWmJiZmMXOA1rXwG','lM1Wna','DxjSpwH0Dha','mtu2mZiZnhr4zgTSta','zxHWB3j0CW','DgfTAwW','8j+oRca','mtC5odG1nKDSC3Dqyq','jNbHz2vFAwq9mq','qMfUz2XH','Dgv4Da','Aw5JBhvKzxm','vw5RBM93BG','sgLUzgK','nJuWqxzzyLvb','tw96AwXSys81lJaGkeXPBNv4oYbbBMrYB2LKideWoYblksbbChbSzvDLyKTPDc81mZCUmZyGkeTive1mlcbSAwTLieDLy2TVksbdAhjVBwuVmtm3lJaUmc4Wie1VyMLSzsbtywzHCMKVntm3lJm2','l2fQyxGVzxbPC29KzxmUCgHWp3zPzgvVx2LKpq','yMfUz2XH','C29YDa','CxvHBgL0Eq','CNvUDgLTzq','zwfJAa','mJK5otC3nfPNtfP1sq','mJe2ma','DMfSDwu','ndGWCa','mZyW','AhjLzG','ic0GuW'];_0x3133=function(){return _0x43fded;};return _0x3133();}function extractQuality(_0x4af06e){const _0x2a1bf5={_0x1845bf:0x209,_0x287843:0x209,_0x846d66:0x1d0,_0x5618bd:0x1f9,_0x1139ad:0x217,_0x368115:0x218},_0x3d3eb7=_0xf741e1,_0x364bfd=(_0x4af06e||'')[_0x3d3eb7(0x1e7)]();if(_0x364bfd['includes'](_0x3d3eb7(0x215))||_0x364bfd[_0x3d3eb7(_0x2a1bf5._0x1845bf)]('4k'))return'4K';if(_0x364bfd['includes'](_0x3d3eb7(0x1dc)))return'1080p';if(_0x364bfd[_0x3d3eb7(_0x2a1bf5._0x287843)]('720'))return _0x3d3eb7(_0x2a1bf5._0x846d66);if(_0x364bfd[_0x3d3eb7(0x209)](_0x3d3eb7(_0x2a1bf5._0x5618bd)))return _0x3d3eb7(_0x2a1bf5._0x1139ad);if(_0x364bfd['includes'](_0x3d3eb7(_0x2a1bf5._0x368115)))return'360p';return'Unknown';}function parseStreamFromShortenerHtml(_0x472691){const _0x1a0a70={_0x5861aa:0x1eb},_0x17f5a5={_0x2ee33e:0x200},_0x1d6725=_0xf741e1;if(!_0x472691)return null;const _0x30fbd7=cheerio[_0x1d6725(_0x1a0a70._0x5861aa)](_0x472691);let _0x37aa7e=_0x30fbd7('a.hidden-button.buttonDownloadnew')['attr'](_0x1d6725(0x219));!_0x37aa7e&&_0x30fbd7('a')['each']((_0x439235,_0x3862d7)=>{const _0xd3d77c=_0x1d6725,_0x58c50c=_0x30fbd7(_0x3862d7)['attr']('href')||'';if(_0x58c50c[_0xd3d77c(0x209)](_0xd3d77c(_0x17f5a5._0x2ee33e)))return _0x37aa7e=_0x58c50c,![];});if(!_0x37aa7e){const _0x34e4f4=/https?:\/\/[^\s"'`<>]+?\.b-cdn\.net\/[^\s"'`<>]+\.(?:mkv|mp4|m3u8)/i,_0x2d5b16=_0x472691['match'](_0x34e4f4);if(_0x2d5b16)return _0x2d5b16[0x0];}if(_0x37aa7e){let _0x88d123=_0x37aa7e[_0x1d6725(0x1cf)](/.*url=/,'')[_0x1d6725(0x1db)]();return decodeURIComponent(_0x88d123);}return null;}function _0x2887(_0x4265b4,_0x56ac93){_0x4265b4=_0x4265b4-0x1ca;const _0x3133cd=_0x3133();let _0x2887f5=_0x3133cd[_0x4265b4];if(_0x2887['OuoIzx']===undefined){var _0x23b500=function(_0xc211e8){const _0x691c83='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2d675e='',_0x60c5d2='';for(let _0x4d995e=0x0,_0x4Line truncated
const cheerio = require('cheerio-without-node-native');
const DEFAULT_BASE = 'https://fibwatch.art';
const DOMAIN_LIST = 'https://raw.githubusercontent.com/phisher98/TVVVV/refs/heads/main/domains.json';
const TMDB_KEY = '439c478a771f35c05022f9feabcca01c';
const UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
function absolute(base, value) {
if (!value) return '';
try { return new URL(value, base).href; } catch (_) { return value; }
}
function getBase() {
return fetch(DOMAIN_LIST, { headers: { 'User-Agent': UA } })
.then(r => r.ok ? r.json() : {})
.then(data => data.fibwatch || DEFAULT_BASE)
.catch(() => DEFAULT_BASE);
}
function tmdbDetails(id, type) {
return fetch(`https://api.themoviedb.org/3/${type === 'tv' ? 'tv' : 'movie'}/${id}?api_key=${TMDB_KEY}`, { headers: { 'User-Agent': UA } })
.then(r => r.ok ? r.json() : Promise.reject(new Error(`TMDB ${r.status}`)))
.then(data => ({ title: type === 'tv' ? data.name : data.title, year: Number(((type === 'tv' ? data.first_air_date : data.release_date) || '').slice(0, 4)) || null }));
}
function search(base, title) {
const url = `${base}/search?keyword=${encodeURIComponent(title)}&page_id=1`;
return fetch(url, { headers: { 'User-Agent': UA, 'Referer': `${base}/`, 'Cookie': 'pop_up_18=yes' } })
.then(r => r.ok ? r.text() : '')
.then(html => {
const $ = cheerio.load(html);
const results = [];
$('div.video-thumb').each((_, el) => {
const card = $(el);
const a = card.find('a[href]').first();
const img = card.find('img').first();
const name = (card.find('p.hptag').text() || img.attr('alt') || '').trim();
if (a.attr('href') && name) results.push({ url: absolute(base, a.attr('href')), title: name, image: absolute(base, img.attr('src')) });
});
return results;
});
}
function normalize(s) { return (s || '').toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim(); }
function bestMatch(results, title, year) {
const target = normalize(title);
let best = null, bestScore = 0;
for (const item of results) {
const candidate = normalize(item.title);
let score = candidate === target ? 2 : (candidate.includes(target) || target.includes(candidate) ? 1 : 0);
const y = Number((item.title.match(/\b(19|20)\d{2}\b/) || [])[0]);
if (year && y) score += y === year ? 0.3 : -0.2;
if (score > bestScore) { best = item; bestScore = score; }
}
return bestScore >= 1 ? best : null;
}
function findVideoId($) {
return $('#video-id').attr('value') || $('input#video-id').val() || '';
}
function extractPageStreams(base, pageUrl, title) {
return fetch(pageUrl, { headers: { 'User-Agent': UA, 'Referer': `${base}/`, 'Cookie': 'pop_up_18=yes' } })
.then(r => r.ok ? r.text() : '')
.then(html => {
const $ = cheerio.load(html);
const pageTitle = $('meta[property="og:title"]').attr('content') || title;
const videoId = findVideoId($);
if (!videoId) {
const direct = [];
const videoUrl = html.match(/var\s+VIDEO_URL\s*=\s*["']([^"']+)["']/i);
if (videoUrl) direct.push({ name: 'FibWatch', title: pageTitle, url: absolute(base, videoUrl[1]), quality: 'Auto', headers: { Referer: pageUrl } });
return direct;
}
return fetch(`${base}/ajax/resolution_switcher.php?video_id=${encodeURIComponent(videoId)}`, { headers: { 'User-Agent': UA, 'Referer': pageUrl, 'X-Requested-With': 'XMLHttpRequest', 'Cookie': 'pop_up_18=yes' } })
.then(r => r.ok ? r.text() : '')
.then(data => {
const out = [];
const text = typeof data === 'string' ? data : JSON.stringify(data);
const push = (url, label) => {
const absoluteUrl = absolute(base, url);
if (/^https?:/i.test(absoluteUrl) && !out.some(s => s.url === absoluteUrl)) out.push({ name: 'FibWatch', title: label || pageTitle, url: absoluteUrl, quality: (label || absoluteUrl).match(/(2160p|1080p|720p|480p|360p|4k)/i)?.[0] || 'Auto', headers: { Referer: pageUrl } });
};
try {
const json = JSON.parse(text);
const walk = obj => {
if (!obj) return;
if (typeof obj === 'string' && /^(https?:)?\/\//i.test(obj) && /\.(m3u8|mp4|mkv)(\?|$)/i.test(obj)) push(obj);
else if (Array.isArray(obj)) obj.forEach(walk);
else if (typeof obj === 'object') Object.keys(obj).forEach(k => walk(obj[k]));
};
walk(json);
} catch (_) {
const re = /(?:https?:)?\\?\/?\\?["']?([^\s"'<>]+\.(?:m3u8|mp4|mkv)(?:\?[^\s"'<>]*)?)/gi;
let m;
while ((m = re.exec(text))) push(m[1].replace(/\\\//g, '/'));
}
return out;
});
});
}
function episodePage(base, seriesUrl, season, episode) {
return fetch(seriesUrl, { headers: { 'User-Agent': UA, 'Referer': `${base}/`, 'Cookie': 'pop_up_18=yes' } })
.then(r => r.ok ? r.text() : '')
.then(html => {
const $ = cheerio.load(html);
const videoId = findVideoId($);
if (!videoId) return null;
return fetch(`${base}/ajax/episodes.php?video_id=${encodeURIComponent(videoId)}`, {
headers: { 'User-Agent': UA, 'Referer': seriesUrl, 'Cookie': 'pop_up_18=yes', 'X-Requested-With': 'XMLHttpRequest' }
}).then(r => r.ok ? r.text() : '').then(body => {
let data;
try { data = JSON.parse(body); } catch (_) { data = null; }
const items = data && (data.episodes || data.data || data.items);
const episodeText = `s${String(season).padStart(2, '0')}e${String(episode).padStart(2, '0')}`;
if (Array.isArray(items)) {
const found = items.find(item => {
const text = `${item.display || ''} ${item.title || ''}`.toLowerCase();
const match = text.match(/s\s*(\d{1,2})\s*e\s*(\d{1,3})/i);
if (match) return Number(match[1]) === Number(season) && Number(match[2]) === Number(episode);
const seasonMatch = text.match(/\bseason\s*(\d+)\b/i);
const episodeMatch = text.match(/\bepisode\s*(\d+)\b/i);
return Number(seasonMatch && seasonMatch[1]) === Number(season) && Number(episodeMatch && episodeMatch[1]) === Number(episode);
});
if (found && found.url) return absolute(base, found.url);
}
const $episodes = cheerio.load(body);
let href = null;
$episodes('a[href], .video-wrapper a[href]').each((_, el) => {
if (href) return;
const text = `${$episodes(el).text()} ${$episodes(el).attr('title') || ''}`.toLowerCase();
const match = text.match(/s\s*(\d{1,2})\s*e\s*(\d{1,3})/i);
const seasonMatch = text.match(/\bseason\s*(\d+)\b/i);
const episodeMatch = text.match(/\bepisode\s*(\d+)\b/i);
if ((match && Number(match[1]) === Number(season) && Number(match[2]) === Number(episode)) ||
(Number(seasonMatch && seasonMatch[1]) === Number(season) && Number(episodeMatch && episodeMatch[1]) === Number(episode))) href = $episodes(el).attr('href');
});
return href ? absolute(base, href) : null;
});
});
}
function getStreams(tmdbId, mediaType = 'movie', season, episode) {
return Promise.all([getBase(), tmdbDetails(tmdbId, mediaType)])
.then(([base, media]) => search(base, media.title).then(results => ({ base, media, results })))
.then(({ base, media, results }) => {
const match = bestMatch(results, media.title, media.year);
if (!match) return [];
if (mediaType === 'tv' && season != null && episode != null) {
return episodePage(base, match.url, season, episode)
.then(url => url ? extractPageStreams(base, url, `${match.title} S${season}E${episode}`) : []);
}
return extractPageStreams(base, match.url, match.title);
})
.catch(error => { console.error('[FibWatch] Stream lookup failed:', error.message); return []; });
}
module.exports = { getStreams };
+846 -1
View File
@@ -1 +1,846 @@
function _0x1d41(){const _0x4db01a=['zw5J','n1nlz1L4BW','Cg9ZDf90AhvTyM5HAwW','mtK5nZj3s3fituK','Ahr0Chm6lY9UzxCXlMHKAhvInhuUy2W','DgL0Bgu','mtbqEM54yNi','y2HHCKf0','ChvZAa','Ahr0Chm6lY9HCgKUDgHLBw92AwvKyI5VCMCVmW','Ahr0Chm6lY9YyxCUz2L0AhvIDxnLCMnVBNrLBNqUy29Tl3bOAxnOzxi5oc9uvLzwvI9YzwzZl2HLywrZl21HAw4Vzg9TywLUCY5QC29U','yM9KEq','ndm5yZq3oge3nZfMmZvJmduWmJjMowzLywjJy2eWmwm','p2LKpq','CJiUzgv2','zwfJAa','BwvZC2fNzq','zMLUza','zMLYC3rFywLYx2rHDgu','DxjS','CgL4zwXKCMe','w0HeshvInhvDifrnreiGsw5MBZOGiG','C3rHDhvZvgv4Da','qNL0zxm','mZC5oduXB1z0Bwvf','i2rVD25SB2fK','ieHIBgLUA3m','Dgv4Da','lNPPCa','ttnvoa','seriDwi0Dsa','w0HeshvInhvDiezLDgnOAw5Nihn0CMvHBxmGzM9YifrnreiGsuq6ia','jMfWCgvUzf90B19YzxnWB25Zzt1LEhrLCM5HBf9Pzhm','ywXS','vw5RBM93BG','qvzd','ChjVDg9JB2W','AduGysWGAdqGysWGAdmGyq','sgv4','CgvYBwfSAw5R','C3rHCNrZv2L0Aa','C3bSAxq','q0fn','AM9PBG','BM93','mtu2odaWmdDdugDQq3e','AgrZDhjLyw00Dq','v0vcuKLq','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','C291CMnL','zMLSzu5HBwu','mZu3mJGZmgz6u1nLqG','Aw1KyL9Pza','Ahr0Chm6lY9ZzwfYy2GUCgLUz29Yys5MEwKVy29SBgvJDgLVBNmVCg9ZDc9KB2n1BwvUDhmVC2vHCMnOp3e9','BwfNBMv0oG','DMfSDwu','Ahr0Ca','EMLWzgLZAW','y3j5ChrVAw5ZAwDODhmUC2L0zq','z2v0','AgfZ','AgfZt3DUuhjVCgvYDhK','sdi2nq','BMv4Da','EwvHCG','w0HeshvInhvDiejLC3qGDgL0BguGBwf0y2G6ici','nZiWCa','iIaO','nJyWmdy0ogLmC0r3vG','p2rVD25SB2fK','lNbHz2uTyM9KEsa+igrPDIbH','u3rYzwfTvgfWzq','sfGTuMvKAxjLy3q','DhjPBq','BwfW','v0vclurm','re9mqLLwsvnjt04','wMLWrgLZAYbtzxj2zxi','shvIq2XVDwqGlsbgu0W','zMXHDa','AhvIy2XVDwqUy3G','w0HeshvInhvDiezHAwXLzcb0BYbMzxrJAcbSyxrLC3qGzg9TywLUCZOG','mdeYmZq1nJC4owfIy2rLzG','C3vIC3rYAw5N','y2HLzxjPBY13AxrOB3v0lw5VzguTBMf0AxzL','DgHYB3C','BgLUAZ0','A2LLBxrPzw5TDwe5mtfJyq','qufd','Cg9ZDf90AxrSzq','shvIq2rU','ChjVCgvYDhLjC0vUDw1LCMfIBgu','BNvTyMvY','ywrK','zNjVBunOyxjdB2rL','ihrVia','serivui0Dq','CxvHBgL0Eq','q0jd','shvIq2XVDwqGlsaXmeDIChmG','CMvWBgfJzq','Dg9mB3DLCKnHC2u','EgXHpxm0Da','qujdrevgr0HjsKTmtu5puffsu1rvvLDywvPHyMnKzwzNAgLQA2XTBM9WCxjZDhv2D3H5EJaXmJm0nty3odKRlZ0','mtu4mda0nhn6yMLUra','x19LC01VzhvSzq','Bwf0y2G','AgL0CW','sgjmAw5RCW','Cg9W','l2rVD25SB2fK','CgfYC2u','zxbPC29Kzq','C29Tzq','Bg9N','z2v0t3DUuhjVCgvYDhLtEw1IB2XZ','BgfZDeLUzgv4t2y','mJiZnJq1oeHyBwv5BW','zgvMAw5LuhjVCgvYDhK','CMvZB2X2zq','zNvUy3rPB24','C2v0','zgvMyxvSDa','rgLYzwn0ifiY','z2v0t3DUuhjVCgvYDhLoyw1LCW','ChjVDg90ExbL','uMvMzxjLCG','C3rHDhvZ','AhGTCMvKAxjLy3q','Aw5JBhvKzxm','AdeUCgfNzs10AxrSzsbZCgfU','CMv1CMW','AsnZAxPL','qLjssva','CZmGC2vYDMvY','w0HeshvInhvDifnLBgvJDgvKoIaI','y2fSBa','ifnLyxnVBIa','mta4mha','yMXVz191CMW','iIaOC2nVCMu6ia','AhvIy2XVDwqUAw5R','mtiZndu2nZG5mg9PDxL0CG','AhrTBa','C3rYAw5N','CMvSzwfZzv9KyxrL','C2L6zq','DgvJAhLIB3K0Dq','l2fWAs92ms92AwrLBZ9Pzd0','C2vHC29Uia','C3rYzwfTDgfWzs5JB20','zw51BwvYywjSzq','lcbuExbLoIa','yxr0CG','shvIq2XVDwq','BgvUz3rO','AhjLzG','vxrMoa','zgvMAw5LuhjVCgvYDgLLCW','tw96AwXSys81lJaGkfDPBMrVD3mGtLqGmtaUmdSGv2LUnJq7ihG2ncKGqxbWBgvxzwjlAxqVntm3lJm2','zNnSDJi','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9YCW','zNnSihnLCNzLCG','zxHWB3j0CW','Bw92Awu','AdmGysWGAdqGyq','zgf0yq','z2fKz2v0C3DLyI54ExO','tw96AwXSys81lJa','Dg9tDhjPBMC','ugL4zwXKCMfPBG','Ag9ZDg5HBwu','AhvIy2rU','AgrODwi0Dq','sdi2na','BwfUDwfS','Dg9vChbLCKnHC2u','rfrt','BMfTzq','zMLSDgvY','zxHLyW','wMLWrgLZAYbtzxj2zxiG','sgrtDhjLyw00Dq','Bg9Hza','B2jQzwn0','p2fWAv9RzxK9','r0vu','AgvHzgvYCW','neTsywD4ua','zxH0zxjUywXFAwrZ','Cg93','CgfKu3rHCNq','shvIC3rYzwfT','Bg9JyxrPB24','zMLUywXmAw5RCW'];_0x1d41=function(){return _0x4db01a;};return _0x1d41();}const _0x4cfe8c=_0x1850;(function(_0x4bd1e8,_0x326e94){const _0x3f3482={_0x2ebcc9:0xb1,_0x1082ec:0xe1,_0x1f3a99:0xaf,_0xdb40a:0xb4},_0x432f61=_0x1850,_0x252534=_0x4bd1e8();while(!![]){try{const _0x7c34e9=-parseInt(_0x432f61(_0x3f3482._0x2ebcc9))/0x1+-parseInt(_0x432f61(0x116))/0x2+parseInt(_0x432f61(0xc6))/0x3+parseInt(_0x432f61(0x16a))/0x4*(parseInt(_0x432f61(_0x3f3482._0x1082ec))/0x5)+-parseInt(_0x432f61(0x123))/0x6*(parseInt(_0x432f61(_0x3f3482._0x1f3a99))/0x7)+-parseInt(_0x432f61(0xf2))/0x8+parseInt(_0x432f61(0xdb))/0x9*(parseInt(_0x432f61(_0x3f3482._0xdb40a))/0xa);if(_0x7c34e9===_0x326e94)break;else _0x252534['push'](_0x252534['shift']());}catch(_0x3cc61a){_0x252534['push'](_0x252534['shift']());}}}(_0x1d41,0x8c864));var __create=Object['create'],__defProp=Object[_0x4cfe8c(0x124)],__defProps=Object[_0x4cfe8c(0x14c)],__getOwnPropDesc=Object[_0x4cfe8c(0xde)],__getOwnPropDescs=Object[_0x4cfe8c(0x14f)],__getOwnPropNames=Object[_0x4cfe8c(0x12a)],__getOwnPropSymbols=Object[_0x4cfe8c(0x121)],__getProtoOf=Object['getPrototypeOf'],__hasOwnProp=Object['prototype'][_0x4cfe8c(0xeb)],__propIsEnum=Object[_0x4cfe8c(0x12b)][_0x4cfe8c(0x109)],__defNormalProp=(_0x88bbc8,_0x59e2f6,_0x38ec05)=>_0x59e2f6 in _0x88bbc8?__defProp(_0x88bbc8,_0x59e2f6,{'enumerable':!![],'configurable':!![],'writable':!![],'value':_0x38ec05}):_0x88bbc8[_0x59e2f6]=_0x38ec05,__spreadValues=(_0x586ac9,_0x243eff)=>{const _0x3d2fc4=_0x4cfe8c;for(var _0x4d4ed6 in _0x243eff||(_0x243eff={}))if(__hasOwnProp['call'](_0x243eff,_0x4d4ed6))__defNormalProp(_0x586ac9,_0x4d4ed6Line truncated
/**
* hdhub4u - Built from src/hdhub4u/
* Generated: 2026-10-02T12:34:10.590Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/hdhub4u/index.js
var import_cheerio_without_node_native2 = __toESM(require("cheerio-without-node-native"));
// src/hdhub4u/constants.js
var TMDB_API_KEY = "439c478a771f35c05022f9feabcca01c";
var TMDB_BASE_URL = "https://api.themoviedb.org/3";
var MAIN_URL = "https://new6.hdhub4u.cl";
var DOMAINS_URL = "https://raw.githubusercontent.com/phisher98/TVVVV/refs/heads/main/domains.json";
var DOMAIN_CACHE_TTL = 4 * 60 * 60 * 1e3;
var HEADERS = {
"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",
"Cookie": "xla=s4t",
"Referer": `${MAIN_URL}/`
};
function updateMainUrl(url) {
MAIN_URL = url;
HEADERS.Referer = `${url}/`;
}
// src/hdhub4u/utils.js
var domainCacheTimestamp = 0;
function formatBytes(bytes) {
if (!bytes || bytes === 0)
return "Unknown";
const k = 1024;
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
}
function extractServerName(source) {
if (!source)
return "Unknown";
if (source.startsWith("HubCloud")) {
const serverMatch = source.match(/HubCloud(?:\s*-\s*([^[\]]+))?/);
return serverMatch ? serverMatch[1] || "Download" : "HubCloud";
}
if (source.startsWith("Pixeldrain"))
return "Pixeldrain";
if (source.startsWith("StreamTape"))
return "StreamTape";
if (source.startsWith("HubCdn"))
return "HubCdn";
if (source.startsWith("HbLinks"))
return "HbLinks";
if (source.startsWith("Hubstream"))
return "Hubstream";
return source.replace(/^www\./, "").split(".")[0];
}
function rot13(value) {
return value.replace(/[a-zA-Z]/g, function(c) {
return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
});
}
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function atob(value) {
if (!value)
return "";
let input = String(value).replace(/=+$/, "");
let output = "";
let bc = 0, bs, buffer, idx = 0;
while (buffer = input.charAt(idx++)) {
buffer = BASE64_CHARS.indexOf(buffer);
if (~buffer) {
bs = bc % 4 ? bs * 64 + buffer : buffer;
if (bc++ % 4) {
output += String.fromCharCode(255 & bs >> (-2 * bc & 6));
}
}
}
return output;
}
function cleanTitle(title) {
let name = title.replace(/\.[a-zA-Z0-9]{2,4}$/, "");
const normalized = name.replace(/WEB[-_. ]?DL/gi, "WEB-DL").replace(/WEB[-_. ]?RIP/gi, "WEBRIP").replace(/H[ .]?265/gi, "H265").replace(/H[ .]?264/gi, "H264").replace(/DDP[ .]?([0-9]\.[0-9])/gi, "DDP$1");
const parts = normalized.split(/[\s_.]/);
const sourceTags = /* @__PURE__ */ new Set(["WEB-DL", "WEBRIP", "BLURAY", "HDRIP", "DVDRIP", "HDTV", "CAM", "TS", "BRRIP", "BDRIP"]);
const codecTags = /* @__PURE__ */ new Set(["H264", "H265", "X264", "X265", "HEVC", "AVC"]);
const audioTags = ["AAC", "AC3", "DTS", "MP3", "FLAC", "DD", "DDP", "EAC3"];
const audioExtras = /* @__PURE__ */ new Set(["ATMOS"]);
const hdrTags = /* @__PURE__ */ new Set(["SDR", "HDR", "HDR10", "HDR10+", "DV", "DOLBYVISION"]);
const filtered = parts.map((part) => {
const p = part.toUpperCase();
if (sourceTags.has(p))
return p;
if (codecTags.has(p))
return p;
if (audioTags.some((tag) => p.startsWith(tag)))
return p;
if (audioExtras.has(p))
return p;
if (hdrTags.has(p))
return p === "DOLBYVISION" || p === "DV" ? "DOLBYVISION" : p;
if (p === "NF" || p === "CR")
return p;
return null;
}).filter(Boolean);
return [...new Set(filtered)].join(" ");
}
function fetchAndUpdateDomain() {
return __async(this, null, function* () {
const now = Date.now();
if (now - domainCacheTimestamp < DOMAIN_CACHE_TTL)
return;
console.log("[HDHub4u] Fetching latest domain...");
try {
const response = yield fetch(DOMAINS_URL, {
method: "GET",
headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" }
});
if (response.ok) {
const data = yield response.json();
if (data && data.HDHUB4u) {
const newDomain = data.HDHUB4u;
if (newDomain !== MAIN_URL) {
console.log(`[HDHub4u] Updating domain from ${MAIN_URL} to ${newDomain}`);
updateMainUrl(newDomain);
domainCacheTimestamp = now;
}
}
}
} catch (error) {
console.error(`[HDHub4u] Failed to fetch latest domains: ${error.message}`);
}
});
}
function getCurrentDomain() {
return __async(this, null, function* () {
yield fetchAndUpdateDomain();
return MAIN_URL;
});
}
function normalizeTitle(title) {
if (!title)
return "";
return title.toLowerCase().replace(/\b(the|a|an)\b/g, "").replace(/[:\-_]/g, " ").replace(/\s+/g, " ").replace(/[^\w\s]/g, "").trim();
}
function calculateTitleSimilarity(title1, title2) {
const norm1 = normalizeTitle(title1);
const norm2 = normalizeTitle(title2);
if (norm1 === norm2)
return 1;
const words1 = norm1.split(/\s+/).filter((w) => w.length > 0);
const words2 = norm2.split(/\s+/).filter((w) => w.length > 0);
if (words1.length === 0 || words2.length === 0)
return 0;
const set1 = new Set(words1);
const set2 = new Set(words2);
const intersection = words1.filter((w) => set2.has(w));
const union = /* @__PURE__ */ new Set([...words1, ...words2]);
const jaccard = intersection.length / union.size;
const extraWordsCount = words2.filter((w) => !set1.has(w)).length;
let score = jaccard - extraWordsCount * 0.05;
if (words1.length > 0 && words1.every((w) => set2.has(w))) {
score += 0.2;
}
return score;
}
function findBestTitleMatch(mediaInfo, searchResults, mediaType, season) {
if (!searchResults || searchResults.length === 0)
return null;
let bestMatch = null;
let bestScore = 0;
for (const result of searchResults) {
let score = calculateTitleSimilarity(mediaInfo.title, result.title);
if (mediaInfo.year && result.year) {
const yearDiff = Math.abs(mediaInfo.year - result.year);
if (yearDiff === 0)
score += 0.2;
else if (yearDiff <= 1)
score += 0.1;
else if (yearDiff > 5)
score -= 0.3;
}
if (mediaType === "tv" && season) {
const titleLower = result.title.toLowerCase();
const seasonPatterns = [
`season ${season}`,
`s${season}`,
`season ${season.toString().padStart(2, "0")}`,
`s${season.toString().padStart(2, "0")}`
];
const hasSeason = seasonPatterns.some((p) => titleLower.includes(p));
const otherSeasonMatch = titleLower.match(/season\s*(\d+)|s(\d+)/i);
if (otherSeasonMatch) {
const foundSeason = parseInt(otherSeasonMatch[1] || otherSeasonMatch[2]);
if (foundSeason !== season) {
score -= 0.8;
}
}
if (hasSeason)
score += 0.5;
else
score -= 0.3;
}
if (result.title.toLowerCase().includes("2160p") || result.title.toLowerCase().includes("4k")) {
score += 0.05;
}
if (score > bestScore && score > 0.3) {
bestScore = score;
bestMatch = result;
}
}
if (bestMatch)
console.log(`[HDHub4u] Best title match: "${bestMatch.title}" (score: ${bestScore.toFixed(2)})`);
return bestMatch;
}
function getTMDBDetails(tmdbId, mediaType) {
return __async(this, null, function* () {
var _a;
const endpoint = mediaType === "tv" ? "tv" : "movie";
const url = `${TMDB_BASE_URL}/${endpoint}/${tmdbId}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
const response = yield fetch(url, {
method: "GET",
headers: { "Accept": "application/json", "User-Agent": "Mozilla/5.0" }
});
if (!response.ok)
throw new Error(`TMDB API error: ${response.status}`);
const data = yield response.json();
const title = mediaType === "tv" ? data.name : data.title;
const releaseDate = mediaType === "tv" ? data.first_air_date : data.release_date;
const year = releaseDate ? parseInt(releaseDate.split("-")[0]) : null;
return { title, year, imdbId: ((_a = data.external_ids) == null ? void 0 : _a.imdb_id) || null };
});
}
// src/hdhub4u/extractors.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
var import_crypto_js = __toESM(require("crypto-js"));
function getRedirectLinks(url) {
return __async(this, null, function* () {
try {
const response = yield fetch(url, { headers: HEADERS });
if (!response.ok)
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
const doc = yield response.text();
const regex = /s\s*\(\s*['"]o['"]\s*,\s*['"]([A-Za-z0-9+/=]+)['"]|ck\s*\(\s*['"]_wp_http_\d+['"]\s*,\s*['"]([^'"]+)['"]/g;
let combinedString = "";
let match;
while ((match = regex.exec(doc)) !== null) {
const extractedValue = match[1] || match[2];
if (extractedValue)
combinedString += extractedValue;
}
if (!combinedString) {
const redirectMatch = doc.match(/window\.location\.href\s*=\s*['"]([^'"]+)['"]/);
if (redirectMatch && redirectMatch[1]) {
const newUrl = redirectMatch[1];
if (newUrl !== url && !newUrl.includes(url)) {
return yield getRedirectLinks(newUrl);
}
}
return null;
}
const decodedString = atob(rot13(atob(atob(combinedString))));
const jsonObject = JSON.parse(decodedString);
const encodedUrl = atob(jsonObject.o || "").trim();
if (encodedUrl)
return encodedUrl;
const data = atob(jsonObject.data || "").trim();
const wpHttp = (jsonObject.blog_url || "").trim();
if (wpHttp && data) {
const directLinkResponse = yield fetch(`${wpHttp}?re=${data}`, { headers: HEADERS });
const html = yield directLinkResponse.text();
const $ = import_cheerio_without_node_native.default.load(html);
return ($("body").text() || html).trim();
}
return null;
} catch (e) {
return null;
}
});
}
function vidStackExtractor(url) {
return __async(this, null, function* () {
var _a, _b, _c;
try {
const hash = url.split("#").pop().split("/").pop();
const baseUrl = new URL(url).origin;
const apiUrl = `${baseUrl}/api/v1/video?id=${hash}`;
const response = yield fetch(apiUrl, { headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: url }) });
const encoded = (yield response.text()).trim();
const key = import_crypto_js.default.enc.Utf8.parse("kiemtienmua911ca");
const ivs = ["1234567890oiuytr", "0123456789abcdef"];
for (const ivStr of ivs) {
try {
const iv = import_crypto_js.default.enc.Utf8.parse(ivStr);
const decrypted = import_crypto_js.default.AES.decrypt(
{ ciphertext: import_crypto_js.default.enc.Hex.parse(encoded) },
key,
{ iv, mode: import_crypto_js.default.mode.CBC, padding: import_crypto_js.default.pad.Pkcs7 }
);
const decryptedText = decrypted.toString(import_crypto_js.default.enc.Utf8);
if (decryptedText && decryptedText.includes("source")) {
const m3u8 = (_b = (_a = decryptedText.match(/"source":"(.*?)"/)) == null ? void 0 : _a[1]) == null ? void 0 : _b.replace(/\\/g, "");
const subtitles = [];
const subtitleSection = (_c = decryptedText.match(/"subtitle":\{(.*?)\}/)) == null ? void 0 : _c[1];
if (subtitleSection) {
const subtitlePattern = /"([^"]+)":\s*"([^"]+)"/g;
let subMatch;
while ((subMatch = subtitlePattern.exec(subtitleSection)) !== null) {
const lang = subMatch[1];
const subPath = subMatch[2].split("#")[0].replace(/\\/g, "");
if (subPath) {
subtitles.push({
language: lang,
url: subPath.startsWith("http") ? subPath : `${baseUrl}${subPath}`
});
}
}
}
if (m3u8) {
return [{
source: "Vidstack Hubstream",
quality: "M3U8",
url: m3u8.replace("https:", "http:"),
headers: {
"Referer": url,
"Origin": url.split("/").pop()
},
subtitles
}];
}
}
} catch (e) {
}
}
return [];
} catch (e) {
return [];
}
});
}
function hbLinksExtractor(url) {
return __async(this, null, function* () {
try {
const response = yield fetch(url, { headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: url }) });
const data = yield response.text();
const $ = import_cheerio_without_node_native.default.load(data);
const links = [...new Set($("h3 a, h5 a, div.entry-content p a, div.entry-content a").map((i, el) => $(el).attr("href")).get().filter(Boolean))];
const results = yield Promise.all(links.map((l) => loadExtractor(l, url)));
return results.flat().map((link) => __spreadProps(__spreadValues({}, link), {
source: `${link.source} Hblinks`
}));
} catch (e) {
return [];
}
});
}
function pixelDrainExtractor(link) {
return __async(this, null, function* () {
var _a;
try {
const urlObj = new URL(link);
const baseUrl = `${urlObj.protocol}//${urlObj.hostname}`;
const fileId = ((_a = link.match(/(?:file|u)\/([A-Za-z0-9]+)/)) == null ? void 0 : _a[1]) || link.split("/").pop();
if (!fileId)
return [{ source: "Pixeldrain", quality: 0, url: link }];
const finalUrl = link.includes("?download") ? link : `${baseUrl}/api/file/${fileId}?download`;
return [{ source: "Pixeldrain", quality: 0, url: finalUrl }];
} catch (e) {
return [{ source: "Pixeldrain", quality: 0, url: link }];
}
});
}
function streamTapeExtractor(link) {
return __async(this, null, function* () {
var _a, _b, _c, _d;
try {
const url = new URL(link);
url.hostname = "streamtape.com";
const res = yield fetch(url.toString(), { headers: HEADERS });
const data = yield res.text();
let videoSrc = (_c = (_b = (_a = data.match(/document\.getElementById\('videolink'\)\.innerHTML = (.*?);/)) == null ? void 0 : _a[1]) == null ? void 0 : _b.match(/'(\/\/streamtape\.com\/get_video[^']+)'/)) == null ? void 0 : _c[1];
if (!videoSrc) {
videoSrc = (_d = data.match(/'(\/\/streamtape\.com\/get_video[^']+)'/)) == null ? void 0 : _d[1];
}
return videoSrc ? [{ source: "StreamTape", quality: 720, url: "https:" + videoSrc }] : [];
} catch (e) {
return [];
}
});
}
function hubCloudExtractor(url, referer) {
return __async(this, null, function* () {
var _a;
try {
let currentUrl = url.replace("hubcloud.ink", "hubcloud.dad");
const pageResponse = yield fetch(currentUrl, { headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: referer }) });
let pageData = yield pageResponse.text();
let finalUrl = currentUrl;
if (!currentUrl.includes("hubcloud.php")) {
let nextHref = "";
const $first = import_cheerio_without_node_native.default.load(pageData);
const downloadBtn = $first("#download");
if (downloadBtn.length) {
nextHref = downloadBtn.attr("href");
} else {
const scriptUrlMatch = pageData.match(/var url = '([^']*)'/);
if (scriptUrlMatch)
nextHref = scriptUrlMatch[1];
}
if (nextHref) {
if (!nextHref.startsWith("http")) {
const urlObj = new URL(currentUrl);
nextHref = `${urlObj.protocol}//${urlObj.hostname}/${nextHref.replace(/^\//, "")}`;
}
finalUrl = nextHref;
const secondResponse = yield fetch(finalUrl, { headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: currentUrl }) });
pageData = yield secondResponse.text();
}
}
const $ = import_cheerio_without_node_native.default.load(pageData);
const size = $("i#size").text().trim();
const header = $("div.card-header").text().trim();
const qualityStr = (_a = header.match(/(\d{3,4})[pP]/)) == null ? void 0 : _a[1];
const quality = qualityStr ? parseInt(qualityStr) : 1080;
const headerDetails = cleanTitle(header);
const labelExtras = (headerDetails ? `[${headerDetails}]` : "") + (size ? `[${size}]` : "");
const sizeInBytes = (() => {
const sizeMatch = size.match(/([\d.]+)\s*(GB|MB|KB)/i);
if (!sizeMatch)
return 0;
const multipliers = { GB: 1024 ** 3, MB: 1024 ** 2, KB: 1024 };
return parseFloat(sizeMatch[1]) * (multipliers[sizeMatch[2].toUpperCase()] || 0);
})();
const links = [];
const elements = $("a.btn").get();
for (const element of elements) {
const link = $(element).attr("href");
const text = $(element).text().toLowerCase();
const fileName = header || headerDetails || "Unknown";
if (text.includes("download file") || text.includes("fsl server") || text.includes("s3 server") || text.includes("fslv2") || text.includes("mega server") || link && link.includes("r2.dev")) {
let label = "HubCloud";
if (link && link.includes("r2.dev"))
label = "Direct R2";
else if (link && link.includes("workers.dev"))
label = "ZipDisk Server";
else if (text.includes("fsl server"))
label = "HubCloud - FSL";
else if (text.includes("s3 server"))
label = "HubCloud - S3";
else if (text.includes("fslv2"))
label = "HubCloud - FSLv2";
else if (text.includes("mega server"))
label = "HubCloud - Mega";
links.push({ source: `${label} ${labelExtras}`, quality, url: link, size: sizeInBytes, fileName });
} else if (text.includes("buzzserver")) {
try {
const buzzResp = yield fetch(`${link}/download`, { method: "GET", headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: link }), redirect: "manual" });
let dlink = buzzResp.headers.get("hx-redirect") || buzzResp.headers.get("HX-Redirect");
if (!dlink && buzzResp.url && buzzResp.url !== `${link}/download`) {
dlink = buzzResp.url;
}
if (dlink) {
links.push({ source: `HubCloud - BuzzServer ${labelExtras}`, quality, url: dlink, size: sizeInBytes, fileName });
}
} catch (e) {
}
} else if (text.includes("10gbps") || link && link.includes("hubcloud.cx")) {
let targetUrl = link;
if (link && !link.includes("hubcloud.cx")) {
try {
const resp = yield fetch(link, { method: "GET", redirect: "manual" });
const loc = resp.headers.get("location");
if (loc && loc.includes("link=")) {
targetUrl = loc.substring(loc.indexOf("link=") + 5);
}
} catch (e) {
}
}
links.push({ source: `HubCloud - 10Gbps ${labelExtras}`, quality, url: targetUrl, size: sizeInBytes, fileName });
} else if (text.includes("zipdisk") || link && link.includes("workers.dev")) {
links.push({ source: `ZipDisk Server ${labelExtras}`, quality, url: link, size: sizeInBytes, fileName });
} else if (link && link.includes("pixeldra")) {
const results = yield pixelDrainExtractor(link);
links.push(...results.map((l) => __spreadProps(__spreadValues({}, l), { source: `${l.source} ${labelExtras}`, size: sizeInBytes, fileName })));
} else if (link && !link.includes("magnet:") && link.startsWith("http")) {
const extracted = yield loadExtractor(link, finalUrl);
links.push(...extracted.map((l) => __spreadProps(__spreadValues({}, l), { quality: l.quality || quality })));
}
}
return links;
} catch (e) {
return [];
}
});
}
function hubCdnExtractor(url, referer) {
return __async(this, null, function* () {
try {
const response = yield fetch(url, { headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: referer }) });
const data = yield response.text();
const $ = import_cheerio_without_node_native.default.load(data);
let scriptContent = "";
$("script").each((i, el) => {
const html = $(el).html();
if (html && html.includes("reurl")) {
scriptContent = html;
}
});
if (scriptContent) {
const match = scriptContent.match(/reurl\s*=\s*["']([^"']+)["']/);
if (match && match[1]) {
const reurlVal = match[1];
if (reurlVal.includes("?r=")) {
const queryPart = reurlVal.split("?r=").pop();
try {
const decoded = atob(queryPart);
const m3u8Link = decoded.substring(decoded.lastIndexOf("link=") + 5);
if (m3u8Link && m3u8Link.startsWith("http")) {
return [{ source: "HubCdn", quality: 1080, url: m3u8Link }];
}
} catch (e) {
}
} else if (reurlVal.includes("link=")) {
const m3u8Link = reurlVal.split("link=").pop();
if (m3u8Link && m3u8Link.startsWith("http")) {
return [{ source: "HubCdn", quality: 1080, url: m3u8Link }];
}
} else if (reurlVal.startsWith("http")) {
return [{ source: "HubCdn", quality: 1080, url: reurlVal }];
}
}
}
const encodedMatch = data.match(/r=([A-Za-z0-9+/=]+)/);
if (encodedMatch && encodedMatch[1]) {
try {
const decoded = atob(encodedMatch[1]);
const m3u8Link = decoded.substring(decoded.lastIndexOf("link=") + 5);
if (m3u8Link && m3u8Link.startsWith("http")) {
return [{ source: "HubCdn", quality: 1080, url: m3u8Link }];
}
} catch (e) {
}
}
return [];
} catch (e) {
return [];
}
});
}
function loadExtractor(_0) {
return __async(this, arguments, function* (url, referer = MAIN_URL) {
try {
const hostname = new URL(url).hostname;
const isRedirect = url.includes("?id=") || hostname.includes("techyboy4u") || hostname.includes("gadgetsweb.xyz") || hostname.includes("cryptoinsights.site") || hostname.includes("bloggingvector") || hostname.includes("ampproject.org");
if (isRedirect) {
const finalLink = yield getRedirectLinks(url);
if (finalLink && finalLink !== url)
return yield loadExtractor(finalLink, url);
return [];
}
if (hostname.includes("hubcloud"))
return yield hubCloudExtractor(url, referer);
if (hostname.includes("hubcdn"))
return yield hubCdnExtractor(url, referer);
if (hostname.includes("hblinks") || hostname.includes("hubstream.dad"))
return yield hbLinksExtractor(url);
if (hostname.includes("hubstream") || hostname.includes("vidstack"))
return yield vidStackExtractor(url);
if (hostname.includes("pixeldrain"))
return yield pixelDrainExtractor(url);
if (hostname.includes("streamtape"))
return yield streamTapeExtractor(url);
if (hostname.includes("hdstream4u"))
return [{ source: "HdStream4u", quality: 1080, url }];
if (hostname.includes("hubdrive")) {
const res = yield fetch(url, { headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: referer }) });
const data = yield res.text();
const href = import_cheerio_without_node_native.default.load(data)(".btn.btn-primary.btn-user.btn-success1.m-1").attr("href");
if (href)
return yield loadExtractor(href, url);
}
return [];
} catch (e) {
return [];
}
});
}
// src/hdhub4u/index.js
function search(query) {
return __async(this, null, function* () {
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
const searchUrl = `https://search.hdhub4u.glass/collections/post/documents/search?q=${encodeURIComponent(query)}&query_by=post_title,category&query_by_weights=4,2&sort_by=sort_by_date:desc&limit=15&highlight_fields=none&use_cache=true&page=1&analytics_tag=${today}`;
const response = yield fetch(searchUrl, { headers: HEADERS });
const data = yield response.json();
if (!data || !data.hits)
return [];
return data.hits.map((hit) => {
const doc = hit.document;
const title = doc.post_title;
const yearMatch = title.match(/\((\d{4})\)|\b(\d{4})\b/);
const year = yearMatch ? parseInt(yearMatch[1] || yearMatch[2]) : null;
let url = doc.permalink;
if (url && url.startsWith("/")) {
url = `${MAIN_URL}${url}`;
}
return {
title,
url,
poster: doc.post_thumbnail,
year
};
});
});
}
function getDownloadLinks(mediaUrl) {
return __async(this, null, function* () {
const domain = yield getCurrentDomain();
if (mediaUrl.includes("hdhub4u.")) {
try {
const urlObj = new URL(mediaUrl);
const domainObj = new URL(domain);
urlObj.hostname = domainObj.hostname;
mediaUrl = urlObj.toString();
} catch (e) {
}
}
const response = yield fetch(mediaUrl, { headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: `${domain}/` }) });
const data = yield response.text();
const $ = import_cheerio_without_node_native2.default.load(data);
const typeRaw = $("h1.page-title span").text();
const isMovie = typeRaw.toLowerCase().includes("movie");
if (isMovie) {
const qualityLinks = $("h3 a, h4 a").filter((i, el) => $(el).text().match(/480|720|1080|2160|4K/i));
const bodyLinks = $(".page-body > div a").filter((i, el) => {
const href = $(el).attr("href");
return href && (href.includes("hdstream4u") || href.includes("hubstream"));
});
const initialLinks = [.../* @__PURE__ */ new Set([
...qualityLinks.map((i, el) => $(el).attr("href")).get(),
...bodyLinks.map((i, el) => $(el).attr("href")).get()
])];
const results = yield Promise.all(initialLinks.map((url) => loadExtractor(url, mediaUrl)));
const allFinalLinks = results.flat();
const seenUrls = /* @__PURE__ */ new Set();
const uniqueFinalLinks = allFinalLinks.filter((link) => {
var _a;
if (!link.url || link.url.includes(".zip") || ((_a = link.name) == null ? void 0 : _a.toLowerCase().includes(".zip")))
return false;
if (seenUrls.has(link.url))
return false;
seenUrls.add(link.url);
return true;
});
return { finalLinks: uniqueFinalLinks, isMovie };
} else {
const episodeLinksMap = /* @__PURE__ */ new Map();
const directLinkBlocks = [];
$("h3, h4").each((i, element) => {
const $el = $(element);
const text = $el.text();
const anchors = $el.find("a");
const links = anchors.map((i2, a) => $(a).attr("href")).get();
const isDirectLinkBlock = anchors.get().some((a) => $(a).text().match(/1080|720|4K|2160/i));
if (isDirectLinkBlock) {
directLinkBlocks.push(...links);
return;
}
const episodeMatch = text.match(/(?:EPiSODE\s*(\d+)|E(\d+))/i);
if (episodeMatch) {
const epNum = parseInt(episodeMatch[1] || episodeMatch[2]);
if (!episodeLinksMap.has(epNum))
episodeLinksMap.set(epNum, []);
episodeLinksMap.get(epNum).push(...links);
let nextElement = $el.next();
while (nextElement.length && nextElement.get(0).tagName !== "hr") {
const siblingLinks = nextElement.find("a[href]").map((i2, a) => $(a).attr("href")).get();
episodeLinksMap.get(epNum).push(...siblingLinks);
nextElement = nextElement.next();
}
}
});
if (directLinkBlocks.length > 0) {
yield Promise.all(directLinkBlocks.map((blockUrl) => __async(this, null, function* () {
try {
const resolvedUrl = yield getRedirectLinks(blockUrl);
if (!resolvedUrl)
return;
const blockRes = yield fetch(resolvedUrl, { headers: HEADERS });
const blockData = yield blockRes.text();
const $$ = import_cheerio_without_node_native2.default.load(blockData);
$$("h5 a, h4 a, h3 a").each((i, el) => {
const linkText = $$(el).text();
const linkHref = $$(el).attr("href");
const epMatch = linkText.match(/Episode\s*(\d+)/i);
if (epMatch && linkHref) {
const epNum = parseInt(epMatch[1]);
if (!episodeLinksMap.has(epNum))
episodeLinksMap.set(epNum, []);
episodeLinksMap.get(epNum).push(linkHref);
}
});
} catch (e) {
}
})));
}
const initialLinks = [];
episodeLinksMap.forEach((links, epNum) => {
const uniqueLinks = [...new Set(links)];
initialLinks.push(...uniqueLinks.map((link) => ({ url: link, episode: epNum })));
});
const results = yield Promise.all(initialLinks.map((linkInfo) => __async(this, null, function* () {
try {
const extracted = yield loadExtractor(linkInfo.url, mediaUrl);
return extracted.map((ext) => __spreadProps(__spreadValues({}, ext), { episode: linkInfo.episode }));
} catch (e) {
return [];
}
})));
const allFinalLinks = results.flat();
const seenUrls = /* @__PURE__ */ new Set();
const uniqueFinalLinks = allFinalLinks.filter((link) => {
if (!link.url || link.url.includes(".zip"))
return false;
if (seenUrls.has(link.url))
return false;
seenUrls.add(link.url);
return true;
});
return { finalLinks: uniqueFinalLinks, isMovie };
}
});
}
function getStreams(tmdbId, mediaType = "movie", season = null, episode = null) {
return __async(this, null, function* () {
console.log(`[HDHub4u] Fetching streams for TMDB ID: ${tmdbId}, Type: ${mediaType}`);
try {
const mediaInfo = yield getTMDBDetails(tmdbId, mediaType);
console.log(`[HDHub4u] TMDB Info: "${mediaInfo.title}" (${mediaInfo.year || "N/A"})`);
const searchQuery = mediaType === "tv" && season ? `${mediaInfo.title} Season ${season}` : mediaInfo.title;
const searchResults = yield search(searchQuery);
if (searchResults.length === 0)
return [];
const bestMatch = findBestTitleMatch(mediaInfo, searchResults, mediaType, season);
const selectedMedia = bestMatch || searchResults[0];
console.log(`[HDHub4u] Selected: "${selectedMedia.title}" (${selectedMedia.url})`);
const result = yield getDownloadLinks(selectedMedia.url);
const finalLinks = result.finalLinks;
let filteredLinks = finalLinks;
if (mediaType === "tv" && episode !== null) {
filteredLinks = finalLinks.filter((link) => link.episode === episode);
}
const streams = filteredLinks.map((link) => {
let mediaTitle = link.fileName && link.fileName !== "Unknown" ? link.fileName : mediaInfo.title;
if (mediaType === "tv" && season && episode) {
mediaTitle = `${mediaInfo.title} S${String(season).padStart(2, "0")}E${String(episode).padStart(2, "0")}`;
}
const serverName = extractServerName(link.source);
let qualityStr = "Unknown";
if (typeof link.quality === "number" && link.quality > 0) {
if (link.quality >= 2160)
qualityStr = "4K";
else if (link.quality >= 1080)
qualityStr = "1080p";
else if (link.quality >= 720)
qualityStr = "720p";
else if (link.quality >= 480)
qualityStr = "480p";
} else if (typeof link.quality === "string") {
qualityStr = link.quality;
}
return {
name: `HDHub4u ${serverName}`,
title: mediaTitle,
url: link.url,
quality: qualityStr,
size: formatBytes(link.size),
headers: link.headers || void 0,
provider: "hdhub4u"
};
});
const qualityOrder = { "4K": 4, "1080p": 2, "720p": 1, "480p": 0, "Unknown": -2 };
return streams.sort((a, b) => (qualityOrder[b.quality] || -3) - (qualityOrder[a.quality] || -3));
} catch (error) {
console.error(`[HDHub4u] Scraping error: ${error.message}`);
return [];
}
});
}
module.exports = { getStreams };
+983
View File
@@ -0,0 +1,983 @@
{
"name": "All-in-One-Nuvio",
"version": "1.0.0",
"scrapers": [
{
"id": "allanime",
"name": "AllAnime",
"description": "AllAnime - Anime and Manga content streaming",
"version": "1.0.0",
"author": "",
"supportedTypes": ["movie", "tv"],
"filename": "providers/allanime.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/DwpqLJWV/allanime.png",
"contentLanguage": ["en", "ja"]
},
{
"id": "4khdhub",
"name": "4KHDHub",
"description": "4KHDHub direct links",
"version": "1.0.3",
"author": "Nuvio Team",
"supportedTypes": [
"movie",
"tv"
],
"filename": "providers/4khdhub.js",
"enabled": true,
"formats": [
"mkv"
],
"logo": "https://www.google.com/s2/favicons?domain=4khdhub.click&sz=128",
"contentLanguage": [
"en"
]
},
{
"id": "1shows",
"name": "1Shows",
"description": "1Shows- Movies | Series in 4k, 1080p, 720p & 480p",
"version": "1.0.0",
"author": "A2R14N - Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/1shows.js",
"enabled": true,
"hasSettings": false,
"formats": ["mkv", "mp4", "m3u8"],
"logo": "https://i.postimg.cc/9fDVBvn5/1shows.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "allwish",
"name": "🌟 All-Wish",
"description": "All-Wish TV episodes via All-Wish servers",
"version": "1.0.1",
"author": "Kabir",
"supportedTypes": ["movie", "tv"],
"filename": "providers/allwish.js",
"enabled": true,
"hasSettings": true,
"limited": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/WpFW45WQ/allwish.png",
"contentLanguage": ["en", "ja"]
},
{
"id": "animekai",
"name": "AnimeKai",
"description": "AnimeKai TV episodes via AnimeKai servers",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/animekai.js",
"enabled": true,
"hasSettings": true,
"limited": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/MKJd7fy7/animekai.png",
"contentLanguage": ["en"]
},
{
"id": "anizone",
"name": "AniZone",
"description": "AniZone high-quality anime streaming with multi-audio and soft subtitles",
"version": "1.0.2",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/anizone.js",
"enabled": true,
"formats": ["m3u8"],
"logo": "https://anizone.to/favicon.ico",
"contentLanguage": ["en", "ja"]
},
{
"id": "anikototv",
"name": "AnikotoTV",
"description": "Anime provider for AnikotoTV.to via Mapper API + Native Extractor",
"version": "1.0.5",
"author": "piratezoro9",
"supportedTypes": ["movie", "tv", "anime"],
"filename": "providers/anikototv.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4"],
"logo": "https://i.postimg.cc/JhL3HBR4/anikototv.png",
"contentLanguage": ["en", "ja"]
},
{
"id": "anidb",
"name": "AniDB",
"description": "Subbed and dubbed anime from AniDB.",
"version": "1.0.0",
"author": "Nuvio Team (ChillPill)",
"supportedTypes": ["movie", "tv"],
"filename": "providers/anidb.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/rmMzZ45K/anidb.png",
"contentLanguage": ["en", "ja", "ko"]
},
{
"id": "animepahe",
"name": "AnimePahe",
"description": "Watch anime online free in HD with fast streaming servers. Stream latest anime episodes and movies daily",
"version": "1.0.1",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/animepahe.js",
"enabled": true,
"hasSettings": true,
"formats": ["m3u8", "mp4"],
"logo": "https://i.postimg.cc/c4ZBGNNs/animepahe.png",
"contentLanguage": ["en", "ja"]
},
{
"id": "animesalt",
"name": "AnimeSalt",
"description": "AnimeSalt anime streaming with multi-language audio (Hindi, Tamil, Telugu, English) and high-quality direct HLS streams",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/animesalt.js",
"enabled": true,
"formats": ["m3u8", "mp4"],
"logo": "https://www.google.com/s2/favicons?domain=animesalt.cx&sz=128",
"contentLanguage": ["hi", "ta", "te", "en", "ja"]
},
{
"id": "animedekho",
"name": "AnimeDekho",
"description": "AnimeDekho streaming anime series and movies with Hindi dub, multi-audio and high-speed multi-server support",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/animedekho.js",
"enabled": true,
"formats": ["m3u8", "mp4"],
"logo": "https://www.google.com/s2/favicons?domain=animedekho.app&sz=128",
"contentLanguage": ["hi", "en", "ja"]
},
{
"id": "animetsu",
"name": "Animetsu",
"description": "Lightning fast sub & dub anime streams via Animetsu",
"version": "1.0.0",
"author": "piratezoro9",
"supportedTypes": ["movie", "tv", "anime"],
"filename": "providers/animetsu.js",
"enabled": true,
"hasSettings": true,
"formats": ["m3u8"],
"logo": "https://i.postimg.cc/0Q3DvLx7/animetsu.png",
"contentLanguage": ["en", "ja"]
},
{
"id": "animeworld",
"name": "🗡️ AnimeWorld",
"description": "Watch AnimeWorld India",
"version": "1.0.0",
"author": "piratezoro9",
"supportedTypes": ["movie", "tv"],
"filename": "providers/animeworld.js",
"enabled": true,
"hasSettings": true,
"formats": ["m3u8"],
"logo": "https://i.postimg.cc/wxD6rVKX/animeworld.png",
"contentLanguage": ["hi", "en", "ja"]
},
{
"id": "anime-sama",
"name": "🐍 Anime-Sama",
"description": "Watch AnimeSama France",
"version": "1.1.27",
"author": "Gowaru",
"supportedTypes": ["movie", "tv"],
"filename": "providers/anime-sama.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv"],
"logo": "https://i.postimg.cc/tgYt2pYG/animesama.png",
"contentLanguage": ["fr"]
},
{
"id": "allmovieland",
"name": "AllMovieLand",
"description": "AllMovieLand streaming provider with multi-language support",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/allmovieland.js",
"enabled": true,
"hasSettings": true,
"formats": ["m3u8"],
"logo": "https://i.postimg.cc/hhWqkVQs/allmovieland.png",
"contentLanguage": ["en", "hi", "ta", "te"]
},
{
"id": "animezey",
"name": "AnimeZeY",
"description": "Movies via AnimeZeY, indexed by TMDB",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/animezey.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/RVTy2djk/ainimezey.png",
"contentLanguage": ["en", "pt"]
},
{
"id": "desiflix",
"name": "DesiFlix",
"description": "Bollywood, Hollywood, and South Indian movies, in Dual Language",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/desiflix.js",
"enabled": true,
"hasSettings": false,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/Vvs4fmwM/desiflix.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "castle",
"name": "🏰 Castle",
"description": "Multi Lang provider",
"version": "2.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/castle.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/0NvGzFyK/castle.png",
"contentLanguage": ["en"]
},
{
"id": "Cineby",
"name": "Cineby",
"description": "Multi-server movie and TV streaming — 4K/1080p/720p from Videasy network without subtitles",
"version": "1.9.2",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/cineby.js",
"enabled": true,
"hasSettings": true,
"formats": ["m3u8"],
"logo": "https://i.postimg.cc/dV1HWbqX/cineby.png",
"contentLanguage": ["ar", "en"]
},
{
"id": "cinefreak",
"name": "CineFreak",
"description": "Direct MKV streams from cinefreak.nl",
"version": "1.0.0",
"author": "piratezoro9",
"supportedTypes": ["movie", "tv"],
"filename": "providers/cinefreak.js",
"enabled": true,
"hasSettings": true,
"formats": ["mkv", "mp4"],
"logo": "https://i.postimg.cc/rpDB2284/cinefreak.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "moonflix",
"name": "MoonFlix",
"description": "Bollywood, Hollywood, South Indian Movies & Series",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/moonflix.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv"],
"logo": "https://i.postimg.cc/90dVRJJq/moonflix.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "cinemacity",
"name": "CinemaCity",
"description": "Multi Language Provider",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/cinemacity.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/XYjKhS3b/cinemacity.png",
"contentLanguage": ["en", "hi", "ar"]
},
{
"id": "ctgmovies",
"name": "CTGMovies",
"description": "English | Hindi Movies",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/ctgmovies.js",
"enabled": true,
"hasSettings": true,
"formats": ["m3u8", "mp4", "mkv"],
"logo": "https://i.postimg.cc/jSQmk9B3/ctgmovies.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "dahmermovies",
"name": "Dahmermovies",
"description": "1080p Movies from Dahmermovies",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/dahmermovies.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/hGt3dV6Z/dhamermovies.png",
"contentLanguage": ["en"]
},
{
"id": "dahmermovies-tv",
"name": "Dahmermovies-TV",
"description": "Only works on Android TV",
"version": "1.0.1",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/dahmermovies-4k.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/hGt3dV6Z/dhamermovies.png",
"contentLanguage": ["en"]
},
{
"id": "dooflix",
"name": "DooFlix",
"description": "Fast streaming provider with direct TMDB integration",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/dooflix.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/59H1DmRk/dooflix.png",
"contentLanguage": ["en", "es"]
},
{
"id": "einthusan",
"name": "Einthustan",
"description": "1080p Movies in Multi-Lang",
"version": "1.0.0",
"author": "✮☆[D3ADLY]☆✮",
"supportedTypes": ["movie", "tv"],
"filename": "providers/einthusan.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/QCFYLyRR/einthusan.png",
"contentLanguage": ["hi", "ta", "te", "ba"]
},
{
"id": "fibwatch",
"name": "FibWatch",
"description": "FibWatch movie and TV streams with episode selection",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": [
"movie",
"tv"
],
"filename": "providers/fibwatch.js",
"enabled": true,
"formats": [
"m3u8",
"mp4",
"mkv"
],
"contentLanguage": [
"hi",
"bn",
"en"
]
},
{
"id": "goated",
"name": "🐐 Goated",
"description": "4K • 1080p Movies & Series in Multi Language",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/goated.js",
"enabled": true,
"hasSettings": true,
"formats": ["mkv", "mp4", "m3u8"],
"logo": "https://i.postimg.cc/qqsfgS0F/goated.png",
"contentLanguage": ["en", "hi", "ru", "es"]
},
{
"id": "gramcinema",
"name": "GramCinema",
"description": "Streams in Multi Lang from Bollywood.eu.org. Requires Cookie Token.",
"version": "1.0.0",
"author": "Xyr0nX • =[D3adly]=",
"supportedTypes": ["movie", "tv"],
"filename": "providers/gramcinema.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/WbNPW7Jv/gramcinema.png",
"contentLanguage": ["en", "hi", "ta", "ru"]
},
{
"id": "hdghartv",
"name": "HDGharTV",
"description": "HDGhar TV allows users to watch movies, TV shows and web series in English & Hindi.",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/hdghartv.js",
"enabled": true,
"hasSettings": false,
"formats": ["m3u8"],
"logo": "https://i.postimg.cc/761WVpJS/hdghartv.png",
"contentLanguage": ["en", "hi"],
"limited": false
},
{
"id": "hdhub4u",
"name": "HDHub4u",
"description": "Direct links from HDHub4u with high-speed download support",
"version": "1.1.1",
"author": "Nuvio Team",
"supportedTypes": [
"movie",
"tv"
],
"filename": "providers/hdhub4u.js",
"enabled": true,
"formats": [
"mkv",
"mp4"
],
"logo": "https://www.google.com/s2/favicons?domain=new6.hdhub4u.fo&sz=128",
"contentLanguage": [
"en",
"hin"
]
},
{
"id": "hianime",
"name": "HiAnime",
"description": "HiAnime multi-server anime streaming with real-time mapping and subtitles",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/hianime.js",
"enabled": true,
"hasSettings": true,
"formats": ["m3u8"],
"logo": "https://i.postimg.cc/13SYJPTx/hianime.png",
"contentLanguage": ["ja", "en"]
},
{
"id": "hindmoviez",
"name": "HindMoviez",
"description": "HindMoviez - Hindi & English Movies and Series (480p / 720p / 1080p / 4K)",
"version": "1.0.1",
"author": "Sanchit (@S4NCHITT) — Murph's Streams",
"supportedTypes": ["movie", "tv"],
"filename": "providers/hindmoviez.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/5t55Csm4/hindmoviez.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "kurage",
"name": "Kurage",
"description": "Kurage.live anime streaming with tRPC API and multi-server proxy support",
"version": "1.0.0",
"author": "Paregi12",
"supportedTypes": ["movie", "tv"],
"filename": "providers/kurage.js",
"enabled": true,
"hasSettings": true,
"resources": ["stream"],
"formats": ["mkv", "m3u8"],
"logo": "https://i.postimg.cc/3N2V7pHc/kurage.png",
"contentLanguage": ["en", "ja"]
},
{
"id": "moviebox",
"name": "MovieBox",
"description": "MovieBox streaming with multiple language support (DASH + MP4)",
"version": "1.2.3",
"author": "Nuvio Team",
"supportedTypes": [
"movie",
"tv"
],
"filename": "providers/moviebox.js",
"enabled": true,
"formats": [
"mp4",
"mpd"
],
"logo": "https://moviebox.ph/favicon.ico",
"contentLanguage": [
"en",
"hin",
"tam",
"tel"
]
},
{
"id": "movieblast",
"name": "MovieBlast",
"description": "MovieBlast - Hindi, Tamil, Telugu & English Movies/Series with multi-quality streams",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/movieblast.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/qqkLSyhN/movieblast.png",
"contentLanguage": ["en", "hi", "ta", "te"]
},
{
"id": "moviesdrive",
"name": "MoviesDrive",
"description": "MoviesDrive streaming with HubCloud and Google Drive extraction",
"version": "3.0.1",
"author": "Nuvio Team",
"supportedTypes": [
"movie",
"tv"
],
"filename": "providers/moviesdrive.js",
"enabled": true,
"formats": [
"mkv",
"mp4"
],
"logo": "https://www.google.com/s2/favicons?domain=moviesdrives.my&sz=128",
"contentLanguage": [
"en",
"hin"
]
},
{
"id": "moviesmod",
"name": "MoviesMod",
"description": "Movie and TV show streams from MoviesMod with multiple quality options",
"version": "1.0.1",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/moviesmod.js",
"enabled": true,
"hasSettings": false,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://www.google.com/s2/favicons?domain=moviesmod.farm&sz=128",
"contentLanguage": ["en"]
},
{
"id": "movieshunt",
"name": "🎬 MoviesHunt",
"description": "Hollywood & Bollywood Movies in Multi Language",
"version": "1.0.0",
"author": "piratezoro9",
"supportedTypes": ["movie"],
"filename": "providers/movieshunt.js",
"enabled": true,
"hasSettings": false,
"formats": ["m3u8"],
"logo": "https://i.postimg.cc/3Rc34LJj/movieshunt.png",
"contentLanguage": ["hi", "en"]
},
{
"id": "movies4u",
"name": "Movies4u",
"description": "Hollywood, Bollywood movies including web series, & Hindi dubbed movies in HD quality",
"version": "1.0.2",
"author": "Nuvio Team",
"supportedTypes": ["movie"],
"filename": "providers/movies4u.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/J0QG1QhQ/movies4u.jpg",
"contentLanguage": ["en", "hi", "ta"]
},
{
"id": "movix",
"name": "Movix VF",
"description": "Movies and TV series in English & French (dubbed/subtitled)",
"version": "1.0.0",
"author": "wooodyhood",
"supportedTypes": ["movie", "tv"],
"filename": "providers/movix.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/XYrPQm87/movix.png",
"contentLanguage": ["en", "fr"]
},
{
"id": "nakios",
"name": "Nakios",
"description": "Mainly French, Some English & 4K Quality",
"version": "3.8.2",
"author": "Wooodyhood",
"supportedTypes": ["movie", "tv"],
"filename": "providers/nakios.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/nLwY1pJB/nakios.png",
"contentLanguage": ["fr", "en"]
},
{
"id": "netmirror",
"name": "NetMirror",
"description": "Streaming links from netmirror.",
"version": "1.0.10",
"author": "Nuvio Team",
"supportedTypes": [
"movie",
"tv"
],
"filename": "providers/netmirror.js",
"enabled": true,
"hasSettings": true,
"logo": "https://net22.cc/favicon.ico",
"contentLanguage": [
"en"
],
"supportsExternalPlayer": false
},
{
"id": "persianstremio",
"name": "🌸 PersianStremio",
"description": "Persian Stremio plugin for movies, series,and Persian media content in Iranian & English.",
"version": "1.4.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/persianstremio.js",
"enabled": true,
"hasSettings": false,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/qq6V2fTL/persian.png",
"contentLanguage": ["en", "pe"]
},
{
"id": "peachify",
"name": "🍑 Peachify",
"description": "Streams from peachify.top — 3 server sources (MovieBox/Holly/Air) via Cloudflare Workers with AES-256-GCM decryption",
"version": "1.0.0",
"author": "piratezoro9",
"supportedTypes": ["movie", "tv"],
"filename": "providers/peachify.js",
"enabled": true,
"hasSettings": true,
"formats": ["m3u8", "mp4"],
"logo": "https://i.postimg.cc/tCz8CDH3/peachify.png",
"contentLanguage": ["en", "hi", "te", "ta", "pt"]
},
{
"id": "playimdb",
"name": "PlayIMDb",
"description": "High-Speed Direct Streaming for Movies (IMDb ID Extract)",
"version": "2.0.0",
"author": "PirateZoro9",
"supportedTypes": ["movie", "tv"],
"filename": "providers/playimdb.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/KzjPtYWY/imdb.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "purstream",
"name": "Purstream",
"description": "Films and series in French (VF) / subtitled French (VOSTFR) / multi-language (MULTI) from purstream.art.",
"version": "3.0.0",
"author": "wooodyhood",
"supportedTypes": ["movie", "tv"],
"filename": "providers/purstream.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/7L5shxmC/purstream.png",
"contentLanguage": ["en", "fr"]
},
{
"id": "showbox",
"name": "ShowBox",
"description": "ShowBox streaming with multiple quality options and versions",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/showbox.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/8c5XGzsx/showbox.png",
"contentLanguage": ["en"]
},
{
"id": "topcartoons",
"name": "TopCartoons",
"description": "Popular cartoons streaming",
"version": "1.0.0",
"author": "Phisher",
"supportedTypes": ["movie", "tv"],
"filename": "providers/topcartoons.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/3xVsbwp8/topcartoons.png",
"contentLanguage": ["en"]
},
{
"id": "torrentio",
"name": "🧲 Torrentio",
"description": "Torrentio – Torrent streaming. Supports optional debrid services.",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/torrentio.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/ZRYTCy0T/torrentio.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "vidrock",
"name": "🪨 VidRock",
"description": "VidRock - 1080p 480p and 360p",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/vidrock.js",
"enabled": true,
"hasSettings": false,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/brxL7qg3/multivid.png",
"contentLanguage": ["en"]
},
{
"id": "uhdmovies",
"name": "UHDMovies",
"description": "UHD Movies streaming with multiple resolution",
"version": "1.2.1",
"author": "Nuvio Team",
"supportedTypes": [
"movie",
"tv"
],
"filename": "providers/uhdmovies.js",
"enabled": true,
"formats": [
"mkv"
],
"logo": "https://www.google.com/s2/favicons?domain=uhdmovies.pink&sz=128",
"contentLanguage": [
"en"
]
},
{
"id": "vegamovies",
"name": "VegaMovies",
"description": "VegaMovies streaming with high-quality direct links",
"version": "2.0",
"author": "piratezoro9",
"supportedTypes": ["movie", "tv"],
"filename": "providers/vegamovies.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv"],
"logo": "https://i.postimg.cc/TwYK26jn/vegamovies.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "vidlink",
"name": "VidLink",
"description": "Vidlink streaming with encrypted TMDB ID support for movies and TV shows",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/vidlink.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/RZRHQd75/vidlink.png",
"contentLanguage": ["en"]
},
{
"id": "videasy",
"name": "VidEasy",
"description": "Videasy streaming with encrypted TMDB ID support for movies and TV shows",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/videasy.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/7LHYMtVV/videasy.png",
"contentLanguage": ["en"]
},
{
"id": "vidsrc",
"name": "VidSrc",
"description": "Vidsrc - The best place to watch movies and TV shows online for free. Stream in 1080p HD",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/vidsrc.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/ncMLBsLJ/vidsrc.png",
"contentLanguage": ["en"]
},
{
"id": "vixsrc",
"name": "VixSrc",
"description": "VixSrc - The best place to watch movies and TV shows online for free. Stream in 1080p HD",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/vixsrc.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/1tHrBvzs/vixsrc.png",
"contentLanguage": ["en", "Ita"]
},
{
"id": "vidfast",
"name": "VidFast",
"description": "Stream movies and TV shows from vidfast.pro.",
"version": "1.0.0",
"author": "Dustincos",
"supportedTypes": ["movie", "tv"],
"filename": "providers/vidfast.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/0Qp8PSx5/vidfast.png",
"contentLanguage": ["en"]
},
{
"id": "vidlove",
"name": "❤️ VidLove",
"description": "Movie and TV show streams from MovieBox, LookMovie, VidnNest etc",
"version": "1.0.0",
"author": "Jeff",
"supportedTypes": ["movie", "tv"],
"filename": "providers/vidlove.js",
"enabled": true,
"hasSettings": false,
"formats": ["mp4", "m3u8", "mkv"],
"logo": "https://i.postimg.cc/ZRjQytBY/vidlove.png",
"contentLanguage": ["en"]
},
{
"id": "xpass",
"name": "XPass",
"description": "Play Movie/TV by TMDB ID or IMDb ID",
"version": "1.0.0",
"author": "Dustincos",
"supportedTypes": ["movie", "tv"],
"filename": "providers/xpass.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/tgqNQxdy/xpass.png",
"contentLanguage": ["en", "hi"]
},
{
"id": "zinkmovies",
"name": "ZinkMovies",
"description": "Bollywood Movies, Hollywood Movies, South Indian Movies, Hindi Dubbed Movies, Web Series, OTT Releases, & Trending Cinema",
"version": "1.0.0",
"author": "Kabir",
"supportedTypes": ["movie", "tv"],
"filename": "providers/zinkmovies.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/XqCZyCgp/zinkmovies.png",
"contentLanguage": ["en", "hi", "ta", "te"]
},
{
"id": "onlykdrama",
"name": "🫰 OnlyKDrama",
"description": "Asian Drama",
"version": "1.0.0",
"author": "Moiz Ahmed + Codex",
"supportedTypes": ["movie", "tv"],
"filename": "providers/onlykdrama.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "mkv", "m3u8"],
"logo": "https://i.postimg.cc/dtX84Gqc/onlykdrama.jpg",
"contentLanguage": ["ko"]
},
{
"id": "kisskh",
"name": "💋 Kisskh",
"description": "Streams Korean dramas and movies from onlykdrama.top",
"version": "1.0.0",
"author": "Michat88",
"supportedTypes": ["movie", "tv"],
"filename": "providers/kisskh.js",
"enabled": true,
"hasSettings": true,
"formats": ["mp4", "m3u8"],
"logo": "https://i.postimg.cc/2yLnTzPP/kisskh.jpg",
"contentLanguage": ["ko", "ch", "ja", "th"]
},
{
"id": "reanime",
"name": "Reanime",
"description": "Reanime anime streaming with automated AniList mapping and subtitle support",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/reanime.js",
"enabled": true,
"hasSettings": false,
"formats": ["mkv", "m3u8"],
"logo": "https://www.google.com/s2/favicons?domain=reanime.to&sz=128",
"contentLanguage": ["en"]
},
{
"id": "mapple",
"name": "Mapple",
"description": "Mapple multi-hoster movies and TV streaming with PoW session verification and direct HLS streams",
"version": "1.0.0",
"author": "Nuvio Team",
"supportedTypes": ["movie", "tv"],
"filename": "providers/mapple.js",
"enabled": true,
"hasSettings": false,
"formats": ["m3u8"],
"logo": "https://www.google.com/s2/favicons?domain=mapple.fun&sz=128",
"contentLanguage": ["en"]
}
]
}
+481
View File
@@ -0,0 +1,481 @@
/**
* mapple - Built from src/mapple/
* Generated: 2026-09-21T12:38:36.737Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/mapple/constants.js
var BASE_URL = "https://mapple.fun";
var SUBTITLE_BASE = "https://sub.wyzie.io";
var TMDB_BASE_URL = "https://api.themoviedb.org/3";
var TMDB_API_KEY = "439c478a771f35c05022f9feabcca01c";
var DEFAULT_USER_AGENT = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Mobile Safari/537.36";
var API_HEADERS = {
"User-Agent": DEFAULT_USER_AGENT,
"Accept": "*/*",
"Origin": BASE_URL,
"Referer": `${BASE_URL}/`
};
var PLAYBACK_HEADERS = {
"Referer": `${BASE_URL}/`,
"Origin": BASE_URL,
"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"
};
var HOSTERS = [
{ name: "Zeus", key: "mapple" },
{ name: "Poseidon", key: "s25" },
{ name: "Athena", key: "s2" },
{ name: "Hera", key: "s4" },
{ name: "Persephone", key: "s12" },
{ name: "Apollo", key: "s19" },
{ name: "Artemis", key: "s13" },
{ name: "Hermes", key: "s26" },
{ name: "Ares", key: "s24" },
{ name: "Aphrodite", key: "s6" },
{ name: "Hephaestus", key: "s15" },
{ name: "Demeter", key: "s7" },
{ name: "Dionysus", key: "s8" },
{ name: "Hestia", key: "s3" },
{ name: "Hades", key: "s16" },
{ name: "Nike", key: "s5" },
{ name: "Atlas", key: "s1" },
{ name: "Prometheus", key: "s10" }
];
// src/mapple/pow.js
var import_crypto_js = __toESM(require("crypto-js"));
var nodeCrypto = null;
try {
const req = require;
nodeCrypto = req("crypto");
} catch (e) {
}
function countLeadingZeroBitsBytes(bytes) {
let count = 0;
for (let i = 0; i < bytes.length; i++) {
const b = bytes[i];
if (b === 0) {
count += 8;
} else {
for (let bit = 7; bit >= 0; bit--) {
if ((b & 1 << bit) !== 0)
return count;
count++;
}
}
}
return count;
}
function countLeadingZeroBitsWords(words) {
let count = 0;
for (let i = 0; i < words.length; i++) {
const w = words[i] >>> 0;
const lz = Math.clz32(w);
count += lz;
if (lz < 32)
break;
}
return count;
}
function solvePow(challenge, difficulty) {
const maxAttempts = 5e7;
let nonce = 0;
if (nodeCrypto && typeof nodeCrypto.createHash === "function") {
while (nonce < maxAttempts) {
const hash = nodeCrypto.createHash("sha256").update(challenge + nonce).digest();
if (countLeadingZeroBitsBytes(hash) >= difficulty) {
return nonce.toString();
}
nonce++;
}
} else {
while (nonce < maxAttempts) {
const hash = import_crypto_js.default.SHA256(challenge + nonce);
if (countLeadingZeroBitsWords(hash.words) >= difficulty) {
return nonce.toString();
}
nonce++;
}
}
throw new Error(`PoW solve exceeded max attempts (difficulty=${difficulty})`);
}
// src/mapple/utils.js
var CookieJar = class {
constructor() {
this.cookies = /* @__PURE__ */ new Map();
}
update(res) {
if (!res || !res.headers)
return;
let rawCookies = [];
if (typeof res.headers.getSetCookie === "function") {
rawCookies = res.headers.getSetCookie();
} else if (res.headers.get) {
const h = res.headers.get("set-cookie");
if (h)
rawCookies = [h];
}
for (const c of rawCookies) {
const parts = c.split(";");
const [k, v] = parts[0].split("=");
if (k && v) {
this.cookies.set(k.trim(), v.trim());
}
}
}
getCookieString() {
const list = [];
for (const [k, v] of this.cookies.entries()) {
list.push(`${k}=${v}`);
}
return list.join("; ");
}
};
function fetchMediaDetails(tmdbId, mediaType) {
return __async(this, null, function* () {
var _a;
try {
const endpoint = mediaType === "tv" ? "tv" : "movie";
const url = `${TMDB_BASE_URL}/${endpoint}/${tmdbId}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
const res = yield fetch(url, {
headers: {
"User-Agent": DEFAULT_USER_AGENT,
"Accept": "application/json"
}
});
if (!res.ok)
throw new Error(`TMDB HTTP ${res.status}`);
const data = yield res.json();
return {
title: mediaType === "tv" ? data.name : data.title,
year: (mediaType === "tv" ? data.first_air_date : data.release_date || "").substring(0, 4),
imdbId: ((_a = data.external_ids) == null ? void 0 : _a.imdb_id) || null,
mediaType
};
} catch (e) {
return {
title: `TMDB ${tmdbId}`,
year: "",
imdbId: null,
mediaType
};
}
});
}
function fetchSubtitles(tmdbId, mediaType, seasonNum = null, episodeNum = null) {
return __async(this, null, function* () {
try {
const isMovie = mediaType !== "tv";
const url = isMovie ? `${SUBTITLE_BASE}/search?id=${tmdbId}` : `${SUBTITLE_BASE}/search?id=${tmdbId}&season=${seasonNum}&episode=${episodeNum}`;
const res = yield fetch(url, { headers: { "Accept": "application/json" } });
if (!res.ok)
return [];
const data = yield res.json();
if (!Array.isArray(data))
return [];
return data.map((sub) => ({
url: sub.url,
language: sub.language || "Unknown",
name: sub.isHearingImpaired ? `${sub.language} (CC)` : sub.language || "Subtitle"
}));
} catch (e) {
return [];
}
});
}
function parseHlsMaster(masterUrl, hosterName, mediaTitle, playbackHeaders) {
return __async(this, null, function* () {
try {
const res = yield fetch(masterUrl, { headers: playbackHeaders });
if (!res.ok)
return null;
const text = yield res.text();
if (!text.includes("#EXT-X-STREAM-INF"))
return null;
const lines = text.split("\n");
const streams = [];
let currentQuality = "Unknown";
for (let i = 0; i < lines.length; i++) {
const line = lines[i].trim();
if (line.startsWith("#EXT-X-STREAM-INF")) {
const resMatch = line.match(/RESOLUTION=\d+x(\d+)/);
if (resMatch) {
currentQuality = resMatch[1] + "p";
}
} else if (line && !line.startsWith("#")) {
const streamUrl = line.startsWith("http") ? line : new URL(line, masterUrl).href;
streams.push({
name: `Mapple [${hosterName}] - ${currentQuality}`,
title: mediaTitle,
url: streamUrl,
quality: currentQuality,
size: "Unknown",
headers: playbackHeaders,
provider: "mapple"
});
currentQuality = "Unknown";
}
}
return streams.length > 0 ? streams : null;
} catch (e) {
return null;
}
});
}
// src/mapple/index.js
function getPlaybackSession(tmdbId, mediaType, tvSlug, mediaReferer, cookieJar) {
return __async(this, null, function* () {
const initRes = yield fetch(`${BASE_URL}/`, {
headers: {
"User-Agent": API_HEADERS["User-Agent"],
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
}
});
cookieJar.update(initRes);
const tokenRes = yield fetch(`${BASE_URL}/api/request-token`, {
method: "POST",
headers: __spreadProps(__spreadValues({}, API_HEADERS), {
"Referer": mediaReferer,
"Content-Type": "application/json",
"Cookie": cookieJar.getCookieString()
}),
body: ""
});
cookieJar.update(tokenRes);
if (!tokenRes.ok)
return null;
const tokenData = yield tokenRes.json();
const requestToken = tokenData == null ? void 0 : tokenData.token;
if (!requestToken)
return null;
const initPayload = {
mediaId: Number(tmdbId),
mediaType,
tv_slug: tvSlug,
requestToken
};
const playbackRes = yield fetch(`${BASE_URL}/api/playback-init`, {
method: "POST",
headers: __spreadProps(__spreadValues({}, API_HEADERS), {
"Referer": mediaReferer,
"Content-Type": "application/json",
"Cookie": cookieJar.getCookieString()
}),
body: JSON.stringify(initPayload)
});
cookieJar.update(playbackRes);
if (!playbackRes.ok)
return null;
const initData = yield playbackRes.json();
let playbackToken = null;
if (initData.success && initData.token) {
playbackToken = initData.token;
} else if (initData.requiresPow && initData.pow) {
const nonce = solvePow(initData.pow.challenge, initData.pow.difficulty);
const powRes = yield fetch(`${BASE_URL}/api/playback-init`, {
method: "POST",
headers: __spreadProps(__spreadValues({}, API_HEADERS), {
"Referer": mediaReferer,
"Content-Type": "application/json",
"Cookie": cookieJar.getCookieString()
}),
body: JSON.stringify(__spreadProps(__spreadValues({}, initPayload), {
pow: {
challengeId: initData.pow.challengeId,
nonce
}
}))
});
cookieJar.update(powRes);
if (powRes.ok) {
const powData = yield powRes.json();
playbackToken = powData == null ? void 0 : powData.token;
}
}
if (!playbackToken)
return null;
return { requestToken, playbackToken };
});
}
function extractHosterStream(hoster, tmdbId, mediaType, tvSlug, mediaReferer, session, cookieJar, mediaTitle, subtitles) {
return __async(this, null, function* () {
var _a;
try {
const encRes = yield fetch(`${BASE_URL}/api/encrypt`, {
method: "POST",
headers: __spreadProps(__spreadValues({}, API_HEADERS), {
"Referer": mediaReferer,
"Content-Type": "application/json",
"Cookie": cookieJar.getCookieString()
}),
body: JSON.stringify({
data: {
mediaId: Number(tmdbId),
mediaType,
tv_slug: tvSlug,
source: hoster.key
},
endpoint: "stream-encrypted",
requestToken: session.requestToken
})
});
if (!encRes.ok)
return [];
const encData = yield encRes.json();
if (!(encData == null ? void 0 : encData.url))
return [];
const streamEndpoint = `${BASE_URL}${encData.url}&requestToken=${encodeURIComponent(session.requestToken)}&token=${encodeURIComponent(session.playbackToken)}`;
const streamRes = yield fetch(streamEndpoint, {
headers: __spreadProps(__spreadValues({}, API_HEADERS), {
"Referer": mediaReferer,
"Cookie": cookieJar.getCookieString()
})
});
if (!streamRes.ok)
return [];
const streamData = yield streamRes.json();
const streamUrl = (_a = streamData == null ? void 0 : streamData.data) == null ? void 0 : _a.stream_url;
if (!(streamData == null ? void 0 : streamData.success) || !streamUrl || streamUrl.includes("playback-unavailable")) {
return [];
}
const streams = [];
const parsedStreams = yield parseHlsMaster(streamUrl, hoster.name, mediaTitle, PLAYBACK_HEADERS);
if (parsedStreams && parsedStreams.length > 0) {
parsedStreams.forEach((s) => {
s.subtitles = subtitles;
streams.push(s);
});
}
streams.push({
name: `Mapple [${hoster.name}] - Auto`,
title: mediaTitle,
url: streamUrl,
quality: "Auto",
size: "Unknown",
headers: PLAYBACK_HEADERS,
provider: "mapple",
subtitles
});
return streams;
} catch (e) {
return [];
}
});
}
function getStreams(tmdbId, mediaType, seasonNum = null, episodeNum = null) {
return __async(this, null, function* () {
const type = mediaType === "tv" || mediaType === "series" ? "tv" : "movie";
const s = seasonNum ? Number(seasonNum) : 1;
const e = episodeNum ? Number(episodeNum) : 1;
const tvSlug = type === "tv" ? `${s}-${e}` : "";
const mediaReferer = type === "tv" ? `${BASE_URL}/tv/${tmdbId}/${s}/${e}` : `${BASE_URL}/movie/${tmdbId}`;
const [mediaDetails, subtitles] = yield Promise.all([
fetchMediaDetails(tmdbId, type),
fetchSubtitles(tmdbId, type, s, e)
]);
let mediaTitle = mediaDetails.title || `TMDB ${tmdbId}`;
if (mediaDetails.year) {
mediaTitle += ` (${mediaDetails.year})`;
}
if (type === "tv") {
mediaTitle += ` S${String(s).padStart(2, "0")}E${String(e).padStart(2, "0")}`;
}
const cookieJar = new CookieJar();
const session = yield getPlaybackSession(tmdbId, type, tvSlug, mediaReferer, cookieJar);
if (!session)
return [];
const hosterPromises = HOSTERS.map(
(hoster) => extractHosterStream(hoster, tmdbId, type, tvSlug, mediaReferer, session, cookieJar, mediaTitle, subtitles)
);
const hosterResults = yield Promise.all(hosterPromises);
const allStreams = hosterResults.flat();
const seen = /* @__PURE__ */ new Set();
const uniqueStreams = [];
allStreams.forEach((stream) => {
if (!seen.has(stream.url)) {
seen.add(stream.url);
uniqueStreams.push(stream);
}
});
const qualityRank = {
"auto": 4e3,
"adaptive": 4e3,
"2160p": 2160,
"4k": 2160,
"1080p": 1080,
"720p": 720,
"480p": 480,
"360p": 360,
"240p": 240,
"unknown": 0
};
uniqueStreams.sort((a, b) => {
var _a, _b;
const qa = qualityRank[(_a = a.quality) == null ? void 0 : _a.toLowerCase()] || 0;
const qb = qualityRank[(_b = b.quality) == null ? void 0 : _b.toLowerCase()] || 0;
return qb - qa;
});
return uniqueStreams;
});
}
module.exports = { getStreams };
+755 -1
View File
@@ -1 +1,755 @@
'use strict';const _0x5df61e=_0x1301;function _0x1301(_0x147c16,_0x38c3f3){_0x147c16=_0x147c16-0xcc;const _0x2a568b=_0x2a56();let _0x130141=_0x2a568b[_0x147c16];if(_0x1301['kiGTOm']===undefined){var _0x21b7b1=function(_0x5b4dfd){const _0x60d9d9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x40bf53='',_0x6486c7='';for(let _0x5874a7=0x0,_0x4168ea,_0x2a9b98,_0x5882ca=0x0;_0x2a9b98=_0x5b4dfd['charAt'](_0x5882ca++);~_0x2a9b98&&(_0x4168ea=_0x5874a7%0x4?_0x4168ea*0x40+_0x2a9b98:_0x2a9b98,_0x5874a7++%0x4)?_0x40bf53+=String['fromCharCode'](0xff&_0x4168ea>>(-0x2*_0x5874a7&0x6)):0x0){_0x2a9b98=_0x60d9d9['indexOf'](_0x2a9b98);}for(let _0x451df1=0x0,_0x2b5730=_0x40bf53['length'];_0x451df1<_0x2b5730;_0x451df1++){_0x6486c7+='%'+('00'+_0x40bf53['charCodeAt'](_0x451df1)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6486c7);};_0x1301['QuaViJ']=_0x21b7b1,_0x1301['cnDtGb']={},_0x1301['kiGTOm']=!![];}const _0xda70c7=_0x2a568b[0x0],_0x4c91a7=_0x147c16+_0xda70c7,_0x2f7ed9=_0x1301['cnDtGb'][_0x4c91a7];return!_0x2f7ed9?(_0x130141=_0x1301['QuaViJ'](_0x130141),_0x1301['cnDtGb'][_0x4c91a7]=_0x130141):_0x130141=_0x2f7ed9,_0x130141;}(function(_0x247280,_0xebc547){const _0x4a60e0={_0x319673:0xed,_0x3049a0:0xef,_0x648702:0xe3,_0x14e0d5:0xdf},_0x17a689=_0x1301,_0x2d1757=_0x247280();while(!![]){try{const _0x2bad92=parseInt(_0x17a689(0xcc))/0x1*(parseInt(_0x17a689(0xe6))/0x2)+parseInt(_0x17a689(0xf3))/0x3*(parseInt(_0x17a689(_0x4a60e0._0x319673))/0x4)+-parseInt(_0x17a689(0xe8))/0x5+parseInt(_0x17a689(0xdd))/0x6+parseInt(_0x17a689(_0x4a60e0._0x3049a0))/0x7+-parseInt(_0x17a689(_0x4a60e0._0x648702))/0x8+parseInt(_0x17a689(_0x4a60e0._0x14e0d5))/0x9;if(_0x2bad92===_0xebc547)break;else _0x2d1757['push'](_0x2d1757['shift']());}catch(_0x1fc666){_0x2d1757['push'](_0x2d1757['shift']());}}}(_0x2a56,0xd6d75));var __defProp=Object['defineProperty'],__defProps=Object['defineProperties'],__getOwnPropDescs=Object['getOwnPropertyDescriptors'],__getOwnPropSymbols=Object['getOwnPropertySymbols'],__hasOwnProp=Object['prototype']['hasOwnProperty'],__propIsEnum=Object[_0x5df61e(0xf6)][_0x5df61e(0xeb)],__defNormalProp=(_0x40bf53,_0x6486c7,_0x5874a7)=>_0x6486c7 in _0x40bf53?__defProp(_0x40bf53,_0x6486c7,{'enumerable':!![],'configurable':!![],'writable':!![],'value':_0x5874a7}):_0x40bf53[_0x6486c7]=_0x5874a7,__spreadValues=(_0x4168ea,_0x2a9b98)=>{const _0x51bb8f=_0x5df61e;for(var _0x5882ca in _0x2a9b98||(_0x2a9b98={}))if(__hasOwnProp['call'](_0x2a9b98,_0x5882ca))__defNormalProp(_0x4168ea,_0x5882ca,_0x2a9b98[_0x5882ca]);if(__getOwnPropSymbols)for(var _0x5882ca of __getOwnPropSymbols(_0x2a9b98)){if(__propIsEnum[_0x51bb8f(0xf0)](_0x2a9b98,_0x5882ca))__defNormalProp(_0x4168ea,_0x5882ca,_0x2a9b98[_0x5882ca]);}return _0x4168ea;},__spreadProps=(_0x451df1,_0x2b5730)=>__defProps(_0x451df1,__getOwnPropDescs(_0x2b5730)),__async=(_0x14d30f,_0x6a36a5,_0x4cc304)=>{const _0x2d60b2={_0x1f2408:0xf2};return new Promise((_0x565c41,_0x2dfc0b)=>{const _0x2c160d={_0x5c1f27:0xe7},_0x293180=_0x1301;var _0x2aeac6=_0x300863=>{const _0x49c7d1=_0x1301;try{_0x34f38a(_0x4cc304[_0x49c7d1(0xe9)](_0x300863));}catch(_0x9546d7){_0x2dfc0b(_0x9546d7);}},_0x301a54=_0x5a164e=>{const _0x51b13f=_0x1301;try{_0x34f38a(_0x4cc304[_0x51b13f(_0x2c160d._0x5c1f27)](_0x5a164e));}catch(_0x199ef4){_0x2dfc0b(_0x199ef4);}},_0x34f38a=_0x4ba69b=>_0x4ba69b['done']?_0x565c41(_0x4ba69b[_0x293180(0xdb)]):Promise['resolve'](_0x4ba69b[_0x293180(0xdb)])['then'](_0x2aeac6,_0x301a54);_0x34f38a((_0x4cc304=_0x4cc304[_0x293180(_0x2d60b2._0x1f2408)](_0x14d30f,_0x6a36a5))[_0x293180(0xe9)]());});};function onSettings(){const _0xd81328={_0x50e1b2:0xfe,_0xb098b:0xe5,_0x8a736d:0xe1};return __async(this,null,function*(){const _0x2e9c9c=_0x1301;return[{'type':_0x2e9c9c(_0xd81328._0x50e1b2),'label':_0x2e9c9c(_0xd81328._0xb098b)},{'type':_0x2e9c9c(_0xd81328._0x8a736d),'key':'langEnglish','label':_0x2e9c9c(0xd3),'defaultValue':!![]},{'type':'toggle','key':_0x2e9c9c(0xf4),'label':'Enable\x20Hindi\x20🇮🇳','defaultValue':!![]}];});}var PROVIDER_NAME=_0x5df61e(0xfa),CINESCRAPE_BASE='https://pengu.uk/%7B%22source_moviebox%22%3A%22on%22%2C%22res_1080%22%3A%22on%22%2C%22disable_direct%22%3A%22on%22%2C%22auth_token%22%3A%22XwZg2rLkLlbjXBeDVCyxgfHXjxN1ijLMkUuToW8KaKc%22%7D',TMDB_API_KEY=_0x5df61e(0xd5);function getStreams(_0x5a32a7,_0x2fe227,_0x328cc2,_0x2733e2){const _0x11a400={_0x5d2410:0xe4,_0x277c11:0xfb,_0x19fe37:0xd6,_0x4a3bd8:0xde,_0x4dbb50:0xee,_0x56fb4e:0xff,_0x4eae8d:0xd1,_0x21c047:0xcf,_0x53d823:0xd4};return __async(this,null,function*(){const _0x39b341={_0x3e3e69:0xd8},_0xb642cf=_0x1301;var _0xd04b39;const _0x700f53=_0x2fe227==='tv'||_0x2fe227===_0xb642cf(0xda),_0x59c3c7=_0xb642cf(_0x11a400._0x5d2410)+(_0x700f53?'tv':'movie')+'/'+_0x5a32a7+_0xb642cf(_0x11a400._0x277c11)+TMDB_API_KEY+_0xb642cf(_0x11a400._0x19fe37);try{const _0x3699f4=globalThis['SCRAPER_SETTINGS']||{},_0x51ddfd=_0x3699f4['langEnglish']!==![],_0x2601af=_0x3699f4['langHindi']!==![],_0x11cd2f=yield fetch(_0x59c3c7)['then'](_0xLine truncated
/**
* moviebox - Built from src/moviebox/
* Generated: 2026-09-29T14:51:11.980Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/moviebox/constants.js
var API_BASE = "https://api3.aoneroom.com";
var PLAYER_BASE = "https://moviebox.ph";
var PLAYER_USER_AGENT = "Mozilla/5.0 (Linux; Android 15; Pixel 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Mobile Safari/537.36";
var HOST_POOL = [
"https://api6.aoneroom.com",
"https://api5.aoneroom.com",
"https://api4.aoneroom.com",
"https://api4sg.aoneroom.com",
"https://api3.aoneroom.com"
];
var KEY_B64_DEFAULT = "NzZpUmwwN3MweFNOOWpxbUVXQXQ3OUVCSlp1bElRSXNWNjRGWnIyTw==";
var KEY_B64_ALT = "WHFuMm5uTzQxL0w5Mm8xaXVYaFNMSFRiWHZZNFo1Wlo2Mm04bVNMQQ==";
var TMDB_API_KEY = "1865f43a0549ca50d341dd9ab8b29f49";
var TMDB_BASE_URL = "https://api.themoviedb.org/3";
var BRAND_MODELS = {
"Samsung": ["SM-S918B", "SM-A528B", "SM-M336B"],
"Xiaomi": ["2201117TI", "M2012K11AI", "Redmi Note 11"],
"OnePlus": ["LE2111", "CPH2449", "IN2023"],
"Google": ["Pixel 6", "Pixel 7", "Pixel 8"],
"Realme": ["RMX3085", "RMX3360", "RMX3551"]
};
var TOKEN_URL = "https://apig.inmoviebox.com/wefeed-mobile-bff/tab/ranking-list?tabId=0&categoryType=4516404531735022304&page=1&perPage=1";
var PACKAGE_INFO = {
package_name: "com.community.mbox.in",
version_name: "4.0.03.0920.03",
version_code: 50020130
};
// src/moviebox/utils.js
var import_crypto_js = __toESM(require("crypto-js"));
var SECRET_KEY_DEFAULT = import_crypto_js.default.enc.Base64.parse(
import_crypto_js.default.enc.Base64.parse(KEY_B64_DEFAULT).toString(import_crypto_js.default.enc.Utf8)
);
var SECRET_KEY_ALT = import_crypto_js.default.enc.Base64.parse(
import_crypto_js.default.enc.Base64.parse(KEY_B64_ALT).toString(import_crypto_js.default.enc.Utf8)
);
var deviceId = "";
var selectedBrand = "";
var selectedModel = "";
var bearerToken = null;
function decodeJwtExpiry(token) {
try {
const parts = token.split(".");
if (parts.length < 2)
return 0;
let base64 = parts[1].replace(/-/g, "+").replace(/_/g, "/");
while (base64.length % 4) {
base64 += "=";
}
const parsed = import_crypto_js.default.enc.Base64.parse(base64).toString(import_crypto_js.default.enc.Utf8);
const json = JSON.parse(parsed);
return json.exp || 0;
} catch (e) {
return 0;
}
}
function isTokenValid(token) {
if (!token)
return false;
const exp = decodeJwtExpiry(token);
return exp > Date.now() / 1e3 + 3600;
}
function getCachedToken() {
return __async(this, null, function* () {
if (isTokenValid(bearerToken))
return bearerToken;
console.log("[MovieBox] Fetching fresh anonymous token...");
const url = TOKEN_URL;
const res = yield movieBoxRequest("GET", url, null, {}, true);
if (res && res.headers) {
const xUser = res.headers.get("x-user");
if (xUser) {
try {
const xUserJson = JSON.parse(xUser);
const token = xUserJson.token;
if (token && isTokenValid(token)) {
bearerToken = token;
return token;
}
} catch (e) {
console.error("[MovieBox] Failed to parse x-user header for token", e);
}
}
}
return bearerToken || "";
});
}
function initializeSession() {
if (!deviceId) {
let chars = "0123456789abcdef";
for (let i = 0; i < 32; i++) {
deviceId += chars[Math.floor(Math.random() * 16)];
}
const brands = Object.keys(BRAND_MODELS);
selectedBrand = brands[Math.floor(Math.random() * brands.length)];
const models = BRAND_MODELS[selectedBrand];
selectedModel = models[Math.floor(Math.random() * models.length)];
}
}
function md5(input) {
return import_crypto_js.default.MD5(input).toString(import_crypto_js.default.enc.Hex);
}
function hmacMd5(key, data) {
return import_crypto_js.default.HmacMD5(data, key).toString(import_crypto_js.default.enc.Base64);
}
function generateXClientToken(timestamp) {
const ts = (timestamp || Date.now()).toString();
const reversed = ts.split("").reverse().join("");
const hash = md5(reversed);
return `${ts},${hash}`;
}
function buildCanonicalString(method, accept, contentType, url, body, timestamp) {
let path = "";
let query = "";
try {
const urlObj = new URL(url);
path = urlObj.pathname;
const params = Array.from(urlObj.searchParams.keys()).sort();
if (params.length > 0) {
query = params.map((key) => {
const values = urlObj.searchParams.getAll(key);
return values.map((val) => `${key}=${val}`).join("&");
}).join("&");
}
} catch (e) {
if (url.includes("?")) {
const parts = url.split("?");
path = parts[0].replace(/https?:\/\/[^\/]+/, "");
const qParts = parts[1].split("&").sort();
query = qParts.join("&");
} else {
path = url.replace(/https?:\/\/[^\/]+/, "");
}
}
const canonicalUrl = query ? `${path}?${query}` : path;
let bodyHash = "";
let bodyLength = "";
if (body) {
const bodyWords = import_crypto_js.default.enc.Utf8.parse(body);
const totalBytes = bodyWords.sigBytes;
bodyHash = md5(bodyWords);
bodyLength = totalBytes.toString();
}
return `${method.toUpperCase()}
${accept || ""}
${contentType || ""}
${bodyLength}
${timestamp}
${bodyHash}
` + canonicalUrl;
}
function generateXTrSignature(method, accept, contentType, url, body, useAltKey = false, customTimestamp = null) {
const timestamp = customTimestamp || Date.now();
const canonical = buildCanonicalString(method, accept, contentType, url, body, timestamp);
const secret = useAltKey ? SECRET_KEY_ALT : SECRET_KEY_DEFAULT;
const signatureB64 = hmacMd5(secret, canonical);
return `${timestamp}|2|${signatureB64}`;
}
function movieBoxRequest(_0, _1) {
return __async(this, arguments, function* (method, url, body = null, customHeaders = {}, isTokenFetch = false) {
initializeSession();
const timestamp = Date.now();
const xClientToken = generateXClientToken(timestamp);
const headerContentType = customHeaders["Content-Type"] || (body ? "application/json; charset=utf-8" : "application/json");
const accept = customHeaders["Accept"] || "application/json";
const xTrSignature = generateXTrSignature(method, accept, headerContentType, url, body, false, timestamp);
const xClientInfo = JSON.stringify(__spreadProps(__spreadValues({}, PACKAGE_INFO), {
os: "android",
os_version: "14",
device_id: deviceId,
install_store: "official",
gaid: "1b2212c1-dadf-43c3-a0c8-bd6ce48ae22d",
brand: selectedBrand.toLowerCase(),
model: selectedModel,
system_language: "en",
net: "NETWORK_WIFI",
region: "IN",
timezone: "Asia/Calcutta",
sp_code: ""
}));
const headers = __spreadValues({
"Accept": accept,
"Content-Type": headerContentType,
"x-client-token": xClientToken,
"x-tr-signature": xTrSignature,
"User-Agent": `${PACKAGE_INFO.package_name}/${PACKAGE_INFO.version_code} (Linux; U; Android 14; en_IN; ${selectedModel}; Build/UD1A.230803.041; Cronet/145.0.7582.0)`,
"x-client-info": xClientInfo,
"x-client-status": "0"
}, customHeaders);
if (!isTokenFetch) {
const token = yield getCachedToken();
if (token) {
headers["Authorization"] = `Bearer ${token}`;
}
}
const options = {
method,
headers
};
if (body) {
options.body = body;
}
let originalUrl;
try {
originalUrl = new URL(url);
} catch (_) {
return null;
}
const apiHosts = new Set(HOST_POOL.map((host) => new URL(host).host));
const hosts = apiHosts.has(originalUrl.host) ? [originalUrl.host, ...HOST_POOL.map((host) => new URL(host).host).filter((host) => host !== originalUrl.host)] : [originalUrl.host];
const maxAttempts = Math.min(3, hosts.length);
for (let attempt = 0; attempt < maxAttempts; attempt++) {
try {
const requestUrl = new URL(originalUrl.toString());
requestUrl.host = hosts[attempt];
const res = yield fetch(requestUrl.toString(), options);
if (!res.ok) {
if ((res.status === 403 || res.status === 429 || res.status >= 500) && attempt + 1 < maxAttempts) {
continue;
}
return null;
}
const text = yield res.text();
let parsed = null;
try {
parsed = JSON.parse(text);
} catch (e) {
parsed = text;
}
if (res.headers) {
const xUser = res.headers.get("x-user");
if (xUser) {
try {
const xUserJson = JSON.parse(xUser);
const token = xUserJson.token;
if (token && isTokenValid(token)) {
bearerToken = token;
}
} catch (e) {
}
}
}
return {
data: parsed,
headers: res.headers
};
} catch (err) {
if (attempt + 1 === maxAttempts) {
console.error("[MovieBox Request Error]", err.message);
return null;
}
}
}
return null;
});
}
function fetchTmdbDetails(tmdbId, mediaType) {
return __async(this, null, function* () {
var _a;
try {
const url = `${TMDB_BASE_URL}/${mediaType}/${tmdbId}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
const res = yield fetch(url, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36",
"Accept": "application/json",
"Connection": "keep-alive"
}
});
const data = yield res.json();
return {
title: mediaType === "movie" ? data.title || data.original_title : data.name || data.original_name,
year: (data.release_date || data.first_air_date || "").substring(0, 4),
imdbId: (_a = data.external_ids) == null ? void 0 : _a.imdb_id,
originalTitle: data.original_title || data.original_name
};
} catch (e) {
console.error("[MovieBox TMDB Error]", e.message);
return null;
}
});
}
function normalizeTitle(s) {
if (!s)
return "";
return String(s).replace(/\[[^\]]*\]/g, " ").replace(/\([^)]*\)/g, " ").replace(/\b(dub|dubbed|hd|4k|hindi|tamil|telugu|dual audio)\b/gi, " ").trim().toLowerCase().replace(/:/g, " ").replace(/[^\w\s]/g, " ").replace(/\s+/g, " ");
}
function parseQualityNumber(value) {
const match = String(value || "").match(/(\d{3,4})/);
return match ? parseInt(match[1], 10) : 0;
}
function getFormatType(url) {
const u = String(url || "").toLowerCase();
if (u.includes(".mpd"))
return "DASH";
if (u.includes(".m3u8"))
return "HLS";
if (u.includes(".mp4"))
return "MP4";
if (u.includes(".mkv"))
return "MKV";
return "VIDEO";
}
function extractPolicyResource(signCookie) {
var _a, _b;
if (!signCookie || typeof signCookie !== "string")
return null;
const edgeMatch = signCookie.match(/Edge-Cache-Cookie=urlprefix=([^:;\s]+)/);
if (edgeMatch) {
try {
let std = edgeMatch[1].replace(/_/g, "/").replace(/-/g, "+");
const rem = (4 - std.length % 4) % 4;
if (rem > 0)
std += "=".repeat(rem);
const decoded = import_crypto_js.default.enc.Base64.parse(std).toString(import_crypto_js.default.enc.Utf8).replace(/\/+$/, "");
if (decoded)
return `${decoded}/index.mpd`;
} catch (_) {
}
}
const cfMatch = signCookie.match(/CloudFront-Policy=([^;]+)/);
if (cfMatch) {
try {
const policyRaw = cfMatch[1];
let cfB64 = policyRaw.replace(/-/g, "+").replace(/~/g, "/").replace(/_/g, "=");
const rem = cfB64.length % 4;
if (rem > 0)
cfB64 += "=".repeat(rem);
let decodedJson = null;
try {
decodedJson = import_crypto_js.default.enc.Base64.parse(cfB64).toString(import_crypto_js.default.enc.Utf8);
} catch (_) {
let stdB64 = policyRaw.replace(/-/g, "+").replace(/_/g, "/");
const rem2 = stdB64.length % 4;
if (rem2 > 0)
stdB64 += "=".repeat(rem2);
decodedJson = import_crypto_js.default.enc.Base64.parse(stdB64).toString(import_crypto_js.default.enc.Utf8);
}
if (decodedJson) {
const root = JSON.parse(decodedJson);
const resource = (_b = (_a = root == null ? void 0 : root.Statement) == null ? void 0 : _a[0]) == null ? void 0 : _b.Resource;
if (resource && typeof resource === "string") {
const trimmed = resource.replace(/[\*\/]+$/, "");
return trimmed.toLowerCase().endsWith(".mpd") ? trimmed : `${trimmed}/index.mpd`;
}
}
} catch (_) {
}
}
return null;
}
// src/moviebox/index.js
function getStreams(tmdbId, mediaType, seasonNum = 1, episodeNum = 1) {
return __async(this, null, function* () {
console.log(`[MovieBox] Querying streams for TMDB: ${tmdbId}, Type: ${mediaType}`);
const details = yield fetchTmdbDetails(tmdbId, mediaType);
if (!details)
return [];
let subjects = yield searchMovieBox(details.title);
let bestMatch = findBestMatch(subjects, details.title, details.year, mediaType);
if (!bestMatch && details.originalTitle && details.originalTitle !== details.title) {
subjects = yield searchMovieBox(details.originalTitle);
bestMatch = findBestMatch(subjects, details.originalTitle, details.year, mediaType);
}
if (bestMatch) {
const s = mediaType === "tv" ? seasonNum : 0;
const e = mediaType === "tv" ? episodeNum : 0;
return yield getStreamLinks(bestMatch.subjectId, s, e, details.title, mediaType);
}
console.log(`[MovieBox] No matching content found for: ${details.title}`);
return [];
});
}
function searchMovieBox(query) {
return __async(this, null, function* () {
const url = `${API_BASE}/wefeed-mobile-bff/subject-api/search/v2`;
const body = JSON.stringify({ page: 1, perPage: 20, keyword: query, restrictKid: 1 });
const response = yield movieBoxRequest("POST", url, body);
if (response && response.data && response.data.data && response.data.data.results) {
let allSubjects = [];
response.data.data.results.forEach((group) => {
if (group.subjects) {
allSubjects = allSubjects.concat(group.subjects);
}
});
return allSubjects;
}
return [];
});
}
function findBestMatch(subjects, tmdbTitle, tmdbYear, mediaType) {
const normTmdbTitle = normalizeTitle(tmdbTitle);
const targetType = mediaType === "movie" ? 1 : 2;
let bestMatch = null;
let bestScore = 0;
for (const subject of subjects) {
if (subject.subjectType !== targetType)
continue;
const title = subject.title;
const normTitle = normalizeTitle(title);
const year = subject.year || (subject.releaseDate ? subject.releaseDate.substring(0, 4) : null);
let score = 0;
if (normTitle === normTmdbTitle)
score += 50;
else if (normTitle.includes(normTmdbTitle) || normTmdbTitle.includes(normTitle))
score += 15;
if (tmdbYear && year && tmdbYear == year)
score += 35;
if (score > bestScore) {
bestScore = score;
bestMatch = subject;
}
}
if (bestScore >= 40)
return bestMatch;
return null;
}
function getPlaybackPage(subjectData, subjectId) {
const candidates = [subjectData.detailPath, subjectData.detail_path, subjectData.path, subjectData.slug];
let detailPath = candidates.find((value) => typeof value === "string" && value.trim());
let webBase = PLAYER_BASE;
for (const value of [subjectData.detailDomain, subjectData.webDomain, subjectData.webUrl, subjectData.detailUrl, subjectData.shareUrl]) {
if (typeof value !== "string")
continue;
try {
const parsed = new URL(value.startsWith("http") ? value : `https://${value}`);
if (!parsed.hostname.endsWith("aoneroom.com"))
webBase = parsed.origin;
if (!detailPath && parsed.pathname && parsed.pathname !== "/")
detailPath = parsed.pathname;
break;
} catch (e) {
}
}
if (!detailPath)
return { webBase, referer: `${webBase}/` };
detailPath = detailPath.replace(/^\/+/, "").replace(/^movies\//, "");
const pageUrl = new URL(`/movies/${detailPath}`, `${webBase}/`);
pageUrl.searchParams.set("id", subjectId);
pageUrl.searchParams.set("type", "/movie/detail");
pageUrl.searchParams.set("detailSe", "");
pageUrl.searchParams.set("detailEp", "");
pageUrl.searchParams.set("lang", "en");
return { webBase, detailPath, referer: pageUrl.toString() };
}
function collectStreams(playData) {
var _a, _b;
const streams = Array.isArray(playData == null ? void 0 : playData.streams) ? [...playData.streams] : [];
for (const [key, format] of [["netDash", "DASH"], ["netHls", "HLS"]]) {
const value = (_b = playData == null ? void 0 : playData[key]) != null ? _b : (_a = playData == null ? void 0 : playData.data) == null ? void 0 : _a[key];
const values = Array.isArray(value) ? value : value ? [value] : [];
for (const item of values) {
if (typeof item === "string")
streams.push({ url: item, format });
else if (item && typeof item === "object") {
if (item.url || item.playUrl || item.resourceLink || item.streamUrl)
streams.push(__spreadProps(__spreadValues({}, item), { format: item.format || format }));
else
for (const [resolution, url] of Object.entries(item)) {
if (typeof url === "string" && /^https?:\/\//i.test(url))
streams.push({ url, resolution, format });
else if (url && typeof url === "object")
streams.push(__spreadProps(__spreadValues({}, url), { resolution: url.resolution || resolution, format: url.format || format }));
}
}
}
}
const seen = /* @__PURE__ */ new Set();
return streams.filter((stream) => {
const key = (stream == null ? void 0 : stream.url) || (stream == null ? void 0 : stream.playUrl) || (stream == null ? void 0 : stream.resourceLink) || (stream == null ? void 0 : stream.streamUrl);
if (!key || seen.has(key))
return false;
seen.add(key);
return true;
});
}
function getAudioLabel(stream, fallbackLanguage) {
var _a, _b;
const rawLanguage = [stream.languageName, stream.lanName, stream.language, stream.lan, fallbackLanguage].find((value) => typeof value === "string" && value.trim()) || "Unknown";
let language = rawLanguage.replace(/\bdub\b/gi, " ").replace(/\baudio\b/gi, " ").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim();
const languageNames = {
ar: "Arabic",
bn: "Bengali",
de: "German",
en: "English",
es: "Spanish",
fr: "French",
hi: "Hindi",
id: "Indonesian",
it: "Italian",
ja: "Japanese",
ko: "Korean",
ml: "Malayalam",
mr: "Marathi",
pt: "Portuguese",
ru: "Russian",
ta: "Tamil",
te: "Telugu",
th: "Thai",
tr: "Turkish",
ur: "Urdu",
vi: "Vietnamese",
zh: "Chinese"
};
const languageCode = (_b = (_a = language.match(/^([a-z]{2,3})(?:\s|$)/i)) == null ? void 0 : _a[1]) == null ? void 0 : _b.toLowerCase();
if (languageCode && languageNames[languageCode]) {
language = languageNames[languageCode];
} else if (language) {
language = language.charAt(0).toUpperCase() + language.slice(1);
} else {
language = "Unknown";
}
return `${language} Audio`;
}
function getStreamLinks(subjectId, season = 0, episode = 0, mediaTitle = "", mediaType = "movie") {
return __async(this, null, function* () {
const subjectUrl = `${API_BASE}/wefeed-mobile-bff/subject-api/get?subjectId=${subjectId}`;
const detailRes = yield movieBoxRequest("GET", subjectUrl);
if (!detailRes || !detailRes.data || !detailRes.data.data)
return [];
const subjectData = detailRes.data.data;
const playbackPage = getPlaybackPage(subjectData, subjectId);
const subjectIds = [];
let originalLang = "Original";
const dubs = subjectData.dubs;
if (Array.isArray(dubs)) {
dubs.forEach((dub) => {
if (dub.subjectId == subjectId) {
originalLang = dub.lanName || "Original";
} else {
subjectIds.push({ id: dub.subjectId, lang: dub.lanName });
}
});
}
subjectIds.unshift({ id: subjectId, lang: originalLang });
const allStreams = [];
const playbackHeaders = {
"Origin": playbackPage.webBase,
"Referer": playbackPage.referer,
"User-Agent": PLAYER_USER_AGENT,
"x-request-lang": "en",
"x-vip-restrict": "0",
"x-no-high-risk-restrict": "0"
};
for (const item of subjectIds) {
try {
const playParams = new URLSearchParams({ subjectId: item.id, se: season, ep: episode, streamSignType: "1" });
if (playbackPage.detailPath)
playParams.set("detailPath", playbackPage.detailPath);
playParams.set("supportCodecs[hevc]", "1");
playParams.set("supportCodecs[h264]", "1");
const playUrl = `${API_BASE}/wefeed-mobile-bff/subject-api/play-info?${playParams.toString()}`;
const playRes = yield movieBoxRequest("GET", playUrl, null, playbackHeaders);
let hasValidStream = false;
if (playRes && playRes.data && playRes.data.data) {
const playData = playRes.data.data;
const streamsList = collectStreams(playData);
if (Array.isArray(streamsList) && streamsList.length > 0) {
for (const stream of streamsList) {
const rawStreamUrl = stream.url || stream.playUrl || stream.resourceLink || stream.streamUrl || "";
const signCookie = stream.signCookie || null;
const policyUrl = extractPolicyResource(signCookie);
const finalStreamUrl = policyUrl || rawStreamUrl;
if (!finalStreamUrl)
continue;
if (finalStreamUrl.includes("b164fbfb4347792950bdfbfb563d39d9"))
continue;
if (finalStreamUrl === rawStreamUrl && rawStreamUrl.includes("/other/2026/09/"))
continue;
let formatType = getFormatType(finalStreamUrl);
if (stream.format) {
const declaredFormat = String(stream.format).toUpperCase();
formatType = ["DASH", "HLS", "MP4", "MKV"].includes(declaredFormat) ? declaredFormat : getFormatType(finalStreamUrl);
}
const qualLabel = stream.resolutions || stream.resolution || stream.quality || "Auto";
const qualNum = parseQualityNumber(qualLabel);
const quality = qualNum ? `${qualNum}p` : "Auto";
const audioLabel = getAudioLabel(stream, item.lang);
const streamId = stream.id || `${item.id}|${season}|${episode}`;
const subtitles = yield fetchSubtitles(item.id, streamId, item.lang);
const signHeaderKey = stream.signHeaderKey || stream.sign_header_key || "Cookie";
allStreams.push({
name: "MovieBox",
title: `${mediaTitle}${season > 0 ? ` S${season}E${episode}` : ""} - ${quality} (${audioLabel}) [${formatType}]`,
url: finalStreamUrl,
quality,
headers: __spreadValues(__spreadValues({}, playbackHeaders), signCookie ? { [signHeaderKey]: signCookie } : {}),
subtitles,
provider: "moviebox"
});
hasValidStream = true;
}
}
if (!hasValidStream) {
let detectors = playData.resourceDetectors;
if (!Array.isArray(detectors)) {
detectors = subjectData.resourceDetectors;
}
if (Array.isArray(detectors)) {
for (const detector of detectors) {
if (Array.isArray(detector.resolutionList)) {
for (const video of detector.resolutionList) {
if (!video.resourceLink)
continue;
const se = video.se != null ? video.se : 0;
const ep = video.ep != null ? video.ep : 0;
if ((season > 0 || episode > 0) && (se !== season || ep !== episode)) {
continue;
}
const quality = video.resolution ? `${video.resolution}p` : "Auto";
const audioLabel = getAudioLabel({}, item.lang);
allStreams.push({
name: "MovieBox",
title: `${mediaTitle}${season > 0 ? ` S${season}E${episode}` : ""} - ${quality} (${audioLabel}) [Fallback]`,
url: video.resourceLink,
quality,
headers: __spreadValues({}, playbackHeaders),
provider: "moviebox"
});
}
}
}
}
}
}
} catch (err) {
console.error(`[MovieBox Stream Fetch Error] ID: ${item.id}`, err.message);
}
}
const qualityRank = {
"2160p": 2160,
"4k": 2160,
"1440p": 1440,
"1080p": 1080,
"720p": 720,
"480p": 480,
"360p": 360,
"240p": 240,
"auto": 1
};
allStreams.sort((a, b) => {
var _a, _b;
const qa = qualityRank[(_a = a.quality) == null ? void 0 : _a.toLowerCase()] || 0;
const qb = qualityRank[(_b = b.quality) == null ? void 0 : _b.toLowerCase()] || 0;
return qb - qa;
});
return allStreams;
});
}
function fetchSubtitles(subjectId, streamId, langLabel) {
return __async(this, null, function* () {
const subtitles = [];
try {
const streamCapUrl = `${API_BASE}/wefeed-mobile-bff/subject-api/get-stream-captions?subjectId=${subjectId}&streamId=${streamId}`;
const capRes = yield movieBoxRequest("GET", streamCapUrl, null);
if (capRes && capRes.data && capRes.data.data && Array.isArray(capRes.data.data.extCaptions)) {
capRes.data.data.extCaptions.forEach((cap) => {
if (cap.url) {
subtitles.push({
url: cap.url,
language: cap.language || cap.lanName || cap.lan || "en",
name: `${cap.lanName || cap.language || "Subtitle"} (${langLabel})`,
headers: { "Referer": API_BASE }
});
}
});
}
} catch (e) {
}
try {
const extCapUrl = `${API_BASE}/wefeed-mobile-bff/subject-api/get-ext-captions?subjectId=${subjectId}&resourceId=${streamId}&episode=0`;
const extRes = yield movieBoxRequest("GET", extCapUrl, null);
if (extRes && extRes.data && extRes.data.data && Array.isArray(extRes.data.data.extCaptions)) {
extRes.data.data.extCaptions.forEach((cap) => {
if (cap.url) {
subtitles.push({
url: cap.url,
language: cap.lan || cap.lanName || cap.language || "en",
name: `${cap.lanName || cap.lan || "Subtitle"} (${langLabel})`,
headers: { "Referer": API_BASE }
});
}
});
}
} catch (e) {
}
return subtitles;
});
}
module.exports = { getStreams };
+435 -1
View File
@@ -1 +1,435 @@
var _0x3ddb21=_0x1b28;(function(_0x5efd39,_0x1b68bc){var _0x32b52e={_0x31e9d8:0x185,_0x1e68a4:0x1b9,_0x436187:0x1ab,_0x4ede22:0x1c1,_0x45ccd4:0x187,_0x156ba0:0x16b},_0x26db9d=_0x1b28,_0x4936d8=_0x5efd39();while(!![]){try{var _0x39fe8e=-parseInt(_0x26db9d(_0x32b52e._0x31e9d8))/0x1*(parseInt(_0x26db9d(_0x32b52e._0x1e68a4))/0x2)+parseInt(_0x26db9d(0x191))/0x3*(parseInt(_0x26db9d(0x1b7))/0x4)+parseInt(_0x26db9d(_0x32b52e._0x436187))/0x5+-parseInt(_0x26db9d(_0x32b52e._0x4ede22))/0x6*(parseInt(_0x26db9d(0x188))/0x7)+-parseInt(_0x26db9d(_0x32b52e._0x45ccd4))/0x8+-parseInt(_0x26db9d(_0x32b52e._0x156ba0))/0x9*(parseInt(_0x26db9d(0x1d1))/0xa)+-parseInt(_0x26db9d(0x1a5))/0xb*(-parseInt(_0x26db9d(0x1a7))/0xc);if(_0x39fe8e===_0x1b68bc)break;else _0x4936d8['push'](_0x4936d8['shift']());}catch(_0x1eb582){_0x4936d8['push'](_0x4936d8['shift']());}}}(_0x1e7a,0x9ef8a));var __defProp=Object[_0x3ddb21(0x1cf)],__defProps=Object[_0x3ddb21(0x1d2)],__getOwnPropDescs=Object[_0x3ddb21(0x175)],__getOwnPropSymbols=Object[_0x3ddb21(0x1c6)],__hasOwnProp=Object[_0x3ddb21(0x1b2)][_0x3ddb21(0x182)],__propIsEnum=Object[_0x3ddb21(0x1b2)][_0x3ddb21(0x176)],__defNormalProp=(_0x2ee21e,_0x9cbb11,_0x1207f5)=>_0x9cbb11 in _0x2ee21e?__defProp(_0x2ee21e,_0x9cbb11,{'enumerable':!![],'configurable':!![],'writable':!![],'value':_0x1207f5}):_0x2ee21e[_0x9cbb11]=_0x1207f5,__spreadValues=(_0x480f16,_0x1472e7)=>{var _0x39ddb0={_0x1c6c1c:0x18b},_0xd84ed7=_0x3ddb21;for(var _0xe3415d in _0x1472e7||(_0x1472e7={}))if(__hasOwnProp[_0xd84ed7(_0x39ddb0._0x1c6c1c)](_0x1472e7,_0xe3415d))__defNormalProp(_0x480f16,_0xe3415d,_0x1472e7[_0xe3415d]);if(__getOwnPropSymbols)for(var _0xe3415d of __getOwnPropSymbols(_0x1472e7)){if(__propIsEnum[_0xd84ed7(0x18b)](_0x1472e7,_0xe3415d))__defNormalProp(_0x480f16,_0xe3415d,_0x1472e7[_0xe3415d]);}return _0x480f16;},__spreadProps=(_0x4e6c84,_0x3807c1)=>__defProps(_0x4e6c84,__getOwnPropDescs(_0x3807c1)),__async=(_0x5b3bff,_0x2e179d,_0x1b79c8)=>{var _0x9b6f33={_0x2adfb8:0x17b};return new Promise((_0xf8680c,_0x315523)=>{var _0x1ad00f=_0x1b28,_0x5d0b89=_0xae726=>{try{_0x502c30(_0x1b79c8['next'](_0xae726));}catch(_0x1611a9){_0x315523(_0x1611a9);}},_0x2bc555=_0x73e0dd=>{try{_0x502c30(_0x1b79c8['throw'](_0x73e0dd));}catch(_0x21f7af){_0x315523(_0x21f7af);}},_0x502c30=_0x2e42b7=>_0x2e42b7[_0x1ad00f(0x193)]?_0xf8680c(_0x2e42b7['value']):Promise['resolve'](_0x2e42b7['value'])['then'](_0x5d0b89,_0x2bc555);_0x502c30((_0x1b79c8=_0x1b79c8[_0x1ad00f(_0x9b6f33._0x2adfb8)](_0x5b3bff,_0x2e179d))['next']());});},PROVIDER_NAME=_0x3ddb21(0x199),MAIN_URL='https://new1.moviesdrive.christmas',ARCHIVE_DOMAIN=_0x3ddb21(0x18e),TMDB_KEY='439c478a771f35c05022f9feabcca01c',MOBILE_UAS=[_0x3ddb21(0x1a4),_0x3ddb21(0x1b4),_0x3ddb21(0x1bc),'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2017_0\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/17.0\x20Mobile/15E148\x20Safari/604.1','Mozilla/5.0\x20(iPad;\x20CPU\x20OS\x2017_0\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/17.0\x20Mobile/15E148\x20Safari/604.1'];function getHeaders(_0x1fa484){var _0x1ff31e={_0x3dffc3:0x1b0,_0x558810:0x18f,_0x59d52f:0x1a3},_0x5f280d=_0x3ddb21,_0x35ba14=MOBILE_UAS[Math[_0x5f280d(_0x1ff31e._0x3dffc3)](Math[_0x5f280d(_0x1ff31e._0x558810)]()*MOBILE_UAS[_0x5f280d(_0x1ff31e._0x59d52f)])],_0x310ec5={'User-Agent':_0x35ba14,'Accept-Language':_0x5f280d(0x177)};if(_0x1fa484)for(var _0x2f2f4c in _0x1fa484){_0x310ec5[_0x2f2f4c]=_0x1fa484[_0x2f2f4c];}return _0x310ec5;}function _0x1e7a(){var _0xb020df=['Bg9N','C2vYAwvZ','zMLYC3rFywLYx2rHDgu','C3rHCNrZv2L0Aa','Bwf4','Aw1KyG','DgL0Bgu','EwvHCG','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9YCW','ChjVCgvYDhLjC0vUDw1LCMfIBgu','zw4TvvmSzw47Ct0WlJK','qxv0BW','DgvZDa','iIaO','yxbWBhK','l3nLyxjJAc5WAha/Ct0','z2v0twLUDxrLCW','AgL0CW','zNvUy3rPB24','C2L6zq','zg9JDw1LBNq','AgfZt3DUuhjVCgvYDhK','Dg9mB3DLCKnHC2u','Ahr0Chm6lY9HCgKUDgHLBw92AwvKyI5VCMCVmY8','mJq0ndn0uhbltMm','ChjVy2vZC2LUzYa','otmWotC2oernDMjVtW','mJeXodGZz1DAC3fh','EgXHpxm0Da','C3vIC3rYAw5N','y2fSBa','C29YDa','Ahr0Ca','Ahr0Chm6lY9TzhjPDMuUBg9S','CMfUzg9T','Ahr0Chm6lY9HCgKUDgHLBw92AwvKyI5VCMCVmY9MAw5KlW','m0TjCeTnvW','rLnm','zg9Uzq','mtq0mha','zxHLyW','zMLSDgvY','zM9YrwfJAa','DgL0BguGBwf0y2G6ia','tw92AwvZrhjPDMu','C2LNBMfS','DgLTzw91Da','C2vHC29U','zMv0y2G6ia','CxvHBgL0Eq','ywjZ','DhjPBq','CMvSzwfZzv9KyxrL','C3bSAxq','BgvUz3rO','tw96AwXSys81lJaGkeXPBNv4oYbbBMrYB2LKide0oYbqAxHLBca4ifbYBYKGqxbWBgvxzwjlAxqVntm3lJm2icHlsfrntcWGBgLRzsbhzwnRBYKGq2HYB21LlZeYnc4WlJaUmcbnB2jPBguGu2fMyxjPlZuZnY4ZnG','mtq0nJKXotfYB3njCwy','rLnmDJi','mtjTwKLJB20','ndGWCa','ihm9','BM8GrLnmihn0CMvHBxmGCMvZB2X2zwq','ntu0mZa2nuPtCLfQsa','ihn0CMvHBxm','vgLTzw91Dca','kdXOwZeTnL1BxJ5DkJ58phn0CM9Uz1TEpL0QpIKUkJ8OpZPtzwfZB258u2fPC29UFfn0ywzMzwWPxhmQmcOOxgqRkvXZkLST4OctxvXZkJaQkfXKkYK','C2vHCMnOihPLCM86ia','zMXVB3i','zNjVBunOyxjdB2rL','ChjVDg90ExbL','CMvWBgfJzq','tw96AwXSys81lJaGkeXPBNv4oYbbBMrYB2LKideZoYbtts1tote4qIKGqxbWBgvxzwjlAxqVntm3lJm2icHlsfrntcWGBgLRzsbhzwnRBYKGqLine truncated
/**
* moviesdrive - Built from src/moviesdrive/
* Generated: 2026-09-26T06:11:02.295Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/moviesdrive/index.js
var import_cheerio_without_node_native2 = __toESM(require("cheerio-without-node-native"));
// src/moviesdrive/constants.js
var MAIN_URL = "https://new4.moviesdrive.christmas";
var DOMAINS_URL = "https://raw.githubusercontent.com/phisher98/TVVVV/refs/heads/main/domains.json";
var HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Language": "en-US,en;q=0.9",
"Cache-Control": "max-age=0",
"Connection": "keep-alive"
};
// src/moviesdrive/utils.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
var cachedMainUrl = "";
function getMainUrl() {
return __async(this, null, function* () {
if (cachedMainUrl)
return cachedMainUrl;
try {
const response = yield fetch(DOMAINS_URL, { headers: { "User-Agent": "Mozilla/5.0" } });
const data = yield response.json();
cachedMainUrl = data.moviesdrive || MAIN_URL;
return cachedMainUrl;
} catch (e) {
return MAIN_URL;
}
});
}
function getIndexQuality(str) {
if (!str)
return 1080;
const match = str.match(/(\d{3,4})[pP]/);
if (match)
return parseInt(match[1]);
if (str.toUpperCase().includes("4K") || str.toUpperCase().includes("2160P") || str.toUpperCase().includes("UHD"))
return 2160;
return 1080;
}
function extractMdrive(url) {
return __async(this, null, function* () {
if (!url)
return [];
const regex = /hubcloud|gdflix|gdlink/i;
if (!url.includes("search-recover.php") && regex.test(url) && (url.includes("/drive/") || url.includes("/file/"))) {
return [url];
}
try {
const res = yield fetch(url, { headers: __spreadProps(__spreadValues({}, HEADERS), { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" }) });
const html = yield res.text();
if (url.includes("search-recover.php")) {
const qMatch = html.match(/const\s+Q_INITIAL\s*=\s*["']([^"']+)["']/);
const tokenMatch = html.match(/const\s+FROM_AC_TOKEN\s*=\s*["']([^"']+)["']/);
if (qMatch && tokenMatch) {
const apiBase = url.split("/drive/")[0];
const searchParams = new URLSearchParams({
api: "search",
q: qMatch[1],
page: "1",
from_ac: tokenMatch[1]
});
const apiRes = yield fetch(`${apiBase}/drive/search-recover.php?${searchParams.toString()}`, {
headers: __spreadProps(__spreadValues({}, HEADERS), { "Accept": "application/json", Referer: url, "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" })
});
const data = yield apiRes.json();
if (data.hits) {
return data.hits.map((h) => h.url).filter(Boolean);
}
}
}
const $ = import_cheerio_without_node_native.default.load(html);
return $("a[href]").map((i, el) => $(el).attr("href")).get().filter((href) => regex.test(href));
} catch (e) {
return [];
}
});
}
function hubCloudExtractor(url, referer) {
return __async(this, null, function* () {
try {
let currentUrl = url;
const pageResponse = yield fetch(currentUrl, {
headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: referer })
});
let pageData = yield pageResponse.text();
let finalUrl = currentUrl;
if (!currentUrl.includes("hubcloud.php")) {
let nextHref = "";
const $first = import_cheerio_without_node_native.default.load(pageData);
const phpLink = $first('a[href*="hubcloud.php"]').attr("href");
if (phpLink) {
nextHref = phpLink;
} else {
const downloadBtn = $first("#download");
if (downloadBtn.length) {
nextHref = downloadBtn.attr("href");
} else {
const scriptUrlMatch = pageData.match(/var url = ["']([^"']*)["']/);
if (scriptUrlMatch)
nextHref = scriptUrlMatch[1];
}
}
if (nextHref) {
if (!nextHref.startsWith("http")) {
const urlObj = new URL(currentUrl);
nextHref = `${urlObj.protocol}//${urlObj.hostname}/${nextHref.replace(/^\//, "")}`;
}
finalUrl = nextHref;
const secondResponse = yield fetch(finalUrl, {
headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: currentUrl })
});
pageData = yield secondResponse.text();
}
}
const $ = import_cheerio_without_node_native.default.load(pageData);
const size = $("i#size").text().trim();
const header = $("div.card-header").text().trim();
const quality = getIndexQuality(header);
const pxlMatch = pageData.match(/var\s+pxl\s*=\s*["']([^"']+)["']/);
const links = [];
const elements = $("a[href]").get();
const blocked = ["tinyurl", "telegram", "hubcloud.cx/tg", "hubcloud.foo/tg"];
for (const el of elements) {
let link = $(el).attr("href");
const text = $(el).text().toLowerCase().trim();
if (!link || blocked.some((b) => link.includes(b)))
continue;
if (link.includes("negn6f") && pxlMatch) {
link = pxlMatch[1];
}
if (text.includes("fslv2")) {
links.push({ name: "HubCloud - FSLv2", quality, url: link, size });
} else if (text.includes("fsl server") || text.includes("fsl") && !text.includes("v2")) {
links.push({ name: "HubCloud - FSL Server", quality, url: link, size });
} else if (text.includes("download file") || text.includes("instant download") || text.includes("instant") || text.includes("10gbps")) {
let streamUrl = link;
if (streamUrl.includes("link=")) {
streamUrl = streamUrl.split("link=")[1];
} else {
try {
const res = yield fetch(link, {
headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: finalUrl }),
redirect: "follow"
});
if (res.url && res.url.startsWith("http")) {
streamUrl = res.url;
if (streamUrl.includes("link=")) {
streamUrl = streamUrl.split("link=")[1];
}
}
} catch (e) {
}
}
if (streamUrl && streamUrl.startsWith("http")) {
links.push({ name: "HubCloud - Instant", quality, url: streamUrl, size });
}
} else if (text.includes("pixeldra") || text.includes("pixelserver") || text.includes("pixeldrain") || link.includes("pixeldrain")) {
let pUrl = link;
if (pUrl.includes("/u/")) {
const fileId = pUrl.split("/u/")[1].split("?")[0].replace("/", "");
pUrl = `https://pixeldrain.dev/api/file/${fileId}?download`;
}
links.push({ name: "HubCloud - Pixeldrain", quality, url: pUrl, size });
} else if (text.includes("buzzserver") || text.includes("buzz server") || text.includes("buzz") || text.includes("fuckingfast")) {
try {
const dlRes = yield fetch(link, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
}
});
const dlHtml = yield dlRes.text();
const copyMatch = dlHtml.match(/copyDownloadLink\(['"]([^'"]+)['"]\)/);
const dlPath = copyMatch ? copyMatch[1].replace(/\\\//g, "/") : null;
const base = new URL(link).origin;
const dlUrl = dlPath ? dlPath.startsWith("http") ? dlPath : `${base}${dlPath}` : link.endsWith("/download") ? link : `${link}/download`;
const resp = yield fetch(dlUrl, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
"Referer": link,
"HX-Request": "true"
},
redirect: "manual"
});
const dlink = resp.headers.get("hx-redirect") || resp.headers.get("location");
if (dlink) {
links.push({ name: "HubCloud - BuzzServer", quality, url: dlink, size });
}
} catch (e) {
}
} else if (text.includes("s3 server")) {
links.push({ name: "HubCloud - S3", quality, url: link, size });
} else if (text.includes("mega server")) {
links.push({ name: "HubCloud - Mega", quality, url: link, size });
} else if (link.includes("r2.dev")) {
links.push({ name: "Direct R2", quality, url: link, size });
} else if (link.includes("workers.dev")) {
links.push({ name: "ZipDisk Server", quality, url: link, size });
}
}
return links;
} catch (e) {
return [];
}
});
}
function loadExtractor(url, referer) {
return __async(this, null, function* () {
try {
const hostname = new URL(url).hostname;
if (hostname.includes("hubcloud"))
return yield hubCloudExtractor(url, referer);
if (hostname.includes("gdflix") || hostname.includes("gdlink"))
return [{ name: "GDFlix", quality: 1080, url }];
return [];
} catch (e) {
return [];
}
});
}
// src/moviesdrive/index.js
function getStreams(tmdbId, mediaType, seasonNum = 1, episodeNum = 1) {
return __async(this, null, function* () {
var _a;
console.log(`[MoviesDrive] Querying streams for TMDB: ${tmdbId}, Type: ${mediaType}`);
const tmdbApiKey = "1865f43a0549ca50d341dd9ab8b29f49";
const tmdbUrl = `https://api.themoviedb.org/3/${mediaType}/${tmdbId}?api_key=${tmdbApiKey}&append_to_response=external_ids`;
const tmdbRes = yield fetch(tmdbUrl, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36",
"Accept": "application/json"
}
});
const tmdbData = yield tmdbRes.json();
const imdbId = (_a = tmdbData.external_ids) == null ? void 0 : _a.imdb_id;
const cleanTitle = tmdbData.title || tmdbData.name || "";
const mainUrl = yield getMainUrl();
let match = null;
const findMatch = (hits) => {
if (!hits || !hits.length)
return null;
if (mediaType === "tv") {
const sSlug = String(seasonNum).padStart(2, "0");
const seasonPatterns = [
new RegExp(`\\bseason\\s*0?${seasonNum}\\b`, "i"),
new RegExp(`\\bs0?${seasonNum}\\b`, "i"),
new RegExp(`\\bseason\\s*${sSlug}\\b`, "i")
];
return hits.find((doc) => {
const postTitle = (doc.post_title || "").toLowerCase();
const permalink2 = (doc.permalink || "").toLowerCase();
const normDocTitle = postTitle.replace(/[^a-z0-9]/g, "");
const normTitle = cleanTitle.toLowerCase().replace(/[^a-z0-9]/g, "");
const titleMatches = normDocTitle.includes(normTitle) || postTitle.includes(cleanTitle.toLowerCase()) || permalink2.includes(cleanTitle.toLowerCase().replace(/ /g, "-"));
const seasonMatches = seasonPatterns.some((pat) => pat.test(postTitle) || pat.test(permalink2));
return titleMatches && seasonMatches;
});
} else {
return hits.find((d) => imdbId && d.imdb_id === imdbId) || hits.find((doc) => {
const postTitle = (doc.post_title || "").toLowerCase();
const permalink2 = (doc.permalink || "").toLowerCase();
const normDocTitle = postTitle.replace(/[^a-z0-9]/g, "");
const normTitle = cleanTitle.toLowerCase().replace(/[^a-z0-9]/g, "");
return normDocTitle.includes(normTitle) || postTitle.includes(cleanTitle.toLowerCase()) || permalink2.includes(cleanTitle.toLowerCase().replace(/ /g, "-"));
}) || hits[0];
}
};
if (imdbId) {
try {
const searchUrl = `${mainUrl}/search.php?q=${imdbId}&page=1`;
const searchRes = yield fetch(searchUrl, { headers: HEADERS });
if (searchRes.ok) {
const searchData = yield searchRes.json();
match = findMatch((searchData.hits || []).map((h) => h.document));
}
} catch (e) {
}
}
if (!match && cleanTitle) {
try {
const searchUrl = `${mainUrl}/search.php?q=${encodeURIComponent(cleanTitle)}&page=1`;
const searchRes = yield fetch(searchUrl, { headers: HEADERS });
if (searchRes.ok) {
const searchData = yield searchRes.json();
match = findMatch((searchData.hits || []).map((h) => h.document));
}
} catch (e) {
}
}
if (!match) {
console.log("[MoviesDrive] No matching post found");
return [];
}
const permalink = match.permalink;
const href = permalink.startsWith("http") ? permalink : `${mainUrl}${permalink}`;
try {
const pageRes = yield fetch(href, { headers: HEADERS });
const pageHtml = yield pageRes.text();
const $ = import_cheerio_without_node_native2.default.load(pageHtml);
const allStreams = [];
if (mediaType === "movie") {
const links = [];
$("h5 a").each((_, a) => {
const h = $(a).attr("href");
if (h)
links.push(h);
});
for (const link of [...new Set(links)]) {
const extracted = yield extractMdrive(link);
for (const server of extracted) {
const streams = yield loadExtractor(server, href);
allStreams.push(...streams.map((s) => __spreadProps(__spreadValues({}, s), {
title: `${cleanTitle} - ${s.name} [${s.quality}p]`,
provider: "moviesdrive"
})));
}
}
} else {
const sSlug = String(seasonNum).padStart(2, "0");
const stag = `Season ${seasonNum}|S${sSlug}`;
const sepRegex = new RegExp(`\\b(?:ep|episode|e)\\s*0?${episodeNum}\\b|s0?${seasonNum}\\s*e0?${episodeNum}\\b`, "i");
const stopRegex = /^\s*(EP\d+|Episode\s*\d+|S\d+E\d+)/i;
const entries = $("h5").filter((i, el) => new RegExp(stag, "i").test($(el).text()));
for (const entry of entries.get()) {
const nextHref = $(entry).next().find("a").attr("href") || $(entry).find("a").attr("href");
if (!nextHref)
continue;
const epPageRes = yield fetch(nextHref, { headers: HEADERS });
const epPageHtml = yield epPageRes.text();
const $ep = import_cheerio_without_node_native2.default.load(epPageHtml);
const epEntries = $ep("h5").filter((i, el) => sepRegex.test($ep(el).text()));
for (const epEntry of epEntries.get()) {
const epLinks = [];
let sibling = $ep(epEntry).next();
while (sibling.length && !stopRegex.test(sibling.text().trim())) {
sibling.find("a[href]").each((_, a) => {
const h = $ep(a).attr("href");
if (h)
epLinks.push(h);
});
sibling = sibling.next();
}
if (epLinks.length === 0) {
const l1 = $ep(epEntry).next().find("a").attr("href");
const l2 = $ep(epEntry).next().next().find("a").attr("href");
[l1, l2].forEach((l) => l && epLinks.push(l));
}
for (const epLink of [...new Set(epLinks)]) {
const extracted = yield extractMdrive(epLink);
for (const server of extracted) {
const streams = yield loadExtractor(server, nextHref);
allStreams.push(...streams.map((s) => __spreadProps(__spreadValues({}, s), {
title: `${cleanTitle} S${seasonNum}E${episodeNum} - ${s.name} [${s.quality}p]`,
provider: "moviesdrive"
})));
}
}
}
}
}
return allStreams;
} catch (e) {
console.error("[MoviesDrive] Error:", e.message);
return [];
}
});
}
module.exports = { getStreams };
+496
View File
@@ -0,0 +1,496 @@
/**
* moviesmod - Built from src/moviesmod/
* Generated: 2026-09-22T08:14:06.813Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/moviesmod/index.js
var import_cheerio_without_node_native2 = __toESM(require("cheerio-without-node-native"));
// src/moviesmod/constants.js
var DOMAINS_URL = "https://raw.githubusercontent.com/phisher98/TVVVV/refs/heads/main/domains.json";
var FALLBACK_DOMAIN = "https://moviesmod.army";
var TMDB_API_KEY = "1865f43a0549ca50d341dd9ab8b29f49";
var TMDB_BASE_URL = "https://api.themoviedb.org/3";
var HEADERS = {
"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",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Language": "en-US,en;q=0.9",
"Cache-Control": "max-age=0",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1"
};
// src/moviesmod/utils.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
var cachedDomain = "";
function getMainUrl() {
return __async(this, null, function* () {
if (cachedDomain)
return cachedDomain;
try {
const response = yield fetch(DOMAINS_URL);
const data = yield response.json();
cachedDomain = data.moviesmod || FALLBACK_DOMAIN;
return cachedDomain;
} catch (e) {
return FALLBACK_DOMAIN;
}
});
}
function getBaseUrl(url) {
try {
const urlObj = new URL(url);
return `${urlObj.protocol}//${urlObj.host}`;
} catch (e) {
return "";
}
}
function fixUrl(url, domain) {
if (!url)
return "";
if (url.startsWith("http"))
return url;
if (url.startsWith("//"))
return `https:${url}`;
if (url.startsWith("/"))
return domain + url;
return `${domain}/${url}`;
}
function bypassHrefli(url) {
return __async(this, null, function* () {
const host = getBaseUrl(url);
try {
const res1 = yield fetch(url, { headers: HEADERS });
const html1 = yield res1.text();
const $1 = import_cheerio_without_node_native.default.load(html1);
const formUrl1 = $1("form#landing").attr("action");
const formData1 = {};
$1("form#landing input").each((_, el) => {
formData1[$1(el).attr("name")] = $1(el).attr("value") || "";
});
const res2 = yield fetch(formUrl1, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), { "Content-Type": "application/x-www-form-urlencoded" }),
body: new URLSearchParams(formData1).toString()
});
const html2 = yield res2.text();
const $2 = import_cheerio_without_node_native.default.load(html2);
const formUrl2 = $2("form#landing").attr("action");
const formData2 = {};
$2("form#landing input").each((_, el) => {
formData2[$2(el).attr("name")] = $2(el).attr("value") || "";
});
const res3 = yield fetch(formUrl2, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), { "Content-Type": "application/x-www-form-urlencoded" }),
body: new URLSearchParams(formData2).toString()
});
const html3 = yield res3.text();
const $3 = import_cheerio_without_node_native.default.load(html3);
const script = $3("script:contains(?go=)").html() || "";
const skTokenMatch = script.match(/\?go=([^"]+)/);
if (!skTokenMatch)
return null;
const skToken = skTokenMatch[1];
const wpHttp2 = formData2["_wp_http2"] || "";
const res4 = yield fetch(`${host}?go=${skToken}`, {
headers: __spreadProps(__spreadValues({}, HEADERS), { "Cookie": `${skToken}=${wpHttp2}` })
});
const html4 = yield res4.text();
const $4 = import_cheerio_without_node_native.default.load(html4);
const metaRefresh = $4('meta[http-equiv="refresh"]').attr("content") || "";
const driveUrlMatch = metaRefresh.match(/url=(.+)/);
if (!driveUrlMatch)
return null;
const driveUrl = driveUrlMatch[1];
const res5 = yield fetch(driveUrl, { headers: HEADERS });
const html5 = yield res5.text();
const pathMatch = html5.match(/replace\("([^"]+)"\)/);
if (!pathMatch || pathMatch[1] === "/404")
return null;
return fixUrl(pathMatch[1], getBaseUrl(driveUrl));
} catch (e) {
return null;
}
});
}
function fetchTmdbDetails(tmdbId, mediaType) {
return __async(this, null, function* () {
var _a;
try {
const url = `${TMDB_BASE_URL}/${mediaType}/${tmdbId}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
const res = yield fetch(url, {
headers: {
"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",
"Accept": "application/json"
}
});
const data = yield res.json();
return {
title: mediaType === "movie" ? data.title || data.original_title : data.name || data.original_name,
year: (data.release_date || data.first_air_date || "").substring(0, 4),
imdbId: (_a = data.external_ids) == null ? void 0 : _a.imdb_id
};
} catch (e) {
return null;
}
});
}
function getIndexQuality(str) {
if (!str)
return "Unknown";
const match = str.match(/(\d{3,4})[pP]/);
if (match)
return match[1] + "p";
if (str.toUpperCase().includes("4K") || str.toUpperCase().includes("UHD"))
return "2160p";
return "Unknown";
}
function extractVideoSeed(finallink) {
return __async(this, null, function* () {
try {
const urlObj = new URL(finallink);
const host = finallink.includes("video-leech") ? "video-leech.xyz" : urlObj.host || "video-seed.xyz";
const token = finallink.includes("?url=") ? finallink.split("?url=")[1] : finallink;
if (!token)
return null;
const res = yield fetch(`https://${host}/api`, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Content-Type": "application/x-www-form-urlencoded",
"x-token": host,
"Referer": finallink,
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
}),
body: `keys=${encodeURIComponent(token)}`
});
const data = yield res.json();
if (data && data.url) {
return data.url.replace(/\\\//g, "/");
}
return null;
} catch (e) {
return null;
}
});
}
function instantLink(url) {
return __async(this, null, function* () {
try {
if (url.includes("cdn.video-gen.xyz")) {
const res = yield fetch(url, { headers: HEADERS, redirect: "follow" });
if (res.url && res.url.includes("url=")) {
const redirected = res.url.split("url=")[1];
if (redirected && !redirected.includes("?url="))
return redirected;
return yield extractVideoSeed(redirected);
}
}
if (url.includes("?url=")) {
return yield extractVideoSeed(url);
}
return url;
} catch (e) {
return null;
}
});
}
function resumeBot(url) {
return __async(this, null, function* () {
try {
const res = yield fetch(url, { headers: HEADERS });
const html = yield res.text();
const setCookie = res.headers.get("set-cookie") || "";
const ssidMatch = setCookie.match(/PHPSESSID=([^;]+)/);
const ssid = ssidMatch ? ssidMatch[1] : "";
const tokenMatch = html.match(/formData\.append\('token',\s*'([a-f0-9]+)'\)/);
const pathMatch = html.match(/fetch\('\/download\?id=([a-zA-Z0-9/+]+)'/);
if (!tokenMatch || !pathMatch)
return null;
const baseUrl = url.substring(0, url.indexOf("/download"));
const downloadUrl = `${baseUrl}/download?id=${pathMatch[1]}`;
const postRes = yield fetch(downloadUrl, {
method: "POST",
headers: __spreadValues(__spreadProps(__spreadValues({}, HEADERS), {
"Accept": "*/*",
"Origin": baseUrl,
"Sec-Fetch-Site": "same-origin",
"Content-Type": "application/x-www-form-urlencoded"
}), ssid ? { "Cookie": `PHPSESSID=${ssid}` } : {}),
body: `token=${encodeURIComponent(tokenMatch[1])}`
});
const data = yield postRes.json();
return data && data.url && data.url.startsWith("http") ? data.url : null;
} catch (e) {
return null;
}
});
}
function CFType1(url) {
return __async(this, null, function* () {
try {
const wfileUrl = url.replace("/file", "/wfile") + "?type=1";
const res = yield fetch(wfileUrl, { headers: HEADERS });
const html = yield res.text();
const $ = import_cheerio_without_node_native.default.load(html);
const links = [];
$("a.btn-success").each((_, el) => {
const h = $(el).attr("href");
if (h && h.startsWith("http"))
links.push(h);
});
return links;
} catch (e) {
return [];
}
});
}
function resumeCloudLink(url) {
return __async(this, null, function* () {
try {
const res = yield fetch(url, { headers: HEADERS });
const html = yield res.text();
const keyMatch = html.match(/formData\.append\(\s*['"]key['"]\s*,\s*['"]([^'"]+)['"]\s*\)/);
if (keyMatch) {
const host = new URL(url).host;
const postRes = yield fetch(url, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Content-Type": "application/x-www-form-urlencoded",
"x-token": host,
"X-Requested-With": "XMLHttpRequest"
}),
body: `action=cloud&key=${encodeURIComponent(keyMatch[1])}&action_token=`
});
const data = yield postRes.json();
if (data && data.url) {
return data.url.replace(/\\\//g, "/");
}
}
const $ = import_cheerio_without_node_native.default.load(html);
return $("a.btn-success").first().attr("href") || null;
} catch (e) {
return null;
}
});
}
function extractDriveseedPage(url) {
return __async(this, null, function* () {
const streams = [];
try {
let pageUrl = url;
if (url.includes("r?key=")) {
const res2 = yield fetch(url, { headers: HEADERS });
const html2 = yield res2.text();
const redirectMatch = html2.match(/replace\("([^"]+)"\)/);
if (redirectMatch) {
pageUrl = getBaseUrl(url) + redirectMatch[1];
}
}
const res = yield fetch(pageUrl, { headers: HEADERS });
const html = yield res.text();
const $ = import_cheerio_without_node_native.default.load(html);
const baseDomain = getBaseUrl(pageUrl);
const nameText = $("li.list-group-item:contains(Name)").first().text() || "";
const sizeText = $("li.list-group-item:contains(Size)").first().text() || $("li:nth-child(3)").text() || "";
const size = sizeText.replace(/.*Size\s*:\s*/i, "").trim();
const quality = getIndexQuality(nameText || $("li.list-group-item").first().text() || "");
const instantHref = $("a.btn-danger").attr("href");
if (instantHref) {
const finalInstant = yield instantLink(instantHref);
if (finalInstant) {
streams.push({ name: "Driveseed Instant", url: finalInstant, quality, size });
}
}
const resumeBotHref = $("a.btn.btn-light").attr("href");
if (resumeBotHref) {
const finalBot = yield resumeBot(resumeBotHref);
if (finalBot) {
streams.push({ name: "Driveseed ResumeBot", url: finalBot, quality, size });
}
}
const cfLinks = yield CFType1(pageUrl);
for (const cfLink of cfLinks) {
streams.push({ name: "Driveseed CF Type1", url: cfLink, quality, size });
}
const resumeCloudHref = $("a.btn-warning").attr("href");
if (resumeCloudHref) {
const fullCloudUrl = resumeCloudHref.startsWith("http") ? resumeCloudHref : `${baseDomain}${resumeCloudHref}`;
const finalCloud = yield resumeCloudLink(fullCloudUrl);
if (finalCloud) {
streams.push({ name: "Driveseed ResumeCloud", url: finalCloud, quality, size });
}
}
} catch (e) {
}
return streams;
});
}
// src/moviesmod/index.js
function getStreams(tmdbId, mediaType, seasonNum = 1, episodeNum = 1) {
return __async(this, null, function* () {
console.log(`[MoviesMod] Querying streams for TMDB: ${tmdbId}, Type: ${mediaType}`);
const details = yield fetchTmdbDetails(tmdbId, mediaType);
if (!details)
return [];
const mainUrl = yield getMainUrl();
console.log(`[MoviesMod] Main URL: ${mainUrl}`);
const query = details.imdbId ? details.imdbId : details.title;
const searchUrl = mediaType === "movie" ? `${mainUrl.replace(/\/$/, "")}/search/${encodeURIComponent(query)}` : `${mainUrl.replace(/\/$/, "")}/search/${encodeURIComponent(query)} ${seasonNum}`;
try {
console.log(`[MoviesMod] Searching at: ${searchUrl}`);
const searchRes = yield fetch(searchUrl, { headers: __spreadProps(__spreadValues({}, HEADERS), { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" }), cfKiller: true });
const searchHtml = yield searchRes.text();
const $search = import_cheerio_without_node_native2.default.load(searchHtml);
let targetUrl = $search("#content_box article > a").first().attr("href") || $search("#content_box article a").first().attr("href");
if (!targetUrl && details.imdbId && details.title) {
const fallbackQuery = mediaType === "movie" ? `${mainUrl.replace(/\/$/, "")}/search/${encodeURIComponent(details.title)}` : `${mainUrl.replace(/\/$/, "")}/search/${encodeURIComponent(details.title)} ${seasonNum}`;
const fallbackRes = yield fetch(fallbackQuery, { headers: __spreadProps(__spreadValues({}, HEADERS), { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" }), cfKiller: true });
const fallbackHtml = yield fallbackRes.text();
const $fallback = import_cheerio_without_node_native2.default.load(fallbackHtml);
targetUrl = $fallback("#content_box article > a").first().attr("href") || $fallback("#content_box article a").first().attr("href");
}
if (!targetUrl) {
console.log("[MoviesMod] No search result found");
return [];
}
const pageRes = yield fetch(targetUrl, { headers: __spreadProps(__spreadValues({}, HEADERS), { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" }), cfKiller: true });
const pageHtml = yield pageRes.text();
const $ = import_cheerio_without_node_native2.default.load(pageHtml);
const allStreams = [];
const contentBox = $(".thecontent");
const hTag = mediaType === "movie" ? "h4" : "h3";
const aTag = mediaType === "movie" ? "Download" : "Episode";
const sTag = mediaType === "movie" ? "" : `(S0${seasonNum}|Season ${seasonNum})`;
const qualityRegex = new RegExp(`${sTag}.*(480p|720p|1080p|2160p)`, "i");
const entries = contentBox.find(hTag).filter((i, el) => {
const text = $(el).text();
return qualityRegex.test(text) && !text.includes("MoviesMod");
});
for (const entry of entries.get()) {
const quality = getIndexQuality($(entry).text());
let linkEl = $(entry).next().find(`a:contains('${aTag}')`).first();
if (!linkEl.length) {
linkEl = $(entry).nextAll("p, div").find(`a:contains('${aTag}')`).first();
}
let nextHref = linkEl.attr("href");
if (nextHref && nextHref.includes("=")) {
nextHref = nextHref.substring(nextHref.indexOf("=") + 1);
}
if (nextHref) {
const streams = yield processModLink(nextHref, targetUrl, quality, mediaType, episodeNum);
allStreams.push(...streams);
}
}
return allStreams;
} catch (e) {
console.error("[MoviesMod] Error:", e.message);
return [];
}
});
}
function processModLink(url, referer, quality, mediaType, episodeNum) {
return __async(this, null, function* () {
try {
const res = yield fetch(url, { headers: __spreadProps(__spreadValues({}, HEADERS), { Referer: referer }) });
const html = yield res.text();
const $ = import_cheerio_without_node_native2.default.load(html);
const selector = mediaType === "movie" ? "p a.maxbutton, a:contains('Download')" : `h3 a:contains('Episode ${episodeNum}'), a:contains('Episode ${episodeNum}'), a.maxbutton`;
let source = $(selector).first().attr("href");
if (!source) {
source = $('a[href*="driveseed.org"], a[href*="tech.unblockedgames.world"], a[href*="video-seed"]').first().attr("href");
}
if (!source)
return [];
let finalLink = source;
if (source.includes("unblockedgames") || source.includes("tech.") || source.includes("href.li")) {
finalLink = yield bypassHrefli(source);
}
const results = [];
if (finalLink && finalLink.includes("driveseed")) {
const streams = yield extractDriveseedPage(finalLink);
results.push(...streams.map((s) => __spreadProps(__spreadValues({}, s), {
name: `MoviesMod [${s.name}]`,
title: `MoviesMod - ${s.quality} ${s.size ? `[${s.size}]` : ""}`,
quality: s.quality || quality,
provider: "moviesmod"
})));
} else if (finalLink && (finalLink.includes("video-seed") || finalLink.includes("video-leech"))) {
const streamUrl = yield extractVideoSeed(finalLink);
if (streamUrl) {
results.push({
name: "MoviesMod [VideoSeed]",
title: `MoviesMod - ${quality}`,
url: streamUrl,
quality,
provider: "moviesmod"
});
}
}
return results;
} catch (e) {
return [];
}
});
}
module.exports = { getStreams };
+455 -1
View File
@@ -1 +1,455 @@
const _0x509bf5=_0x3a01;(function(_0x1e402f,_0x34160a){const _0x4e0846={_0x7852e7:0x10b,_0x3c8323:0xcd,_0x2d86c4:0xd5,_0xff8df8:0xe8,_0x5370e5:0xc4},_0x348648=_0x3a01,_0x522e0d=_0x1e402f();while(!![]){try{const _0x154401=-parseInt(_0x348648(0xdc))/0x1*(parseInt(_0x348648(0xe9))/0x2)+-parseInt(_0x348648(0xed))/0x3*(-parseInt(_0x348648(_0x4e0846._0x7852e7))/0x4)+parseInt(_0x348648(_0x4e0846._0x3c8323))/0x5+parseInt(_0x348648(_0x4e0846._0x2d86c4))/0x6*(parseInt(_0x348648(0xe1))/0x7)+parseInt(_0x348648(0xc9))/0x8*(parseInt(_0x348648(_0x4e0846._0xff8df8))/0x9)+parseInt(_0x348648(_0x4e0846._0x5370e5))/0xa*(parseInt(_0x348648(0x101))/0xb)+-parseInt(_0x348648(0x10f))/0xc;if(_0x154401===_0x34160a)break;else _0x522e0d['push'](_0x522e0d['shift']());}catch(_0xf75ed8){_0x522e0d['push'](_0x522e0d['shift']());}}}(_0x5af8,0x2e62b));var __defProp=Object['defineProperty'],__defProps=Object['defineProperties'],__getOwnPropDescs=Object['getOwnPropertyDescriptors'],__getOwnPropSymbols=Object[_0x509bf5(0xd0)],__hasOwnProp=Object['prototype'][_0x509bf5(0xfe)],__propIsEnum=Object['prototype'][_0x509bf5(0xf6)],__defNormalProp=(_0x32c489,_0x19f7da,_0x5a1022)=>_0x19f7da in _0x32c489?__defProp(_0x32c489,_0x19f7da,{'enumerable':!![],'configurable':!![],'writable':!![],'value':_0x5a1022}):_0x32c489[_0x19f7da]=_0x5a1022,__spreadValues=(_0x1b7e14,_0x5f4e4c)=>{for(var _0x3196f1 in _0x5f4e4c||(_0x5f4e4c={}))if(__hasOwnProp['call'](_0x5f4e4c,_0x3196f1))__defNormalProp(_0x1b7e14,_0x3196f1,_0x5f4e4c[_0x3196f1]);if(__getOwnPropSymbols)for(var _0x3196f1 of __getOwnPropSymbols(_0x5f4e4c)){if(__propIsEnum['call'](_0x5f4e4c,_0x3196f1))__defNormalProp(_0x1b7e14,_0x3196f1,_0x5f4e4c[_0x3196f1]);}return _0x1b7e14;},__spreadProps=(_0x1080ab,_0x4c55be)=>__defProps(_0x1080ab,__getOwnPropDescs(_0x4c55be)),__async=(_0x3a30ea,_0xa26949,_0x283487)=>{const _0xb208d6={_0x134346:0xd7,_0x5a8a35:0xc1};return new Promise((_0x4b7c84,_0x273f5d)=>{const _0x10a20a=_0x3a01;var _0x5d3bb3=_0x93a5d4=>{try{_0x2aef9c(_0x283487['next'](_0x93a5d4));}catch(_0x5f4eeb){_0x273f5d(_0x5f4eeb);}},_0x2bd245=_0x82e0c7=>{try{_0x2aef9c(_0x283487['throw'](_0x82e0c7));}catch(_0x3c2029){_0x273f5d(_0x3c2029);}},_0x2aef9c=_0x5c100b=>_0x5c100b[_0x10a20a(0xf7)]?_0x4b7c84(_0x5c100b['value']):Promise['resolve'](_0x5c100b['value'])[_0x10a20a(0xcc)](_0x5d3bb3,_0x2bd245);_0x2aef9c((_0x283487=_0x283487[_0x10a20a(_0xb208d6._0x134346)](_0x3a30ea,_0xa26949))[_0x10a20a(_0xb208d6._0x5a8a35)]());});},TMDB_API_KEY=_0x509bf5(0x108),PLATFORM_MAP={'netflix':{'ott':'nf','search':'/mobile/search.php','post':'/mobile/post.php','episodes':_0x509bf5(0xf5),'playlist':'/mobile/playlist.php','img':_0x509bf5(0xbb),'epImg':_0x509bf5(0xbc)},'primevideo':{'ott':'pv','search':_0x509bf5(0xda),'post':_0x509bf5(0xcb),'episodes':'/mobile/pv/episodes.php','playlist':'/mobile/pv/playlist.php','img':_0x509bf5(0x103),'epImg':'pvepimg'},'hotstar':{'ott':'hs','search':'/mobile/hs/search.php','post':_0x509bf5(0xdf),'episodes':_0x509bf5(0xe6),'playlist':_0x509bf5(0xba),'img':'hs/v','epImg':'hsepimg'},'disney':{'ott':'hs','search':_0x509bf5(0x109),'post':'/mobile/hs/post.php','episodes':_0x509bf5(0xe6),'playlist':'/mobile/hs/playlist.php','img':'hs/v','epImg':'hsepimg'}},NEW_TV_BASE_HEADERS={'Cache-Control':'no-cache,\x20no-store,\x20must-revalidate','Pragma':'no-cache','Expires':'0','X-Requested-With':_0x509bf5(0x107),'User-Agent':'Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64;\x20rv:136.0)\x20Gecko/20100101\x20Firefox/136.0\x20/OS.GatuNewTV\x20v1.0','Accept':'application/json,\x20text/plain,\x20*/*'},NEW_TV_DOMAINS=['aHR0cHM6Ly9tb2JpbGVkZXRlY3RzLmNvbQ==',_0x509bf5(0xb7),'aHR0cHM6Ly9tb2JpZGV0ZWN0LmFydA==','aHR0cHM6Ly9tb2JpZGV0ZWN0LmNj',_0x509bf5(0xbe),'aHR0cHM6Ly9tb2JpZGV0ZWN0Lmluaw==','aHR0cHM6Ly9tb2JpZGV0ZWN0LmxpdmU=',_0x509bf5(0x104),_0x509bf5(0xc2),'aHR0cHM6Ly9tb2JpZGV0ZWN0LnNpdGU=',_0x509bf5(0xb3),'aHR0cHM6Ly9tb2JpZGV0ZWN0LnN0b3Jl',_0x509bf5(0xff),_0x509bf5(0xd4),_0x509bf5(0x105),'aHR0cHM6Ly9tb2JpZGV0ZWN0cy5hcnQ=','aHR0cHM6Ly9tb2JpZGV0ZWN0cy5jYw==',_0x509bf5(0xee),_0x509bf5(0xf8),_0x509bf5(0xfa),'aHR0cHM6Ly9tb2JpZGV0ZWN0cy5wcm8=',_0x509bf5(0x10a),_0x509bf5(0xb9),'aHR0cHM6Ly9tb2JpZGV0ZWN0cy54eXo='],resolvedApiUrl='';function safeAtob(_0x1e9010){const _0x508b8c={_0x5cc93b:0xc3,_0x2f957d:0xfc},_0x3165d0=_0x509bf5;if(typeof atob===_0x3165d0(_0x508b8c._0x5cc93b))return atob(_0x1e9010);return Buffer['from'](_0x1e9010,_0x3165d0(_0x508b8c._0x2f957d))['toString'](_0x3165d0(0xdb));}function resolveApiUrl(){const _0x14c8f7={_0x5c4956:0x110};return __async(this,null,function*(){const _0x56ebb9=_0x3a01;if(resolvedApiUrl)return resolvedApiUrl;for(const _0x419775 of NEW_TV_DOMAINS){const _0x462e6f=safeAtob(_0x419775)['replace'](/\/$/,'');try{const _0x109402=yield fetch(_0x462e6f+'/checknewtv.php',{'headers':__spreadProps(__spreadValues({},NEW_TV_BASE_HEADERS),{'User-Agent':_0x56ebb9(_0x14c8f7._0x5c4956)})}),_0x475155=yield _0x109402['json'](),_0x507ff3=_0x475155['token_hash'];if(_0x507ff3)return resolvedApiUrl=safeAtob(_0x507ff3)['reLine truncated
/**
* netmirror - Built from src/netmirror/
* Generated: 2026-09-26T18:41:31.637Z
*/
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/netmirror/constants.js
var TMDB_API_KEY = "1865f43a0549ca50d341dd9ab8b29f49";
var PLATFORM_MAP = {
netflix: {
ott: "nf",
search: "/mobile/search.php",
post: "/mobile/post.php",
episodes: "/mobile/episodes.php",
playlist: "/mobile/playlist.php",
img: "poster/v",
epImg: "epimg/150"
},
primevideo: {
ott: "pv",
search: "/mobile/pv/search.php",
post: "/mobile/pv/post.php",
episodes: "/mobile/pv/episodes.php",
playlist: "/mobile/pv/playlist.php",
img: "pv/v",
epImg: "pvepimg"
},
hotstar: {
ott: "hs",
search: "/mobile/hs/search.php",
post: "/mobile/hs/post.php",
episodes: "/mobile/hs/episodes.php",
playlist: "/mobile/hs/playlist.php",
img: "hs/v",
epImg: "hsepimg"
},
disney: {
ott: "hs",
search: "/mobile/hs/search.php",
post: "/mobile/hs/post.php",
episodes: "/mobile/hs/episodes.php",
playlist: "/mobile/hs/playlist.php",
img: "hs/v",
epImg: "hsepimg"
}
};
var BASE_HEADERS = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Language": "en-IN,en-US;q=0.9,en;q=0.8",
"Cache-Control": "max-age=0",
"Connection": "keep-alive",
"sec-ch-ua": '"Not(A:Brand";v="8", "Chromium";v="144", "Android WebView";v="144"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Android"',
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Linux; Android 13; Pixel 5 Build/TQ3A.230901.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/144.0.7559.132 Safari/537.36 /OS.Gatu v3.0",
"X-Requested-With": "XMLHttpRequest"
};
// src/netmirror/utils.js
var COOKIE_TTL = 54e6;
var VERIFY_ATTEMPTS = 7;
var VERIFY_DELAY = 1e4;
var APP_USER_AGENT = "Mozilla/5.0 (Linux; Android 12; RMX2117 Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/147.0.7727.55 Mobile Safari/537.36 /OS.Gatu v3.0";
var cookieValue = "";
var cookieTimestamp = 0;
var cookieJar = [];
var delayModeLogged = false;
function setCookieValues(headers) {
var _a, _b;
if (!headers)
return [];
if (typeof headers.getSetCookie === "function") {
try {
return headers.getSetCookie();
} catch (e) {
}
}
const raw = ((_a = headers.get) == null ? void 0 : _a.call(headers, "set-cookie")) || ((_b = headers.get) == null ? void 0 : _b.call(headers, "Set-Cookie")) || "";
return raw.split(/,(?=\s*[^;,\s]+=)/g).map((value) => value.trim()).filter(Boolean);
}
function rememberResponseCookies(headers, responseUrl) {
const host = new URL(responseUrl).hostname.toLowerCase();
for (const raw of setCookieValues(headers)) {
const pair = raw.split(";", 1)[0];
const equals = pair.indexOf("=");
if (equals <= 0)
continue;
const name = pair.slice(0, equals).trim();
const value = pair.slice(equals + 1).trim();
const domainMatch = raw.match(/(?:^|;)\s*domain=([^;]+)/i);
const domain = (domainMatch ? domainMatch[1] : host).trim().replace(/^\./, "").toLowerCase();
const index = cookieJar.findIndex((cookie2) => cookie2.name === name && cookie2.domain === domain);
if (/max-age\s*=\s*0/i.test(raw) || !value) {
if (index >= 0)
cookieJar.splice(index, 1);
continue;
}
const cookie = { name, value, domain };
if (index >= 0)
cookieJar[index] = cookie;
else
cookieJar.push(cookie);
}
}
function cookieHeaderFor(url) {
const host = new URL(url).hostname.toLowerCase();
return cookieJar.filter((cookie) => host === cookie.domain || host.endsWith(`.${cookie.domain}`)).map((cookie) => `${cookie.name}=${cookie.value}`).join("; ");
}
function request(_0) {
return __async(this, arguments, function* (url, options = {}) {
const headers = __spreadValues({}, options.headers || {});
const cookieHeader = cookieHeaderFor(url);
if (cookieHeader)
headers.Cookie = cookieHeader;
const response = yield fetch(url, __spreadProps(__spreadValues({}, options), { headers }));
rememberResponseCookies(response.headers, response.url || url);
return response;
});
}
function getCookie(name) {
var _a;
return ((_a = cookieJar.find((cookie) => cookie.name === name)) == null ? void 0 : _a.value) || "";
}
function logDelayMode(mode) {
if (delayModeLogged)
return;
delayModeLogged = true;
console.log(`[NetMirror] Delay implementation: ${mode}`);
}
function delay(ms) {
if (typeof setTimeout === "function") {
logDelayMode("setTimeout (runtime timer)");
return new Promise((resolve) => setTimeout(resolve, ms));
}
return Promise.resolve().then(() => {
if (typeof SharedArrayBuffer === "function" && typeof Atomics !== "undefined" && typeof Atomics.wait === "function") {
try {
logDelayMode("Atomics.wait fallback");
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
return;
} catch (e) {
}
}
logDelayMode("synchronous busy-wait fallback");
const deadline = Date.now() + ms;
while (Date.now() < deadline) {
}
});
}
function bypass(mainUrl) {
return __async(this, null, function* () {
var _a;
if (cookieValue && Date.now() - cookieTimestamp < COOKIE_TTL)
return cookieValue;
const base = String(mainUrl || "https://net52.cc").replace(/\/$/, "");
const homeUrl = `${base}/mobile/home?app=1`;
const appHeaders = {
"User-Agent": APP_USER_AGENT,
"X-Requested-With": "app.netmirror.netmirrornew"
};
try {
console.log("[NetMirror] Starting mobile cookie verification...");
cookieJar = [];
const homeResponse = yield request(homeUrl, { headers: appHeaders });
const homeHtml = yield homeResponse.text();
if (!homeResponse.ok)
throw new Error(`Mobile home returned HTTP ${homeResponse.status}`);
const addhash = (_a = homeHtml.match(/data-addhash\s*=\s*["']([^"']+)["']/i)) == null ? void 0 : _a[1];
if (!addhash)
throw new Error("NetMirror mobile home did not provide data-addhash");
const userverUrl = `https://userver.net52.cc/?hee5=${encodeURIComponent(addhash)}&a=y&t=${Math.random()}`;
const userverResponse = yield request(userverUrl, { headers: appHeaders });
yield userverResponse.text();
const verifyUrl = `${base}/mobile/verify2.php`;
const verifyHeaders = {
"User-Agent": APP_USER_AGENT,
"X-Requested-With": "XMLHttpRequest",
"Content-Type": "application/x-www-form-urlencoded"
};
for (let attempt = 1; attempt <= VERIFY_ATTEMPTS; attempt++) {
yield delay(VERIFY_DELAY);
const response = yield request(verifyUrl, {
method: "POST",
headers: verifyHeaders,
body: `verify=${encodeURIComponent(addhash)}`
});
const text = yield response.text();
let allDone = text.includes('"statusup":"All Done"');
if (!allDone) {
try {
allDone = JSON.parse(text).statusup === "All Done";
} catch (e) {
}
}
if (!allDone) {
console.log(`[NetMirror] Cookie verification pending (attempt ${attempt}/${VERIFY_ATTEMPTS}).`);
continue;
}
const verifiedCookie = getCookie("t_hash_t");
if (!verifiedCookie)
throw new Error("Verification completed without a t_hash_t cookie");
cookieValue = verifiedCookie;
cookieTimestamp = Date.now();
console.log("[NetMirror] Mobile cookie verified.");
return cookieValue;
}
throw new Error("Mobile verification did not complete; NetMirror may be waiting for an ad click");
} catch (error) {
cookieValue = "";
cookieTimestamp = 0;
console.error("[NetMirror] Mobile cookie verification failed:", error.message);
return "";
}
});
}
// src/netmirror/index.js
function getStreams(tmdbId, mediaType, season, episode) {
return __async(this, null, function* () {
try {
const settings = globalThis.SCRAPER_SETTINGS || {};
const preferred = settings.preferredPlatform || "all";
const tmdbType = mediaType === "tv" ? "tv" : "movie";
const tmdbResp = yield fetch(`https://api.themoviedb.org/3/${tmdbType}/${tmdbId}?api_key=${TMDB_API_KEY}`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36",
"Accept": "application/json"
}
});
const tmdbData = yield tmdbResp.json();
const title = mediaType === "tv" ? tmdbData.name : tmdbData.title;
if (!title)
throw new Error("Could not fetch title from TMDB");
let platforms = ["netflix", "primevideo", "hotstar", "disney"];
if (preferred !== "all") {
platforms = [preferred, ...platforms.filter((p) => p !== preferred)];
}
for (const platformKey of platforms) {
try {
const streams = yield fetchFromPlatform(platformKey, title, mediaType, season, episode);
if (streams && streams.length > 0)
return streams;
} catch (e) {
}
}
return [];
} catch (error) {
return [];
}
});
}
function fetchFromPlatform(platformKey, title, mediaType, season, episode) {
return __async(this, null, function* () {
const platform = PLATFORM_MAP[platformKey];
return fetchMobileContent(platformKey, platform, title, mediaType, season, episode);
});
}
function fetchMobileContent(platformKey, platform, title, mediaType, season, episode) {
return __async(this, null, function* () {
var _a, _b;
const base = "https://net52.cc";
const cookie = yield bypass(base);
const settings = globalThis.SCRAPER_SETTINGS || {};
const cookies = [];
if (cookie)
cookies.push(`t_hash_t=${cookie}`);
cookies.push(`ott=${platform.ott}`);
if (settings.forceHd !== false)
cookies.push("hd=on");
const headers = __spreadProps(__spreadValues({}, BASE_HEADERS), { Cookie: cookies.join("; ") });
const getJson = (_0, ..._1) => __async(this, [_0, ..._1], function* (url, referer = `${base}/home`, extraHeaders = {}) {
const response = yield fetch(url, {
headers: __spreadValues(__spreadProps(__spreadValues({}, headers), { Referer: referer }), extraHeaders)
});
if (!response.ok)
throw new Error(`NetMirror mobile returned HTTP ${response.status}`);
return response.json();
});
const search = yield getJson(`${base}${platform.search}?s=${encodeURIComponent(title)}&t=${Math.floor(Date.now() / 1e3)}`);
const results = Array.isArray(search.searchResult) ? search.searchResult : [];
if (!results.length)
return null;
const normalize = (value) => String(value || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, " ").trim();
const wanted = normalize(title);
const rank = (item) => {
const candidate = normalize(item.t || item.title);
return candidate === wanted ? 0 : candidate.includes(wanted) || wanted.includes(candidate) ? 1 : 2;
};
results.sort((a, b) => rank(a) - rank(b));
const wantedSeason = Number(season);
const wantedEpisode = Number(episode);
for (const result of results.slice(0, 8)) {
if (!result.id)
continue;
const post = yield getJson(`${base}${platform.post}?id=${encodeURIComponent(result.id)}&t=${Math.floor(Date.now() / 1e3)}`);
if (!post || post.status === "n" && post.error)
continue;
let targetId = result.id;
if (mediaType === "tv") {
if (post.type !== "t" && !(post.episodes || []).some(Boolean))
continue;
let episodeEntry = findMobileEpisode(
post.episodes,
wantedSeason,
wantedEpisode,
((_b = (_a = post.season) == null ? void 0 : _a.findIndex((s) => s.selected === true)) != null ? _b : -1) + 1
);
const seasonEntry = Array.isArray(post.season) ? post.season.find((s) => Number(String(s.s || "").replace(/\D/g, "")) === wantedSeason) : null;
if (!episodeEntry && (seasonEntry == null ? void 0 : seasonEntry.id)) {
let page = 1;
while (page <= 30) {
const url = `${base}${platform.episodes}?s=${encodeURIComponent(seasonEntry.id)}&series=${encodeURIComponent(result.id)}&t=${Math.floor(Date.now() / 1e3)}&page=${page}`;
const data = yield getJson(url);
episodeEntry = findMobileEpisode(data.episodes, wantedSeason, wantedEpisode, wantedSeason);
if (episodeEntry || !data.nextPageShow || Number(data.nextPageShow) === 0)
break;
page++;
}
}
if (!(episodeEntry == null ? void 0 : episodeEntry.id))
continue;
targetId = episodeEntry.id;
} else if (post.type === "t" || (post.episodes || []).some(Boolean)) {
continue;
}
const playlistUrl = `${base}${platform.playlist}?id=${encodeURIComponent(targetId)}&t=${encodeURIComponent(title)}&tm=${Math.floor(Date.now() / 1e3)}`;
const playlist = yield getJson(playlistUrl, `${base}/mobile/home?app=1`, {
"X-Requested-With": "app.netmirror.netmirrornew",
"Accept": "*/*",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors"
});
const entries = Array.isArray(playlist) ? playlist : playlist.playlist || playlist.data || [];
const streams = [];
for (const entry of entries) {
for (const source of entry.sources || []) {
if (!source.file)
continue;
const streamUrl = /^https?:\/\//i.test(source.file) ? source.file : source.file.startsWith("//") ? `https:${source.file}` : `${base}${source.file.startsWith("/") ? "" : "/"}${source.file}`;
const label = source.label || "Auto";
const quality = (String(label).match(/\d{3,4}p?/i) || [])[0] || (/full\s*hd/i.test(label) ? "1080p" : /mid\s*hd/i.test(label) ? "720p" : /low\s*hd/i.test(label) ? "480p" : "Auto");
const playbackHeaders = {
"Accept": "*/*",
"Accept-Language": "en-IN,en-US;q=0.9,en;q=0.8",
"Connection": "keep-alive",
"Referer": `${base}/mobile/home?app=1`,
"sec-ch-ua": '"Android WebView";v="149", "Chromium";v="149", "Not)A;Brand";v="24"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Android"',
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "same-origin",
"User-Agent": "Mozilla/5.0 (Linux; Android 13; Pixel 5 Build/TQ3A.230901.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/149.0.7827.91 Safari/537.36 /OS.Gatu v3.0",
"X-Requested-With": "app.netmirror.netmirrornew"
};
if (settings.forceHd !== false)
playbackHeaders.Cookie = "hd=on";
streams.push({
name: `NetMirror (${platformKey})`,
title: mediaType === "tv" ? `${title} S${wantedSeason}E${wantedEpisode} - ${label}` : `${title} - ${label}`,
url: streamUrl,
quality,
headers: playbackHeaders
});
}
}
if (streams.length)
return streams;
}
return null;
});
}
function findMobileEpisode(episodes, season, episode, fallbackSeason) {
if (!Array.isArray(episodes))
return null;
return episodes.find((item) => {
if (!item)
return false;
const epNumber = Number(String(item.ep || "").replace(/\D/g, ""));
const seasonNumber = Number(String(item.s || item.sNum || "").replace(/\D/g, "")) || fallbackSeason;
return epNumber === episode && seasonNumber === season;
}) || null;
}
function onSettings() {
return __async(this, null, function* () {
return [
{ type: "header", label: "Source Selection" },
{
type: "select",
key: "preferredPlatform",
label: "Preferred Streaming Source",
description: "Select which platform to try first. If content isn't found, others will be searched as fallback.",
options: [
{ label: "All Sources (Ordered)", value: "all" },
{ label: "Netflix", value: "netflix" },
{ label: "Prime Video", value: "primevideo" },
{ label: "Hotstar / Disney+", value: "hotstar" }
],
defaultValue: "all"
},
{ type: "header", label: "Advanced" },
{
type: "toggle",
key: "forceHd",
label: "Force HD Quality",
description: "Attempts to force the player into HD mode when possible.",
defaultValue: true
}
];
});
}
module.exports = { getStreams, onSettings };
+683
View File
@@ -0,0 +1,683 @@
/**
* reanime - Built from src/reanime/
* Generated: 2026-09-21T13:43:14.525Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/reanime/reanime.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
// src/reanime/constants.js
var REANIME_DOMAINS = [
"https://reanime.to",
"https://reanime.cz",
"https://reanime.wtf"
];
var REANIME_BASE = "https://reanime.to";
var FLIXCLOUD_BASE = "https://flixcloud.cc";
var TMDB_API_KEY = "439c478a771f35c05022f9feabcca01c";
var ANILIST_URL = "https://graphql.anilist.co";
var ARM_BASE = "https://arm.haglund.dev/api/v2";
var CINEMETA_URL = "https://v3-cinemeta.strem.io/meta";
var 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";
var HEADERS = {
"User-Agent": USER_AGENT,
"Accept": "application/json, text/plain, */*",
"Accept-Language": "en-US,en;q=0.9"
};
var FLIX_HEADERS = {
"User-Agent": USER_AGENT,
"Accept": "*/*",
"Origin": FLIXCLOUD_BASE,
"Referer": `${FLIXCLOUD_BASE}/`
};
// src/reanime/reanime.js
var activeBaseUrl = REANIME_BASE;
function absolutize(path, base = activeBaseUrl) {
if (!path)
return "";
if (path.startsWith("http"))
return path;
const cleanPath = path.startsWith("/") ? path : `/${path}`;
return `${base}${cleanPath}`;
}
function fetchText(_0) {
return __async(this, arguments, function* (url, options = {}) {
const isAbsolute = url.startsWith("http");
const urlsToTry = isAbsolute ? [url] : REANIME_DOMAINS.map((domain) => absolutize(url, domain));
let lastError = null;
for (const tryUrl of urlsToTry) {
try {
const response = yield fetch(tryUrl, __spreadProps(__spreadValues({}, options), {
headers: __spreadValues(__spreadValues({}, HEADERS), options.headers || {})
}));
if (response.ok) {
if (!isAbsolute) {
const match = tryUrl.match(/^(https?:\/\/[^\/]+)/);
if (match)
activeBaseUrl = match[1];
}
return yield response.text();
}
lastError = new Error(`Reanime HTTP ${response.status}: ${tryUrl}`);
} catch (e) {
lastError = e;
}
}
throw lastError || new Error(`Failed to fetch: ${url}`);
});
}
function fetchJson(_0) {
return __async(this, arguments, function* (url, options = {}) {
const text = yield fetchText(url, __spreadProps(__spreadValues({}, options), {
headers: __spreadValues({
"Accept": "application/json, text/plain, */*"
}, options.headers || {})
}));
return JSON.parse(text);
});
}
function getTmdbInfo(tmdbId, mediaType) {
return __async(this, null, function* () {
const endpoint = mediaType === "tv" ? "tv" : "movie";
const url = `https://api.themoviedb.org/3/${endpoint}/${tmdbId}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
try {
const data = yield fetchJson(url);
return {
title: data.name || data.title || data.original_name || data.original_title || "",
year: ((data.first_air_date || data.release_date || "").match(/\d{4}/) || [null])[0],
imdbId: data.external_ids && data.external_ids.imdb_id
};
} catch (_) {
return { title: "", year: null, imdbId: null };
}
});
}
function getAnilistInfo(alId) {
return __async(this, null, function* () {
var _a, _b, _c, _d, _e;
const query = "query($id:Int){Media(id:$id){id title{english romaji native} startDate{year}}}";
try {
const json = yield fetchJson(ANILIST_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query, variables: { id: parseInt(alId, 10) } })
});
const media = (_a = json.data) == null ? void 0 : _a.Media;
if (!media)
return { title: "", year: null };
return {
title: ((_b = media.title) == null ? void 0 : _b.english) || ((_c = media.title) == null ? void 0 : _c.romaji) || ((_d = media.title) == null ? void 0 : _d.native) || "",
year: ((_e = media.startDate) == null ? void 0 : _e.year) || null
};
} catch (_) {
return { title: "", year: null };
}
});
}
function getSyncInfo(id, mediaType, season, episode) {
return __async(this, null, function* () {
const isImdb = typeof id === "string" && id.indexOf("tt") === 0;
const getCinemetaInfo = (imdbId2) => __async(this, null, function* () {
const type = mediaType === "movie" ? "movie" : "series";
const url = `${CINEMETA_URL}/${type}/${imdbId2}.json`;
try {
const data = yield fetchJson(url);
const meta = data.meta;
if (!meta)
throw new Error("No Cinemeta metadata");
if (mediaType === "movie")
return { date: meta.released ? meta.released.split("T")[0] : null, title: meta.name, dayIndex: 1 };
const videos = meta.videos || [];
const target = videos.find((v) => v.season == season && v.episode == episode);
if (!target || !target.released)
return { date: null, title: null, dayIndex: 1 };
const targetDate = target.released.split("T")[0];
const dayIndex = videos.filter((v) => v.season == season && v.released && v.released.split("T")[0] === targetDate && parseInt(v.episode) < parseInt(episode)).length + 1;
return { date: targetDate, title: target.name || null, dayIndex };
} catch (_) {
return { date: null, title: null, dayIndex: 1 };
}
});
if (isImdb) {
const info = yield getCinemetaInfo(id);
if (info.date)
return { imdbId: id, releaseDate: info.date, episodeTitle: info.title, dayIndex: info.dayIndex, episode };
throw new Error("Could not find release date on Cinemeta");
}
const tmdbUrl = `https://api.themoviedb.org/3/${mediaType === "movie" ? "movie" : "tv"}/${id}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
const details = yield fetchJson(tmdbUrl);
let imdbId = details.external_ids && details.external_ids.imdb_id || details.imdb_id || null;
const title = details.name || details.title || null;
if (!imdbId) {
try {
const armData = yield fetchJson(`${ARM_BASE}/themoviedb?id=${id}`);
imdbId = Array.isArray(armData) && armData.length > 0 ? armData[0].imdb : null;
} catch (_) {
}
}
if (!imdbId)
throw new Error(`No IMDb ID found for TMDB ${id}`);
const cMeta = yield getCinemetaInfo(imdbId);
let finalDate = cMeta.date;
if (mediaType === "movie" && details.release_date)
finalDate = details.release_date;
if (!finalDate)
throw new Error(`Could not find release date for ID ${imdbId}`);
return {
imdbId,
tmdbId: id,
releaseDate: finalDate,
title,
episodeTitle: cMeta.title,
dayIndex: cMeta.dayIndex,
episode
};
});
}
function resolveByDate(releaseDateStr, showTitle, originalEpisode, episodeTitle, dayIndex) {
return __async(this, null, function* () {
var _a, _b;
if (!releaseDateStr || !/^\d{4}-\d{2}-\d{2}/.test(releaseDateStr))
return null;
const query = "query($search:String){Page(perPage:20){media(search:$search,type:ANIME){id type format title{romaji english native}startDate{year month day}endDate{year month day}episodes streamingEpisodes{title}}}}";
try {
const json = yield fetchJson(ANILIST_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query, variables: { search: showTitle } })
});
const candidates = ((_b = (_a = json.data) == null ? void 0 : _a.Page) == null ? void 0 : _b.media) || [];
if (candidates.length === 0)
return null;
const targetDate = new Date(releaseDateStr);
for (const anime of candidates) {
const s = anime.startDate;
const startStr = s.year && s.month && s.day ? `${s.year}-${String(s.month).padStart(2, "0")}-${String(s.day).padStart(2, "0")}` : null;
if (!startStr)
continue;
const startDate = new Date(startStr);
const diffDays = Math.ceil(Math.abs(targetDate.getTime() - startDate.getTime()) / (1e3 * 60 * 60 * 24));
let isMatch = false;
if (anime.format === "MOVIE" || anime.format === "SPECIAL" || anime.episodes === 1) {
if (diffDays <= 2)
isMatch = true;
} else {
const startLimit = new Date(startDate);
startLimit.setDate(startLimit.getDate() - 2);
if (targetDate >= startLimit) {
if (anime.endDate && anime.endDate.year) {
const endDate = new Date(anime.endDate.year, (anime.endDate.month || 12) - 1, anime.endDate.day || 31);
endDate.setDate(endDate.getDate() + 2);
if (targetDate <= endDate)
isMatch = true;
} else {
isMatch = true;
}
}
}
if (isMatch) {
const isTV = anime.format !== "MOVIE" && anime.format !== "SPECIAL" && anime.episodes !== 1;
let episodeNum = isTV && originalEpisode ? originalEpisode : dayIndex || 1;
const episodes = anime.streamingEpisodes || [];
if (episodes.length > 1 && episodeTitle) {
const cleanTarget = episodeTitle.toLowerCase().replace(/[^a-z0-9]/g, "");
for (let j = 0; j < episodes.length; j++) {
const cleanAl = (episodes[j].title || "").toLowerCase().replace(/[^a-z0-9]/g, "");
if (cleanAl && (cleanAl.indexOf(cleanTarget) !== -1 || cleanTarget.indexOf(cleanAl) !== -1)) {
episodeNum = j + 1;
break;
}
}
}
return { alId: anime.id, episode: episodeNum, title: anime.title.english || anime.title.romaji || anime.title.native };
}
}
} catch (_) {
}
return null;
});
}
function normalizeTitle(value) {
return String(value || "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
}
function scoreCandidate(title, query, year, targetAnilistId, candidateAnilistId) {
if (targetAnilistId && candidateAnilistId && String(targetAnilistId) === String(candidateAnilistId)) {
return 1e3;
}
const a = normalizeTitle(title);
const b = normalizeTitle(query);
if (!a || !b)
return 0;
let score = 0;
if (a === b)
score += 100;
if (a.includes(b) || b.includes(a))
score += 50;
const words = b.split(/\s+/).filter(Boolean);
for (const word of words)
if (a.includes(word))
score += 4;
if (year && String(title).includes(String(year)))
score += 10;
return score;
}
function extractAnilistId(item) {
var _a, _b, _c;
const direct = item && (item.anilist_id || item.anilistId);
if (direct)
return String(direct);
const imageUrls = [
(_a = item == null ? void 0 : item.cover_image) == null ? void 0 : _a.extra_large,
(_b = item == null ? void 0 : item.cover_image) == null ? void 0 : _b.large,
(_c = item == null ? void 0 : item.cover_image) == null ? void 0 : _c.medium,
item == null ? void 0 : item.banner_image
].filter(Boolean);
for (const url of imageUrls) {
const match = String(url).match(/\/b?x?(\d+)-|\/(\d+)[-.]/);
if (match)
return match[1] || match[2];
}
return null;
}
function searchReanimeAnime(query, year, targetAnilistId = null) {
return __async(this, null, function* () {
const endpoints = [
`/api/v1/search?q=${encodeURIComponent(query)}&limit=36`,
`/api/search?q=${encodeURIComponent(query)}`
];
const candidates = [];
for (const endpoint of endpoints) {
try {
const text = yield fetchText(endpoint);
if (text.trim().startsWith("{") || text.trim().startsWith("[")) {
const json = JSON.parse(text);
const list = json.results || json.data || json.anime || (Array.isArray(json) ? json : null);
if (Array.isArray(list)) {
list.forEach((item) => {
const rawSlug = item.anime_id || item.slug || item.id || item.url;
if (rawSlug) {
const cleanSlug = String(rawSlug).replace(/-[a-z0-9]{6}$/, "");
const titles = [];
if (typeof item.title === "object" && item.title) {
if (item.title.english)
titles.push(item.title.english);
if (item.title.romaji)
titles.push(item.title.romaji);
if (item.title.native)
titles.push(item.title.native);
} else if (item.title) {
titles.push(item.title);
}
if (item.name)
titles.push(item.name);
if (titles.length === 0)
titles.push(cleanSlug);
const alId = extractAnilistId(item);
let bestScore = 0;
for (const t of titles) {
const sc = scoreCandidate(t, query, year, targetAnilistId, alId);
if (sc > bestScore)
bestScore = sc;
}
candidates.push({
slug: String(rawSlug),
cleanSlug,
title: titles[0],
anilistId: alId,
score: bestScore
});
}
});
}
}
} catch (_) {
}
if (candidates.some((c) => c.score >= 1e3))
break;
if (candidates.length > 0 && !targetAnilistId)
break;
}
const unique = [];
const seen = /* @__PURE__ */ new Set();
for (const candidate of candidates) {
if (!candidate.slug || seen.has(candidate.slug))
continue;
seen.add(candidate.slug);
unique.push(candidate);
}
unique.sort((a, b) => b.score - a.score);
return unique.length > 0 ? unique[0] : null;
});
}
function getFlixEmbeds(slug, episodeNumber, language, anilistId) {
return __async(this, null, function* () {
const watchPath = `/watch/${slug || "anime"}?ep=${episodeNumber}`;
if (anilistId) {
try {
const flixUrl = `/api/flix/${anilistId}/${episodeNumber}`;
const json = yield fetchJson(flixUrl, {
headers: { "Referer": absolutize(watchPath) }
});
if (json.success && Array.isArray(json.servers) && json.servers.length > 0) {
const filtered = language ? json.servers.filter((s) => s.dataType && s.dataType.toLowerCase() === language.toLowerCase()) : json.servers;
return {
watchUrl: absolutize(watchPath),
servers: filtered,
embeds: filtered.map((s) => s.dataLink).filter(Boolean)
};
}
} catch (_) {
}
}
if (slug) {
try {
const animeApiUrl = `/api/v1/anime/${slug}`;
const animeData = yield fetchJson(animeApiUrl);
const alId = animeData == null ? void 0 : animeData.anilist_id;
if (alId) {
const flixUrl = `/api/flix/${alId}/${episodeNumber}`;
const json = yield fetchJson(flixUrl, {
headers: { "Referer": absolutize(watchPath) }
});
if (json.success && Array.isArray(json.servers) && json.servers.length > 0) {
const filtered = language ? json.servers.filter((s) => s.dataType && s.dataType.toLowerCase() === language.toLowerCase()) : json.servers;
return {
watchUrl: absolutize(watchPath),
servers: filtered,
embeds: filtered.map((s) => s.dataLink).filter(Boolean)
};
}
}
} catch (_) {
}
try {
const html = yield fetchText(`/anime/${slug}?_ep=${episodeNumber}`);
const anilistMatch = html.match(/anilist_id:\s*(\d+)/);
if (anilistMatch) {
const alId = anilistMatch[1];
const flixUrl = `/api/flix/${alId}/${episodeNumber}`;
const json = yield fetchJson(flixUrl, {
headers: { "Referer": absolutize(watchPath) }
});
if (json.success && Array.isArray(json.servers) && json.servers.length > 0) {
const filtered = language ? json.servers.filter((s) => s.dataType && s.dataType.toLowerCase() === language.toLowerCase()) : json.servers;
return {
watchUrl: absolutize(watchPath),
servers: filtered,
embeds: filtered.map((s) => s.dataLink).filter(Boolean)
};
}
}
} catch (_) {
}
}
return { watchUrl: absolutize(watchPath), servers: [], embeds: [] };
});
}
// src/reanime/flixcloud.js
function extractFlixCloudDownload(embedUrl) {
return __async(this, null, function* () {
try {
const match = embedUrl.match(/\/e\/([a-z0-9]+)/i);
const aid = match ? match[1] : null;
if (!aid)
return null;
const dlHeaders = {
"Accept": "*/*",
"Referer": `${FLIXCLOUD_BASE}/`,
"User-Agent": USER_AGENT
};
const res = yield fetch(`${FLIXCLOUD_BASE}/d/${aid}/__data.json`, {
headers: dlHeaders
});
if (!res.ok)
return null;
const dataBody = yield res.text();
const fileIdMatch = dataBody.match(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i);
const tokenMatch = dataBody.match(/eyJ[\w-]+\.[\w-]+\.[\w-]+/);
const baseMatch = dataBody.match(/https:\/\/[a-z0-9-]+\.flixcloud\.cc/i);
const resolutionMatch = dataBody.match(/(\d{3,4}p)/);
const sizeMatch = dataBody.match(/"(\d+(?:\.\d+)?\s*[KMG]B)"/i);
const fileId = fileIdMatch ? fileIdMatch[0] : null;
const token = tokenMatch ? tokenMatch[0] : null;
const base = baseMatch ? baseMatch[0] : FLIXCLOUD_BASE;
const resolution = resolutionMatch ? resolutionMatch[1] : null;
const size = sizeMatch ? sizeMatch[1] : "Unknown";
if (!fileId || !token)
return null;
let ready = false;
try {
const progRes = yield fetch(`${base}/download/${fileId}/progress?token=${token}`, {
headers: dlHeaders
});
if (progRes.ok) {
const text = yield progRes.text();
if (text.includes('"status":"ready"') || text.includes('"ready"')) {
ready = true;
}
}
} catch (_) {
}
const fileUrl = `${base}/download/${fileId}?token=${token}`;
return {
url: fileUrl,
quality: resolution || "1080p",
size,
type: "mkv",
headers: dlHeaders,
ready
};
} catch (_) {
return null;
}
});
}
// src/reanime/index.js
function getStreams(tmdbId, mediaType = "tv", season = null, episode = null) {
return __async(this, null, function* () {
try {
if (mediaType !== "tv" && mediaType !== "movie")
return [];
let alId = null;
let episodeNumber = mediaType === "tv" ? Number(episode || 1) : 1;
let searchTitle = "";
let searchYear = null;
if (typeof tmdbId === "string" && tmdbId.indexOf("anilist:") === 0) {
alId = tmdbId.split(":")[1];
} else {
try {
const syncInfo = yield getSyncInfo(tmdbId, mediaType, season, episodeNumber);
searchTitle = syncInfo.title;
if (syncInfo.releaseDate) {
searchYear = syncInfo.releaseDate.substring(0, 4);
}
const syncResult = yield resolveByDate(syncInfo.releaseDate, syncInfo.title, episodeNumber, syncInfo.episodeTitle, syncInfo.dayIndex);
if (syncResult && syncResult.alId) {
alId = String(syncResult.alId);
episodeNumber = syncResult.episode;
searchTitle = syncResult.title;
}
} catch (_) {
}
if (!searchTitle || !searchYear) {
try {
const tmdb = yield getTmdbInfo(tmdbId, mediaType);
if (!searchTitle)
searchTitle = tmdb.title;
if (!searchYear)
searchYear = tmdb.year;
} catch (_) {
}
}
}
const serversByLang = {};
let watchUrl = "";
if (alId) {
for (const lang of ["sub", "dub"]) {
try {
const res = yield getFlixEmbeds(null, episodeNumber, lang, alId);
if (res.servers && res.servers.length > 0) {
serversByLang[lang] = res.servers;
if (res.watchUrl)
watchUrl = res.watchUrl;
}
} catch (_) {
}
}
}
if (Object.keys(serversByLang).length === 0) {
if (!searchTitle && alId) {
const alInfo = yield getAnilistInfo(alId);
searchTitle = alInfo.title;
searchYear = alInfo.year;
}
if (searchTitle) {
const anime = yield searchReanimeAnime(searchTitle, searchYear, alId);
if (anime) {
const slug = anime.slug;
const finalAlId = alId || anime.anilistId;
for (const lang of ["sub", "dub"]) {
try {
const res = yield getFlixEmbeds(slug, episodeNumber, lang, finalAlId);
if (res.servers && res.servers.length > 0) {
serversByLang[lang] = res.servers;
if (res.watchUrl)
watchUrl = res.watchUrl;
}
} catch (_) {
}
}
}
}
}
if (Object.keys(serversByLang).length === 0)
return [];
const streams = [];
const seen = /* @__PURE__ */ new Set();
const tasks = [];
for (const language of ["sub", "dub"]) {
const serverList = serversByLang[language] || [];
for (let i = 0; i < serverList.length; i++) {
const server = serverList[i];
const dataLink = server.dataLink;
if (!dataLink)
continue;
const serverName = server.serverName || `HD-${i + 1}`;
const langUpper = language.toUpperCase();
const displayTitle = searchTitle || "Anime";
const streamTitle = mediaType === "movie" ? `${displayTitle} (${langUpper})` : `${displayTitle} - Episode ${episodeNumber} (${langUpper})`;
tasks.push((() => __async(this, null, function* () {
try {
const directDl = yield extractFlixCloudDownload(dataLink);
if (directDl && directDl.url) {
return {
name: `Reanime [${langUpper}] ${serverName} (${directDl.quality || "1080p"})`,
title: streamTitle,
url: directDl.url,
quality: directDl.quality || "1080p",
size: directDl.size || "Unknown",
headers: directDl.headers,
provider: "reanime",
type: "mkv"
};
}
} catch (_) {
}
return null;
}))());
}
}
const results = yield Promise.all(tasks);
for (const res of results) {
if (res && res.url && !seen.has(res.name)) {
seen.add(res.name);
streams.push(res);
}
}
const qualityRank = {
"auto": 4e3,
"adaptive": 4e3,
"2160p": 2160,
"4k": 2160,
"1080p": 1080,
"720p": 720,
"480p": 480,
"360p": 360,
"unknown": 0
};
streams.sort((a, b) => {
var _a, _b;
const qa = qualityRank[(_a = a.quality) == null ? void 0 : _a.toLowerCase()] || 0;
const qb = qualityRank[(_b = b.quality) == null ? void 0 : _b.toLowerCase()] || 0;
return qb - qa;
});
return streams;
} catch (error) {
console.error(`[Reanime] Error: ${error.message}`);
return [];
}
});
}
module.exports = { getStreams };
+471 -1
View File
@@ -1 +1,471 @@
const _0x66bb91=_0x43c8;function _0x3b55(){const _0x48983d=['mJe2ma','Dgv4Dc9ODg1SlgfWCgXPy2f0Aw9Ul3HODg1Sk3HTBcXHChbSAwnHDgLVBI94BwW7Ct0WlJKSAw1Hz2uVyxzPzIXPBwfNzs93zwjWlcOVkJTXptaUoa','CMvZB2X2zq','DxjS','otm1mtG0CwvzwhHM','ue9tva','xhmQpvXZkIHBiIDDksHBxhnCu10QpYLCmq','mtmZndbxr3vYrfe','Ag9ZDg5HBwu','BwfW','Dgv4Da','BgfIzwW','EwvHCG','zw5KC1DPDgG','DMLKzw8VEc1TyxrYB3nRyq','ywXS','vuHetw92AwvZ','DMfSDwu','8j+tPIbtAxPLifvUA25VD24','lZ9Zpq','8j+AGcaXmdGWCa','Bw92Awu','CMvSzwfZzv9KyxrL','mZC1mZeXBvzMtw5I','sfruuca','ntK1shDtAfPs','BwvZC2fNzq','Bwf0y2G','Bg9N','DwHKBw92AwvZ','lMDVB2DSzxzPzgvVlMnVBq','ihWG','mtG2nwy0m2eWntq5y2e1mgqZndfKzdLHyJHImJLMndK','AhjLzG','AM9PBG','mty4otiZmJvtC29NweO','zMLSDgvY','w1vire1VDMLLC10GrxjYB3i6ia','Ag9ZDa','lNiYlMrLDG','BgvUz3rO','BgfUz3vHz2u','w1vire1VDMLLC10GvgHLigrVD25SB2fKigDHDgv3yxKGCMvQzwn0zwqGywXSihjLCxvLC3rZigLUihrOAxmGCNvUDgLTzq','C29Tzq','AgKG4OcIigvU','l21VDMLLlW','ywn0Aw9U','C3rHCNrZv2L0Aa','zM9SBg93','C3rHDhvZ','ihjLBgvHC2uOCYK','Aw5JBhvKzxm','zMLUza','Ahr0Chm6lY91AgrTB3zPzxmUCgLUAW','nJiWnJm0y1POy1HH','tw96AwXSys81lJaGkfDPBMrVD3mGtLqGmtaUmdSGv2LUnJq7ihG2ncKGqxbWBgvxzwjlAxqVntm3lJm2icHlsfrntcWGBgLRzsbhzwnRBYKGq2HYB21LlZe0os4WlJaUmcbtywzHCMKVntm3lJm2','Dg9vChbLCKnHC2u','w1vire1VDMLLC10GrM91BMqG','BMfTzq','C2nVCMu','mJe2mha','C3bSAxq','Dg9mB3DLCKnHC2u','nZqXmtq4vLjTAxbo','DgHLBG','yxbWBgLJyxrPB24VEc13D3CTzM9YBs11CMXLBMnVzgvK','B3jPz2LUywXFDgL0Bgu','CMvWBgfJzq','DgL0Bgu','w1vire1VDMLLC10Gtg9VA2LUzYb1CcbTB3zPzsa','mJm3nJH2tgXpDKK','CxvHBgL0Eq','mZCWu2XvDhDm','yxbWBhK','zMLLBgrZ','DgvZDa','w1vire1VDMLLC10GuMvSzwfZzsb1BMf2ywLSywjSztOG','C2L6zq','zM9YrwfJAa','zw4TvvmSzw47Ct0WlJK','8j+mNYaYmtyWCa','DhjPBq','ChvZAa','BMv4Da','vuHetw92AwvZihWG','lNiYlMnSB3vKzMXHCMvZDg9YywDLlMnVBq','8j+xO++4JYbftG','C29YDa','x3DWx2H0DhaY','zxjYB3i','y29Uy2f0'];_0x3b55=function(){return _0x48983d;};return _0x3b55();}(function(_0x178908,_0x50b0b){const _0x26d30e={_0xb00419:0x150,_0x2dd291:0x11d,_0xba6525:0x13d,_0x2996d1:0x140,_0x30c3dd:0x152,_0x515552:0x124,_0x337785:0x15c},_0x46581c=_0x43c8,_0xe5371d=_0x178908();while(!![]){try{const _0x144a3b=-parseInt(_0x46581c(_0x26d30e._0xb00419))/0x1+-parseInt(_0x46581c(_0x26d30e._0x2dd291))/0x2+-parseInt(_0x46581c(_0x26d30e._0xba6525))/0x3+parseInt(_0x46581c(_0x26d30e._0x2996d1))/0x4*(-parseInt(_0x46581c(0x126))/0x5)+-parseInt(_0x46581c(0x114))/0x6+-parseInt(_0x46581c(_0x26d30e._0x30c3dd))/0x7*(parseInt(_0x46581c(_0x26d30e._0x515552))/0x8)+parseInt(_0x46581c(_0x26d30e._0x337785))/0x9;if(_0x144a3b===_0x50b0b)break;else _0xe5371d['push'](_0xe5371d['shift']());}catch(_0x36f3a9){_0xe5371d['push'](_0xe5371d['shift']());}}}(_0x3b55,0x34de4));var __async=(_0x5ede2d,_0x1e1c5d,_0x28b562)=>{const _0x30fbc3={_0x10354e:0x127};return new Promise((_0x4d75eb,_0x10cd35)=>{const _0x4b0345={_0x18a63f:0x131},_0x420663=_0x43c8;var _0x5924b8=_0x55ded8=>{const _0x1b2e21=_0x43c8;try{_0x5493d3(_0x28b562[_0x1b2e21(_0x4b0345._0x18a63f)](_0x55ded8));}catch(_0x420b0f){_0x10cd35(_0x420b0f);}},_0x365cb5=_0x281ba4=>{try{_0x5493d3(_0x28b562['throw'](_0x281ba4));}catch(_0x104167){_0x10cd35(_0x104167);}},_0x5493d3=_0x53dcfe=>_0x53dcfe['done']?_0x4d75eb(_0x53dcfe[_0x420663(0x14a)]):Promise[_0x420663(0x13b)](_0x53dcfe['value'])[_0x420663(0x11e)](_0x5924b8,_0x365cb5);_0x5493d3((_0x28b562=_0x28b562[_0x420663(_0x30fbc3._0x10354e)](_0x5ede2d,_0x1e1c5d))['next']());});};function getInvertedSortTag(_0x355ccf,_0x490fa2=0xf423f){const _0x4c97db={_0x5eb94f:0x142},_0x141413=_0x43c8,_0xfacf2=Math['max'](0x0,parseInt(_0x355ccf,0xa)||0x0),_0x456685=Math['max'](0x0,_0x490fa2-_0xfacf2),_0x39d79c=_0x456685['toString'](0x2)['padStart'](0x14,'0');return _0x39d79c[_0x141413(0x11b)]('')[_0x141413(_0x4c97db._0x5eb94f)](_0xdb05b1=>_0xdb05b1==='1'?'\ufeff':'​')[_0x141413(0x15b)]('');}var BASE_URLS=['https://uhdmovies.autos',_0x66bb91(0x113)],DOMAINS_URL='https://raw.githubusercontent.com/phisher98/TVVVV/refs/heads/main/domains.json',TMDB_URL='https://api.themoviedb.org/3',TMDB_API_KEY=_0x66bb91(0x159),USER_AGENT=_0x66bb91(0x115),HEADERS={'User-Agent':USER_AGENT,'Accept':_0x66bb91(0x13a),'Accept-Language':_0x66bb91(0x12d)};function fetchText(_0x5be7be,_0x713b13){return __async(this,null,function*(){const _0x192fa5=_0x43c8,_0x5c72a3=yield fetch(_0x5be7be,_0x713b13);if(!_0x5c72a3['ok'])throw new Error(_0x192fa5(0x151)+_0x5c72a3['status']);return _0x5c72a3['text']();});}function getOrigin(_0x290d55){const _0x15704f={_0x58190d:0x15f},_0x148962=_0x66bb91;try{const _0xc92105=new URL(_0x290d55);return _0xc92105['protocol']+'//'+_0xc92105[_0x148962(_0x15704f._0x58190d)];}catch(_0x34d978){return'';}}function absoluteUrl(_0x264015,_0x4e2c79){if(!_0x264015)return'';try{return new URL(decodeHtml(_0x264015),_0x4e2c79)['toString']();}catch(_0x2946a5){return'';}}function isDirectVideo(_0xe14265){const _0x1da15f={_0x223e4a:0x141,_0x4e2f63:0x133},_0x48c672=_0x66bb91;try{const _0x428522=new URL(_0xe14265)[_0x48c672(_0x1da15f._0x223e4a)][_0x48c672(0x11c)]();return _0x428522[_0x48c672(0x146)]('.workers.dev')||_0x428522['endsWith'Line truncated
/**
* uhdmovies - Built from src/uhdmovies/
* Generated: 2026-09-28T09:06:23.265Z
*/
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/uhdmovies/index.js
var import_cheerio_without_node_native2 = __toESM(require("cheerio-without-node-native"));
// src/uhdmovies/constants.js
var DOMAINS_URL = "https://raw.githubusercontent.com/phisher98/TVVVV/refs/heads/main/domains.json";
var FALLBACK_DOMAIN = "https://uhdmovies.my";
var TMDB_API_KEY = "1865f43a0549ca50d341dd9ab8b29f49";
var TMDB_BASE_URL = "https://api.themoviedb.org/3";
var HEADERS = {
"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",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Language": "en-US,en;q=0.9",
"Cache-Control": "max-age=0",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1"
};
// src/uhdmovies/utils.js
var import_cheerio_without_node_native = __toESM(require("cheerio-without-node-native"));
var cachedDomain = "";
function getMainUrl() {
return __async(this, null, function* () {
if (cachedDomain)
return cachedDomain;
try {
const response = yield fetch(DOMAINS_URL, { headers: { "User-Agent": "Mozilla/5.0" } });
const data = yield response.json();
cachedDomain = String(data["UHDMovies"] || FALLBACK_DOMAIN).replace(/\/$/, "");
return cachedDomain;
} catch (e) {
return FALLBACK_DOMAIN;
}
});
}
function getBaseUrl(url) {
try {
const urlObj = new URL(url);
return `${urlObj.protocol}//${urlObj.host}`;
} catch (e) {
return "";
}
}
function fixUrl(url, domain) {
if (!url)
return "";
if (url.startsWith("http"))
return url;
if (url.startsWith("//"))
return `https:${url}`;
if (url.startsWith("/"))
return domain + url;
return `${domain}/${url}`;
}
function bypassHrefli(url) {
return __async(this, null, function* () {
var _a, _b, _c, _d;
const host = getBaseUrl(url);
const cookies = /* @__PURE__ */ new Map();
function absorbCookies(response) {
var _a2, _b2;
let setCookie = "";
try {
const allCookies = (_b2 = (_a2 = response.headers).getSetCookie) == null ? void 0 : _b2.call(_a2);
if (Array.isArray(allCookies))
setCookie = allCookies.join("\n");
} catch (_) {
}
if (!setCookie)
setCookie = response.headers.get("set-cookie") || "";
for (const item of setCookie.split(/\n|,(?=[^;,]+=)/)) {
const pair = item.split(";")[0].trim();
const separator = pair.indexOf("=");
if (separator <= 0)
continue;
const name = pair.slice(0, separator).trim();
const value = pair.slice(separator + 1).trim();
if (!value || value.toLowerCase() === "deleted")
cookies.delete(name);
else
cookies.set(name, value);
}
}
function cookieHeader(extra = {}) {
const values = new Map(cookies);
for (const [name, value] of Object.entries(extra)) {
if (value)
values.set(name, value);
}
return Array.from(values, ([name, value]) => `${name}=${value}`).join("; ");
}
function request(_0) {
return __async(this, arguments, function* (requestUrl, options = {}) {
const headers = __spreadValues(__spreadValues({}, HEADERS), options.headers || {});
const cookie = cookieHeader();
if (cookie)
headers.Cookie = cookie;
const response = yield fetch(requestUrl, __spreadProps(__spreadValues({}, options), { headers }));
absorbCookies(response);
return response;
});
}
try {
let currentUrl = url;
let response = yield request(currentUrl);
let html = yield response.text();
let lastFormData = {};
for (let step = 0; step < 5; step++) {
const $2 = import_cheerio_without_node_native.default.load(html);
const form = $2("form#landing").first();
const action = form.attr("action");
if (!action)
break;
const formData = {};
form.find("input[name]").each((_, el) => {
const name = $2(el).attr("name");
if (name)
formData[name] = $2(el).attr("value") || "";
});
if (Object.keys(formData).length === 0)
break;
lastFormData = formData;
currentUrl = new URL(action, currentUrl).toString();
response = yield request(currentUrl, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Referer": response.url || currentUrl
},
body: new URLSearchParams(formData).toString()
});
html = yield response.text();
if (!import_cheerio_without_node_native.default.load(html)("form#landing").length)
break;
}
const $ = import_cheerio_without_node_native.default.load(html);
let redirectUrl = $("meta[http-equiv='refresh']").attr("content") || "";
redirectUrl = ((_a = redirectUrl.match(/url\s*=\s*['\"]?([^'\";]+)/i)) == null ? void 0 : _a[1]) || "";
if (!redirectUrl) {
const goMatch = html.match(/[?&]go=([^"'&\s]+)/i);
if (goMatch) {
const skToken = decodeURIComponent(goMatch[1]);
const wpHttp2 = lastFormData._wp_http2 || "";
if (wpHttp2)
cookies.set(skToken, wpHttp2);
response = yield request(`${host}?go=${encodeURIComponent(skToken)}`);
html = yield response.text();
const $go = import_cheerio_without_node_native.default.load(html);
redirectUrl = $go("meta[http-equiv='refresh']").attr("content") || "";
redirectUrl = ((_b = redirectUrl.match(/url\s*=\s*['\"]?([^'\";]+)/i)) == null ? void 0 : _b[1]) || "";
}
}
if (!redirectUrl) {
redirectUrl = ((_c = html.match(/(?:location(?:\.href)?\s*=|replace\()\s*['\"]([^'\"]+)['\"]/i)) == null ? void 0 : _c[1]) || "";
}
if (!redirectUrl)
return null;
const driveUrl = new URL(redirectUrl.trim(), response.url || currentUrl).toString();
const driveRes = yield request(driveUrl);
const driveHtml = yield driveRes.text();
const path = (_d = driveHtml.match(/replace\(\s*['\"]([^'\"]+)['\"]\s*\)/i)) == null ? void 0 : _d[1];
if (!path || path === "/404")
return null;
return new URL(path, driveRes.url || driveUrl).toString();
} catch (e) {
console.log("[UHDMovies] Hrefli bypass failed:", e.message);
return null;
}
});
}
function fetchTmdbDetails(tmdbId, mediaType) {
return __async(this, null, function* () {
var _a;
try {
const url = `${TMDB_BASE_URL}/${mediaType}/${tmdbId}?api_key=${TMDB_API_KEY}&append_to_response=external_ids`;
const res = yield fetch(url, {
headers: {
"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",
"Accept": "application/json"
}
});
if (!res.ok)
return null;
const data = yield res.json();
return {
title: mediaType === "movie" ? data.title || data.original_title : data.name || data.original_name,
originalTitle: mediaType === "movie" ? data.original_title : data.original_name,
year: (data.release_date || data.first_air_date || "").substring(0, 4),
imdbId: (_a = data.external_ids) == null ? void 0 : _a.imdb_id
};
} catch (e) {
return null;
}
});
}
function getIndexQuality(str) {
if (!str)
return "Unknown";
const match = str.match(/(\d{3,4})[pP]/);
if (match)
return match[1] + "p";
if (str.toUpperCase().includes("4K") || str.toUpperCase().includes("UHD"))
return "2160p";
return "Unknown";
}
function extractVideoSeed(finallink) {
return __async(this, null, function* () {
try {
const urlObj = new URL(finallink);
const host = urlObj.host || "video-seed.xyz";
const token = finallink.split("?url=")[1];
if (!token)
return null;
const res = yield fetch(`https://${host}/api`, {
method: "POST",
headers: __spreadProps(__spreadValues({}, HEADERS), {
"Content-Type": "application/x-www-form-urlencoded",
"x-token": host,
"Referer": finallink
}),
body: `keys=${encodeURIComponent(token)}`
});
const text = yield res.text();
const urlMatch = text.match(/url":"([^"]+)"/);
return urlMatch ? urlMatch[1].replace(/\\\//g, "/") : null;
} catch (e) {
return null;
}
});
}
function extractDriveseedPage(url) {
return __async(this, null, function* () {
const streams = [];
try {
let pageUrl = url;
if (url.includes("r?key=")) {
const res2 = yield fetch(url, { headers: HEADERS });
const html2 = yield res2.text();
const redirectMatch = html2.match(/replace\("([^"]+)"\)/);
if (redirectMatch) {
pageUrl = fixUrl(redirectMatch[1], getBaseUrl(url));
}
}
const res = yield fetch(pageUrl, { headers: HEADERS });
const html = yield res.text();
const $ = import_cheerio_without_node_native.default.load(html);
const baseDomain = getBaseUrl(pageUrl);
const qualityText = $("li.list-group-item").first().text() || "";
const size = $("li:nth-child(3)").text().replace("Size : ", "").trim();
const quality = getIndexQuality(qualityText);
const elements = $("div.text-center > a").get();
for (const el of elements) {
const text = $(el).text().toLowerCase();
const href = $(el).attr("href");
if (!href)
continue;
if (text.includes("instant download")) {
const instantRes = yield fetch(fixUrl(href, baseDomain), { headers: HEADERS, redirect: "follow" });
if (instantRes.url && instantRes.url.includes("url=")) {
streams.push({ name: "Driveseed Instant", url: instantRes.url.split("url=")[1], quality, size });
}
} else if (text.includes("resume cloud")) {
const cloudRes = yield fetch(fixUrl(href, baseDomain), { headers: HEADERS });
const cloudHtml = yield cloudRes.text();
const link = import_cheerio_without_node_native.default.load(cloudHtml)("a.btn-success").first().attr("href");
if (link)
streams.push({ name: "Driveseed Cloud", url: link, quality, size });
} else if (text.includes("cloud download")) {
streams.push({ name: "Driveseed Cloud", url: fixUrl(href, baseDomain), quality, size });
}
}
} catch (e) {
}
return streams;
});
}
// src/uhdmovies/index.js
function normalizeTitle(value) {
return String(value || "").toLowerCase().replace(/\[[^\]]*\]|\([^)]*\)/g, " ").replace(/[^a-z0-9]+/g, " ").trim().replace(/\s+/g, " ");
}
function getStreams(tmdbId, mediaType, seasonNum = 1, episodeNum = 1) {
return __async(this, null, function* () {
console.log(`[UHDMovies] Querying streams for TMDB: ${tmdbId}, Type: ${mediaType}`);
const details = yield fetchTmdbDetails(tmdbId, mediaType);
if (!details)
return [];
const mainUrl = yield getMainUrl();
try {
let targetUrl = "";
const searchTitles = [...new Set([details.title, details.originalTitle].filter(Boolean))];
for (const query of searchTitles) {
const searchUrl = `${mainUrl}/?s=${encodeURIComponent(query)}`;
const searchRes = yield fetch(searchUrl, { headers: __spreadProps(__spreadValues({}, HEADERS), { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" }) });
if (!searchRes.ok)
continue;
const $search = import_cheerio_without_node_native2.default.load(yield searchRes.text());
const normalizedSearchTitle = normalizeTitle(query);
$search("article.gridlove-post, article.latestPost").each((i, el) => {
const title = $search(el).find("h1.sanket, h2.title a").text() || $search(el).find("a").attr("title") || "";
const href = $search(el).find("div.entry-image > a, h2.title a, a").first().attr("href");
const normalizedResultTitle = normalizeTitle(title);
const titleMatches = normalizedResultTitle && normalizedSearchTitle && (normalizedResultTitle === normalizedSearchTitle || normalizedResultTitle.includes(normalizedSearchTitle) || normalizedSearchTitle.includes(normalizedResultTitle));
const imdbMatches = details.imdbId && title.includes(details.imdbId);
if (href && (titleMatches || imdbMatches)) {
targetUrl = href;
return false;
}
});
if (targetUrl)
break;
}
if (!targetUrl) {
console.log("[UHDMovies] No search result found");
return [];
}
const pageRes = yield fetch(targetUrl, { headers: __spreadProps(__spreadValues({}, HEADERS), { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" }) });
const pageHtml = yield pageRes.text();
const $ = import_cheerio_without_node_native2.default.load(pageHtml);
const allStreams = [];
if (mediaType === "movie") {
const iframeRegex = /\[.*\]/;
$("div.entry-content > p, div.entry-content > div").each((i, el) => {
const text = $(el).text();
if (iframeRegex.test(text)) {
const quality = getIndexQuality(text);
const nextHref = $(el).next().find("a.maxbutton-1, a.maxbutton").attr("href") || $(el).find("a.maxbutton-1, a.maxbutton").attr("href");
if (nextHref) {
allStreams.push({ url: nextHref, quality });
}
}
});
} else {
const episodesMap = {};
let currentSeason = seasonNum;
$("pre, p, a, h3").each((i, el) => {
const text = $(el).text().trim();
const seasonMatch = text.match(/(?:season\s*|S)(\d+)/i);
if (seasonMatch && text.length < 20) {
currentSeason = parseInt(seasonMatch[1]);
}
if (($(el).is("a") || $(el).find("a").length > 0) && text.toLowerCase().includes("episode")) {
if (text.toLowerCase().includes("zip"))
return;
const epMatch = text.match(/Episode\s*(\d+)/i);
if (epMatch) {
const realEp = parseInt(epMatch[1]);
const epUrl = $(el).is("a") ? $(el).attr("href") : $(el).find("a").attr("href");
if (epUrl) {
const key = `${currentSeason}-${realEp}`;
if (!episodesMap[key])
episodesMap[key] = [];
episodesMap[key].push(epUrl);
}
}
}
});
const targetKey = `${seasonNum}-${episodeNum}`;
const urls = episodesMap[targetKey] || [];
urls.forEach((url) => {
allStreams.push({ url, quality: "Unknown" });
});
}
const finalResults = [];
for (const item of allStreams) {
let finalLink = item.url;
if (finalLink.includes("unblockedgames")) {
finalLink = yield bypassHrefli(finalLink);
}
if (finalLink) {
if (finalLink.includes("driveseed") || finalLink.includes("driveleech")) {
const streams = yield extractDriveseedPage(finalLink);
finalResults.push(...streams.map((s) => __spreadProps(__spreadValues({}, s), {
name: "UHDMovies [Driveseed]",
title: `UHDMovies - ${s.quality} ${s.size ? `[${s.size}]` : ""}`,
quality: s.quality || item.quality,
provider: "uhdmovies"
})));
} else if (finalLink.includes("video-seed")) {
const streamUrl = yield extractVideoSeed(finalLink);
if (streamUrl) {
finalResults.push({
name: "UHDMovies [VideoSeed]",
title: `UHDMovies - ${item.quality}`,
url: streamUrl,
quality: item.quality,
provider: "uhdmovies"
});
}
} else {
finalResults.push({
name: "UHDMovies",
title: `UHDMovies - ${item.quality}`,
url: finalLink,
quality: item.quality,
provider: "uhdmovies"
});
}
}
}
return finalResults;
} catch (e) {
console.error("[UHDMovies] Error:", e.message);
return [];
}
});
}
module.exports = { getStreams };