mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 21:26:19 +01:00
Update 1movies/1movies.js
This commit is contained in:
parent
7e8c4fd655
commit
8e281a5ade
1 changed files with 14 additions and 24 deletions
|
|
@ -98,15 +98,12 @@ async function extractEpisodes(movieUrl) {
|
||||||
error: "MovieID not found"
|
error: "MovieID not found"
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
const movieData = [{ name: "MovieID", data: movieIDMatch }];
|
|
||||||
const tokenResponse = await fetchv2(
|
const movieIdApiUrl = `https://enc-dec.app/api/enc-movies-flix?text=${movieIDMatch}`;
|
||||||
"https://ilovekai.simplepostrequest.workers.dev/ilovethighs",
|
const movieIdTokenResponse = await fetchv2(movieIdApiUrl);
|
||||||
{},
|
const movieIdTokenData = await movieIdTokenResponse.json();
|
||||||
"POST",
|
const token = movieIdTokenData.result;
|
||||||
JSON.stringify(movieData)
|
|
||||||
);
|
|
||||||
const temp = await tokenResponse.json();
|
|
||||||
const token = temp[0]?.data;
|
|
||||||
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(episodeListUrl);
|
const episodeListResponse = await fetchv2(episodeListUrl);
|
||||||
const episodeListData = await episodeListResponse.json();
|
const episodeListData = await episodeListResponse.json();
|
||||||
|
|
@ -115,23 +112,16 @@ async function extractEpisodes(movieUrl) {
|
||||||
const episodeRegex = /<a[^>]+eid="([^"]+)"[^>]+num="([^"]+)"[^>]*>/g;
|
const episodeRegex = /<a[^>]+eid="([^"]+)"[^>]+num="([^"]+)"[^>]*>/g;
|
||||||
const episodeMatches = [...cleanedHtml.matchAll(episodeRegex)];
|
const episodeMatches = [...cleanedHtml.matchAll(episodeRegex)];
|
||||||
|
|
||||||
const episodeData = episodeMatches.map(([_, episodeToken, episodeNum]) => ({
|
const episodeTokenPromises = episodeMatches.map(([_, episodeToken]) => {
|
||||||
name: `Episode ${episodeNum}`,
|
const apiUrl = `https://enc-dec.app/api/enc-movies-flix?text=${episodeToken}`;
|
||||||
data: episodeToken
|
return fetchv2(apiUrl).then(response => response.json());
|
||||||
}));
|
});
|
||||||
|
|
||||||
console.log(JSON.stringify(episodeData));
|
const episodeTokenResults = await Promise.all(episodeTokenPromises);
|
||||||
const batchResponse = await fetchv2(
|
|
||||||
"https://ilovekai.simplepostrequest.workers.dev/ilovethighs",
|
|
||||||
{},
|
|
||||||
"POST",
|
|
||||||
JSON.stringify(episodeData)
|
|
||||||
);
|
|
||||||
const batchResults = await batchResponse.json();
|
|
||||||
|
|
||||||
const episodes = batchResults.map((result, index) => ({
|
const episodes = episodeMatches.map(([_, episodeToken, episodeNum], index) => ({
|
||||||
number: parseInt(episodeMatches[index][2], 10),
|
number: parseInt(episodeNum, 10),
|
||||||
href: `https://1movies.bz/ajax/links/list?eid=${episodeMatches[index][1]}&_=${result.data}`
|
href: `https://1movies.bz/ajax/links/list?eid=${episodeToken}&_=${episodeTokenResults[index].result}`
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return JSON.stringify(episodes);
|
return JSON.stringify(episodes);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue