mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-22 05:36:32 +01:00
Update checkmate/checkmate.js
This commit is contained in:
parent
f926e50798
commit
b9d943966d
1 changed files with 22 additions and 15 deletions
|
|
@ -191,7 +191,7 @@ async function extractStreamUrl(ID) {
|
||||||
|
|
||||||
const racePromise = Promise.race([alphaPromise, gammaPromise, deltaPromise]);
|
const racePromise = Promise.race([alphaPromise, gammaPromise, deltaPromise]);
|
||||||
|
|
||||||
const [fastestResult, betaResult] = await Promise.all([racePromise, betaPromise]);
|
const [fastestResult, betaResult, alphaResult] = await Promise.all([racePromise, betaPromise, alphaPromise]);
|
||||||
|
|
||||||
const resultStreams = [];
|
const resultStreams = [];
|
||||||
let subtitle = null;
|
let subtitle = null;
|
||||||
|
|
@ -221,8 +221,8 @@ async function extractStreamUrl(ID) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (betaResult && !betaResult.error && betaResult.data && betaResult.data.streams) {
|
if (alphaResult && !alphaResult.error && alphaResult.data && alphaResult.data.streams) {
|
||||||
const streams = betaResult.data.streams;
|
const streams = alphaResult.data.streams;
|
||||||
let fourKUrl = null;
|
let fourKUrl = null;
|
||||||
|
|
||||||
for (let i = 0; i < streams.length; i += 2) {
|
for (let i = 0; i < streams.length; i += 2) {
|
||||||
|
|
@ -236,10 +236,10 @@ async function extractStreamUrl(ID) {
|
||||||
resultStreams.push({
|
resultStreams.push({
|
||||||
title: "4K",
|
title: "4K",
|
||||||
streamUrl: fourKUrl,
|
streamUrl: fourKUrl,
|
||||||
headers: betaResult.data.referer ? { "Referer": betaResult.data.referer } : {}
|
headers: alphaResult.data.referer ? { "Referer": alphaResult.data.referer } : {}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('Beta did not return a 4K stream');
|
console.log('Alpha did not return a 4K stream');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(JSON.stringify({
|
console.log(JSON.stringify({
|
||||||
|
|
@ -281,7 +281,7 @@ async function soraFetch(url, options = { headers: {}, method: 'GET', body: null
|
||||||
async function alpha(ID) {
|
async function alpha(ID) {
|
||||||
if (ID.includes('movie')) {
|
if (ID.includes('movie')) {
|
||||||
const tmdbID = ID.replace('/movie/', '');
|
const tmdbID = ID.replace('/movie/', '');
|
||||||
const cinebyResponse = await soraFetch(`https://db.cineby.app/3/movie/${tmdbID}?append_to_response=external_ids&language=en&api_key=ad301b7cc82ffe19273e55e4d4206885`);
|
const cinebyResponse = await soraFetch(`https://jumpfreedom.com/3/movie/${tmdbID}?append_to_response=external_ids&language=en&api_key=ad301b7cc82ffe19273e55e4d4206885`);
|
||||||
const cinebyData = await cinebyResponse.json();
|
const cinebyData = await cinebyResponse.json();
|
||||||
|
|
||||||
const title = encodeURIComponent(cinebyData.title);
|
const title = encodeURIComponent(cinebyData.title);
|
||||||
|
|
@ -289,7 +289,9 @@ async function alpha(ID) {
|
||||||
const imdbId = cinebyData.external_ids?.imdb_id || '';
|
const imdbId = cinebyData.external_ids?.imdb_id || '';
|
||||||
const tmdbId = cinebyData.id;
|
const tmdbId = cinebyData.id;
|
||||||
|
|
||||||
const fullUrl = `https://api.videasy.net/myflixerzupcloud/sources-with-title?title=${title}&mediaType=movie&year=${year}&episodeId=1&seasonId=1&tmdbId=${tmdbId}&imdbId=${imdbId}`;
|
const fullUrl = `https://api.videasy.net/cdn/sources-with-title?title=${title}&mediaType=movie&year=${year}&episodeId=1&seasonId=1&tmdbId=${tmdbId}&imdbId=${imdbId}`;
|
||||||
|
|
||||||
|
console.log('Full URL:' + fullUrl);
|
||||||
|
|
||||||
const responseTwo = await soraFetch(fullUrl);
|
const responseTwo = await soraFetch(fullUrl);
|
||||||
const encrypted = await responseTwo.text();
|
const encrypted = await responseTwo.text();
|
||||||
|
|
@ -313,7 +315,9 @@ async function alpha(ID) {
|
||||||
const sources = result.sources || [];
|
const sources = result.sources || [];
|
||||||
const subtitles = result.subtitles || [];
|
const subtitles = result.subtitles || [];
|
||||||
|
|
||||||
const streams = sources.flatMap(src => [src.quality, src.url]);
|
const nonHDRSources = sources.filter(s => !s.quality.includes("HDR"));
|
||||||
|
|
||||||
|
const streams = nonHDRSources.flatMap(src => [src.quality, src.url]);
|
||||||
|
|
||||||
const englishSubtitle = subtitles.find(
|
const englishSubtitle = subtitles.find(
|
||||||
sub => sub.language.toLowerCase().includes('english')
|
sub => sub.language.toLowerCase().includes('english')
|
||||||
|
|
@ -321,8 +325,7 @@ async function alpha(ID) {
|
||||||
|
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
streams,
|
streams,
|
||||||
subtitles: englishSubtitle,
|
subtitles: englishSubtitle
|
||||||
referer: "https://player.videasy.net/"
|
|
||||||
});
|
});
|
||||||
} else if (ID.includes('tv')) {
|
} else if (ID.includes('tv')) {
|
||||||
const parts = ID.split('/');
|
const parts = ID.split('/');
|
||||||
|
|
@ -330,7 +333,7 @@ async function alpha(ID) {
|
||||||
const seasonNumber = parts[3];
|
const seasonNumber = parts[3];
|
||||||
const episodeNumber = parts[4];
|
const episodeNumber = parts[4];
|
||||||
|
|
||||||
const cinebyResponse = await soraFetch(`https://db.cineby.app/3/tv/${tmdbID}?append_to_response=external_ids&language=en&api_key=ad301b7cc82ffe19273e55e4d4206885`);
|
const cinebyResponse = await soraFetch(`https://jumpfreedom.com/3/tv/${tmdbID}?append_to_response=external_ids&language=en&api_key=ad301b7cc82ffe19273e55e4d4206885`);
|
||||||
const cinebyData = await cinebyResponse.json();
|
const cinebyData = await cinebyResponse.json();
|
||||||
|
|
||||||
const title = encodeURIComponent(cinebyData.name);
|
const title = encodeURIComponent(cinebyData.name);
|
||||||
|
|
@ -338,7 +341,9 @@ async function alpha(ID) {
|
||||||
const imdbId = cinebyData.external_ids?.imdb_id || '';
|
const imdbId = cinebyData.external_ids?.imdb_id || '';
|
||||||
const tmdbId = cinebyData.id;
|
const tmdbId = cinebyData.id;
|
||||||
|
|
||||||
const fullUrl = `https://api.videasy.net/myflixerzupcloud/sources-with-title?title=${title}&mediaType=tv&year=${year}&episodeId=${episodeNumber}&seasonId=${seasonNumber}&tmdbId=${tmdbId}&imdbId=${imdbId}`;
|
const fullUrl = `https://api.videasy.net/cdn/sources-with-title?title=${title}&mediaType=tv&year=${year}&episodeId=${episodeNumber}&seasonId=${seasonNumber}&tmdbId=${tmdbId}&imdbId=${imdbId}`;
|
||||||
|
|
||||||
|
console.log('Full URL:' + fullUrl);
|
||||||
|
|
||||||
const responseTwo = await soraFetch(fullUrl);
|
const responseTwo = await soraFetch(fullUrl);
|
||||||
const encrypted = await responseTwo.text();
|
const encrypted = await responseTwo.text();
|
||||||
|
|
@ -356,12 +361,15 @@ async function alpha(ID) {
|
||||||
|
|
||||||
const decryptedResponse = await fetchv2("https://enc-dec.app/api/dec-videasy", headers, "POST", postData);
|
const decryptedResponse = await fetchv2("https://enc-dec.app/api/dec-videasy", headers, "POST", postData);
|
||||||
const decryptedData = await decryptedResponse.json();
|
const decryptedData = await decryptedResponse.json();
|
||||||
|
console.log('Decrypted Data:' + JSON.stringify(decryptedData));
|
||||||
|
|
||||||
const result = decryptedData.result || {};
|
const result = decryptedData.result || {};
|
||||||
const sources = result.sources || [];
|
const sources = result.sources || [];
|
||||||
const subtitles = result.subtitles || [];
|
const subtitles = result.subtitles || [];
|
||||||
|
|
||||||
const streams = sources.flatMap(src => [src.quality, src.url]);
|
const nonHDRSources = sources.filter(s => !s.quality.includes("HDR"));
|
||||||
|
|
||||||
|
const streams = nonHDRSources.flatMap(src => [src.quality, src.url]);
|
||||||
|
|
||||||
const englishSubtitle = subtitles.find(
|
const englishSubtitle = subtitles.find(
|
||||||
sub => sub.language.toLowerCase().includes('english')
|
sub => sub.language.toLowerCase().includes('english')
|
||||||
|
|
@ -369,8 +377,7 @@ async function alpha(ID) {
|
||||||
|
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
streams,
|
streams,
|
||||||
subtitles: englishSubtitle,
|
subtitles: englishSubtitle
|
||||||
referer: "https://player.videasy.net/"
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue