Remove proxy and fix subtitles
This commit is contained in:
+11
-12
@@ -27,7 +27,7 @@ async function searchResults(query) {
|
||||
if (fullHref && imageSrc && cleanTitle) {
|
||||
results.push({
|
||||
href: fullHref,
|
||||
image: "https://deno-proxies-sznvnpnxwhbv.deno.dev/?url=" + encodeURIComponent(imageSrc),
|
||||
image: imageSrc,
|
||||
title: cleanTitle
|
||||
});
|
||||
}
|
||||
@@ -44,7 +44,7 @@ async function searchResults(query) {
|
||||
`${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()));
|
||||
|
||||
@@ -60,13 +60,13 @@ async function searchResults(query) {
|
||||
href: "",
|
||||
image: "",
|
||||
title: "Search failed: " + error.message
|
||||
}]);
|
||||
}]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function extractDetails(url) {
|
||||
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 descriptionMatch = (/<div class="description text-expand">([\s\S]*?)<\/div>/.exec(htmlText) || [])[1];
|
||||
@@ -90,7 +90,7 @@ async function extractDetails(url) {
|
||||
|
||||
async function extractEpisodes(movieUrl) {
|
||||
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 movieIDMatch = (htmlText.match(/<div class="detail-lower"[^>]*id="movie-rating"[^>]*data-id="([^"]+)"/) || [])[1];
|
||||
if (!movieIDMatch) {
|
||||
@@ -105,7 +105,7 @@ async function extractEpisodes(movieUrl) {
|
||||
const token = movieIdTokenData.result;
|
||||
|
||||
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 cleanedHtml = cleanJsonHtml(episodeListData.result);
|
||||
|
||||
@@ -143,7 +143,7 @@ async function extractStreamUrl(url) {
|
||||
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 cleanedHtml = cleanJsonHtml(responseData.result);
|
||||
|
||||
@@ -167,7 +167,7 @@ async function extractStreamUrl(url) {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
if (!streamData.result) {
|
||||
@@ -175,7 +175,6 @@ async function extractStreamUrl(url) {
|
||||
return "error";
|
||||
}
|
||||
|
||||
// Fix: no encodeURIComponent, pass headers with browser UA
|
||||
const decryptData = await fetchv2(
|
||||
`https://enc-dec.app/api/dec-movies-flix?text=${streamData.result}`,
|
||||
headers
|
||||
@@ -219,7 +218,7 @@ async function extractStreamUrl(url) {
|
||||
"POST",
|
||||
JSON.stringify({ text: result, agent: headers["User-Agent"] })
|
||||
).then(res => res.json());
|
||||
|
||||
console.log("Final JSON: " + JSON.stringify(finalJson));
|
||||
const m3u8Link = finalJson?.result?.sources?.[0]?.file;
|
||||
|
||||
const m3u8Response = await fetchv2(m3u8Link);
|
||||
@@ -253,7 +252,7 @@ async function extractStreamUrl(url) {
|
||||
|
||||
const returnValue = {
|
||||
streams: streams,
|
||||
subtitle: englishSubUrl !== "N/A" ? englishSubUrl : ""
|
||||
subtitles: englishSubUrl !== "N/A" ? englishSubUrl : ""
|
||||
};
|
||||
console.log("RETURN: " + JSON.stringify(returnValue));
|
||||
return JSON.stringify(returnValue);
|
||||
|
||||
Reference in New Issue
Block a user