mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 21:26:19 +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 [fastestResult, betaResult] = await Promise.all([racePromise, betaPromise]);
|
||||
const [fastestResult, betaResult, alphaResult] = await Promise.all([racePromise, betaPromise, alphaPromise]);
|
||||
|
||||
const resultStreams = [];
|
||||
let subtitle = null;
|
||||
|
|
@ -221,8 +221,8 @@ async function extractStreamUrl(ID) {
|
|||
}
|
||||
}
|
||||
|
||||
if (betaResult && !betaResult.error && betaResult.data && betaResult.data.streams) {
|
||||
const streams = betaResult.data.streams;
|
||||
if (alphaResult && !alphaResult.error && alphaResult.data && alphaResult.data.streams) {
|
||||
const streams = alphaResult.data.streams;
|
||||
let fourKUrl = null;
|
||||
|
||||
for (let i = 0; i < streams.length; i += 2) {
|
||||
|
|
@ -236,10 +236,10 @@ async function extractStreamUrl(ID) {
|
|||
resultStreams.push({
|
||||
title: "4K",
|
||||
streamUrl: fourKUrl,
|
||||
headers: betaResult.data.referer ? { "Referer": betaResult.data.referer } : {}
|
||||
headers: alphaResult.data.referer ? { "Referer": alphaResult.data.referer } : {}
|
||||
});
|
||||
} else {
|
||||
console.log('Beta did not return a 4K stream');
|
||||
console.log('Alpha did not return a 4K stream');
|
||||
}
|
||||
}
|
||||
console.log(JSON.stringify({
|
||||
|
|
@ -281,7 +281,7 @@ async function soraFetch(url, options = { headers: {}, method: 'GET', body: null
|
|||
async function alpha(ID) {
|
||||
if (ID.includes('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 title = encodeURIComponent(cinebyData.title);
|
||||
|
|
@ -289,7 +289,9 @@ async function alpha(ID) {
|
|||
const imdbId = cinebyData.external_ids?.imdb_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 encrypted = await responseTwo.text();
|
||||
|
|
@ -313,7 +315,9 @@ async function alpha(ID) {
|
|||
const sources = result.sources || [];
|
||||
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(
|
||||
sub => sub.language.toLowerCase().includes('english')
|
||||
|
|
@ -321,8 +325,7 @@ async function alpha(ID) {
|
|||
|
||||
return JSON.stringify({
|
||||
streams,
|
||||
subtitles: englishSubtitle,
|
||||
referer: "https://player.videasy.net/"
|
||||
subtitles: englishSubtitle
|
||||
});
|
||||
} else if (ID.includes('tv')) {
|
||||
const parts = ID.split('/');
|
||||
|
|
@ -330,7 +333,7 @@ async function alpha(ID) {
|
|||
const seasonNumber = parts[3];
|
||||
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 title = encodeURIComponent(cinebyData.name);
|
||||
|
|
@ -338,7 +341,9 @@ async function alpha(ID) {
|
|||
const imdbId = cinebyData.external_ids?.imdb_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 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 decryptedData = await decryptedResponse.json();
|
||||
console.log('Decrypted Data:' + JSON.stringify(decryptedData));
|
||||
|
||||
const result = decryptedData.result || {};
|
||||
const sources = result.sources || [];
|
||||
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(
|
||||
sub => sub.language.toLowerCase().includes('english')
|
||||
|
|
@ -369,8 +377,7 @@ async function alpha(ID) {
|
|||
|
||||
return JSON.stringify({
|
||||
streams,
|
||||
subtitles: englishSubtitle,
|
||||
referer: "https://player.videasy.net/"
|
||||
subtitles: englishSubtitle
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue