Remove proxy and fix subtitles

This commit is contained in:
aka paul
2026-04-30 16:52:45 +02:00
parent d55b0dbcfc
commit 286041b093
+11 -12
View File
@@ -27,7 +27,7 @@ async function searchResults(query) {
if (fullHref && imageSrc && cleanTitle) { if (fullHref && imageSrc && cleanTitle) {
results.push({ results.push({
href: fullHref, href: fullHref,
image: "https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(imageSrc), image: imageSrc,
title: cleanTitle title: cleanTitle
}); });
} }
@@ -44,7 +44,7 @@ async function searchResults(query) {
`${searchBaseUrl}${encodedQuery}&page=3` `${searchBaseUrl}${encodedQuery}&page=3`
]; ];
const responses = await Promise.all(urls.map(url => fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(url)))); const responses = await Promise.all(urls.map(url => fetchv2(url)));
const htmlTexts = await Promise.all(responses.map(response => response.text())); const htmlTexts = await Promise.all(responses.map(response => response.text()));
@@ -60,13 +60,13 @@ async function searchResults(query) {
href: "", href: "",
image: "", image: "",
title: "Search failed: " + error.message title: "Search failed: " + error.message
}]); }]);
}
} }
}
async function extractDetails(url) { async function extractDetails(url) {
try { try {
const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(url)); const response = await fetchv2(url);
const htmlText = await response.text(); const htmlText = await response.text();
const descriptionMatch = (/<div class="description text-expand">([\s\S]*?)<\/div>/.exec(htmlText) || [])[1]; const descriptionMatch = (/<div class="description text-expand">([\s\S]*?)<\/div>/.exec(htmlText) || [])[1];
@@ -90,7 +90,7 @@ async function extractDetails(url) {
async function extractEpisodes(movieUrl) { async function extractEpisodes(movieUrl) {
try { try {
const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(movieUrl)); const response = await fetchv2(movieUrl);
const htmlText = await response.text(); const htmlText = await response.text();
const movieIDMatch = (htmlText.match(/<div class="detail-lower"[^>]*id="movie-rating"[^>]*data-id="([^"]+)"/) || [])[1]; const movieIDMatch = (htmlText.match(/<div class="detail-lower"[^>]*id="movie-rating"[^>]*data-id="([^"]+)"/) || [])[1];
if (!movieIDMatch) { if (!movieIDMatch) {
@@ -105,7 +105,7 @@ async function extractEpisodes(movieUrl) {
const token = movieIdTokenData.result; const token = movieIdTokenData.result;
const episodeListUrl = `https://1movies.bz/ajax/episodes/list?id=${movieIDMatch}&_=${token}`; const episodeListUrl = `https://1movies.bz/ajax/episodes/list?id=${movieIDMatch}&_=${token}`;
const episodeListResponse = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(episodeListUrl)); const episodeListResponse = await fetchv2(episodeListUrl);
const episodeListData = await episodeListResponse.json(); const episodeListData = await episodeListResponse.json();
const cleanedHtml = cleanJsonHtml(episodeListData.result); const cleanedHtml = cleanJsonHtml(episodeListData.result);
@@ -143,7 +143,7 @@ async function extractStreamUrl(url) {
url = url.replace('&_=ENCRYPT_ME', `&_=${encryptedToken}`); url = url.replace('&_=ENCRYPT_ME', `&_=${encryptedToken}`);
} }
const response = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(url)); const response = await fetchv2(url);
const responseData = await response.json(); const responseData = await response.json();
const cleanedHtml = cleanJsonHtml(responseData.result); const cleanedHtml = cleanJsonHtml(responseData.result);
@@ -167,7 +167,7 @@ async function extractStreamUrl(url) {
} }
const streamUrl = `https://1movies.bz/ajax/links/view?id=${serverId}&_=${token}`; const streamUrl = `https://1movies.bz/ajax/links/view?id=${serverId}&_=${token}`;
const streamResponse = await fetchv2("https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(streamUrl)); const streamResponse = await fetchv2(streamUrl);
const streamData = await streamResponse.json(); const streamData = await streamResponse.json();
if (!streamData.result) { if (!streamData.result) {
@@ -175,7 +175,6 @@ async function extractStreamUrl(url) {
return "error"; return "error";
} }
// Fix: no encodeURIComponent, pass headers with browser UA
const decryptData = await fetchv2( const decryptData = await fetchv2(
`https://enc-dec.app/api/dec-movies-flix?text=${streamData.result}`, `https://enc-dec.app/api/dec-movies-flix?text=${streamData.result}`,
headers headers
@@ -219,7 +218,7 @@ async function extractStreamUrl(url) {
"POST", "POST",
JSON.stringify({ text: result, agent: headers["User-Agent"] }) JSON.stringify({ text: result, agent: headers["User-Agent"] })
).then(res => res.json()); ).then(res => res.json());
console.log("Final JSON: " + JSON.stringify(finalJson));
const m3u8Link = finalJson?.result?.sources?.[0]?.file; const m3u8Link = finalJson?.result?.sources?.[0]?.file;
const m3u8Response = await fetchv2(m3u8Link); const m3u8Response = await fetchv2(m3u8Link);
@@ -253,7 +252,7 @@ async function extractStreamUrl(url) {
const returnValue = { const returnValue = {
streams: streams, streams: streams,
subtitle: englishSubUrl !== "N/A" ? englishSubUrl : "" subtitles: englishSubUrl !== "N/A" ? englishSubUrl : ""
}; };
console.log("RETURN: " + JSON.stringify(returnValue)); console.log("RETURN: " + JSON.stringify(returnValue));
return JSON.stringify(returnValue); return JSON.stringify(returnValue);