From c22006f5a291a88e14a6bcaae8715a898d66a544 Mon Sep 17 00:00:00 2001 From: aka paul <50n50@noreply.localhost> Date: Fri, 7 Nov 2025 14:31:51 +0000 Subject: [PATCH] Update coflix/coflix.js --- coflix/coflix.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/coflix/coflix.js b/coflix/coflix.js index 55a2741..bd1f204 100644 --- a/coflix/coflix.js +++ b/coflix/coflix.js @@ -107,8 +107,14 @@ async function extractStreamUrl(url) { const iframeMatch = html.match(/]+src="([^"]+)"/i); const iframeUrl = iframeMatch ? iframeMatch[1] : null; 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 uqloadMatch = iframeHtml.match(/]*onclick="showVideo\('([^']+)',\s*'[^']+'\)">\s*]*src="static\/server\/uqload[^"]*"[^>]*>\s*Uqload/i); @@ -130,7 +136,12 @@ async function extractStreamUrl(url) { if (fileMonMatch) { const filemoon = atob(fileMonMatch[1]); 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(); return filemoonExtractor(fileHtml, filemoon); }