Update coflix/coflix.js

This commit is contained in:
aka paul 2025-11-07 14:31:51 +00:00
parent 100959be80
commit c22006f5a2

View file

@ -107,8 +107,14 @@ async function extractStreamUrl(url) {
const iframeMatch = html.match(/<iframe[^>]+src="([^"]+)"/i); const iframeMatch = html.match(/<iframe[^>]+src="([^"]+)"/i);
const iframeUrl = iframeMatch ? iframeMatch[1] : null; const iframeUrl = iframeMatch ? iframeMatch[1] : null;
if (!iframeUrl) throw new Error("Iframe not found"); if (!iframeUrl) throw new Error("Iframe not found");
const headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Referer": url,
"origin": "https://coflix.cc"
};
const iframeResp = await fetchv2(iframeUrl); const iframeResp = await fetchv2(iframeUrl, headers);
const iframeHtml = await iframeResp.text(); const iframeHtml = await iframeResp.text();
const uqloadMatch = iframeHtml.match(/<li[^>]*onclick="showVideo\('([^']+)',\s*'[^']+'\)">\s*<img[^>]*src="static\/server\/uqload[^"]*"[^>]*>\s*<span>Uqload/i); const uqloadMatch = iframeHtml.match(/<li[^>]*onclick="showVideo\('([^']+)',\s*'[^']+'\)">\s*<img[^>]*src="static\/server\/uqload[^"]*"[^>]*>\s*<span>Uqload/i);
@ -130,7 +136,12 @@ async function extractStreamUrl(url) {
if (fileMonMatch) { if (fileMonMatch) {
const filemoon = atob(fileMonMatch[1]); const filemoon = atob(fileMonMatch[1]);
console.log("FileMon URL:" + filemoon); console.log("FileMon URL:" + filemoon);
const fileResp = await fetchv2(filemoon); const headers2 = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Referer": "https://lecteurvideo.com/"
};
const fileResp = await fetchv2(filemoon, headers2);
const fileHtml = await fileResp.text(); const fileHtml = await fileResp.text();
return filemoonExtractor(fileHtml, filemoon); return filemoonExtractor(fileHtml, filemoon);
} }