config.js modified, downloads.js modified, trendimovies.js removed, sdk.js modified, anipm.js removed, mapple.js removed, megasource.js removed, meowtv.js modified, nova.js removed, purstream.js modified, videasy.js removed, vidvault.js modified, xpass.js removed, zxcstream.js removed, subtitles.js modified, test/index.js modified, 111477.js added, 4khdhub.js added, downloadeverything.js added, movienight.js added, movy.js added, streamaggregator.js added, vadapav.js added, vuflix.js added, xdownloader.js added

This commit is contained in:
2026-09-13 18:18:33 -07:00
parent 9e3431b5f7
commit 2e04c64f66
26 changed files with 2171 additions and 865 deletions

View File

@@ -1,12 +1,53 @@
import { getDownloads, getDownloadsTv } from "./sources/trendimovies.js";
import SOURCES from "../config.js";
export async function fetchDownloads(id, s = null, e = null) {
try {
const res = s != null && e != null
? await getDownloadsTv(id, s, e)
: await getDownloads(id);
return res || [];
} catch {
return [];
export async function fetchDownloads(sdkOrId, idOrS = null, sOrE = null, maybeE = null) {
let sdk = null;
let id = sdkOrId;
let s = idOrS;
let e = sOrE;
if (sdkOrId && typeof sdkOrId === 'object' && typeof sdkOrId.getStream === 'function') {
sdk = sdkOrId;
id = idOrS;
s = sOrE;
e = maybeE;
}
if (!sdk || !id) return [];
const activeSources = SOURCES.filter(cfg => !cfg.disabled && cfg.skipProxy);
const seenUrls = new Set();
const downloads = [];
const results = await Promise.allSettled(
activeSources.map(async (cfg) => {
try {
const res = await sdk.getStream(cfg.key, id, s, e);
if (!res) return;
const items = Array.isArray(res.allUrls) && res.allUrls.length > 0
? res.allUrls
: (res.url ? [{ url: res.url, label: cfg.label }] : []);
for (const item of items) {
if (!item?.url || typeof item.url !== 'string') continue;
const url = item.url.trim();
if (!url.startsWith('http') || url.includes('.m3u8')) continue;
if (!/\.mp4(\?|$)/i.test(url) && !url.includes('.mp4')) continue;
if (seenUrls.has(url)) continue;
seenUrls.add(url);
downloads.push({
source: cfg.key,
label: item.label || cfg.label,
url,
});
}
} catch { }
})
);
return downloads;
}

View File

@@ -1,63 +0,0 @@
const BASE = "https://trendimovies.com";
const 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",
"Accept-Language": "en-US,en;q=0.9",
"Referer": "https://trendimovies.com/",
};
async function fetchPage(path) {
const res = await fetch(`${BASE}${path}`, { headers: HEADERS });
if (!res.ok) throw new Error(`trendimovies ${res.status}`);
return res.text();
}
function parseLinks(html) {
const m = html.match(/DownloadSection[^>]*props="([^"]+)"/s) ||
html.match(/props="([^"]+)"[^>]*ssr[^>]*client="load"[^>]*opts="[^"]*DownloadSection/s);
if (!m) {
const alt = html.match(/"DownloadSection"/);
if (!alt) return [];
const propsMatch = html.match(/props="({[^"]*DownloadSection[^"]*})"/s);
if (!propsMatch) return [];
return extractLinks(propsMatch[1].replace(/"/g, '"').replace(/'/g, "'"));
}
return extractLinks(m[1].replace(/"/g, '"').replace(/'/g, "'"));
}
function extractLinks(propsJson) {
try {
const parsed = JSON.parse(propsJson);
const rawLinks = parsed?.links?.[1];
if (!Array.isArray(rawLinks)) return [];
return rawLinks
.map(item => item?.[1])
.filter(l => l && typeof l === "object")
.map(l => ({
url: unwrap(l.url),
quality: unwrap(l.quality) || "HD",
size: unwrap(l.file_size) || null,
type: "mkv",
active: unwrap(l.is_active) !== false,
}))
.filter(l => l.url && l.active);
} catch {
return [];
}
}
function unwrap(v) {
if (Array.isArray(v) && v.length === 2 && (v[0] === 0 || v[0] === 1)) return v[1];
return v;
}
export async function getDownloads(tmdbId) {
const html = await fetchPage(`/movie/${tmdbId}`);
return parseLinks(html);
}
export async function getDownloadsTv(tmdbId, season, episode) {
const html = await fetchPage(`/tv/${tmdbId}/season/${season}/episode/${episode}`);
return parseLinks(html);
}