mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 13:16:21 +01:00
Update checkmate/checkmate.js
This commit is contained in:
parent
9b8046f7b0
commit
66f1386318
1 changed files with 32 additions and 4 deletions
|
|
@ -710,16 +710,32 @@ async function ilovefeet(imdbId, isSeries = false, season = null, episode = null
|
|||
const staticPathMatch = configText.match(/static_path\s*=\s*['"]([^'"]+)['"]/);
|
||||
const sourceCharsMatch = configText.match(/source_chars\s*=\s*['"]([^'"]+)['"]/);
|
||||
const targetCharsMatch = configText.match(/target_chars\s*=\s*['"]([^'"]+)['"]/);
|
||||
|
||||
const apiServersMatch = configText.match(/api_servers\s*=\s*f?['"]([^'"]+)['"]/);
|
||||
const apiStreamMatch = configText.match(/api_stream\s*=\s*f?['"]([^'"]+)['"]/);
|
||||
|
||||
const baseUrlMatch = configText.match(/base_url\s*=\s*['"]([^'"]+)['"]/);
|
||||
const userAgentMatch = configText.match(/user_agent\s*=\s*['"]([^'"]+)['"]/);
|
||||
const csrfTokenMatch = configText.match(/["']X-Csrf-Token["']:\s*["']([^'"]+)['"]/);
|
||||
const refererMatch = configText.match(/["']Referer["']:\s*["']([^'"]+)['"]/);
|
||||
|
||||
if (!keyHexMatch || !ivHexMatch || !xorKeyMatch || !staticPathMatch || !sourceCharsMatch || !targetCharsMatch) {
|
||||
throw new Error('Failed to extract config values');
|
||||
}
|
||||
|
||||
const convertPythonFString = (str) => {
|
||||
if (!str) return null;
|
||||
return str
|
||||
.replace(/\{static_path\}/g, '{STATIC_PATH}')
|
||||
.replace(/\{encoded_final\}/g, '{ENCODED_FINAL}')
|
||||
.replace(/\{server\}/g, '{SERVER}');
|
||||
};
|
||||
|
||||
const config = {
|
||||
pageMovie: "https://vidfast.pro/movie/{IMDB_ID}",
|
||||
pageSeries: "https://vidfast.pro/tv/{IMDB_ID}/{SEASON}/{EPISODE}",
|
||||
apiServers: "https://vidfast.pro/{STATIC_PATH}/3xNAjSIxZx0b/{ENCODED_FINAL}",
|
||||
apiStream: "https://vidfast.pro/{STATIC_PATH}/Ici0cUs4soE/{SERVER}",
|
||||
apiServers: apiServersMatch ? convertPythonFString(apiServersMatch[1]) : "https://vidfast.pro/{STATIC_PATH}/wfPFjh__qQ/{ENCODED_FINAL}",
|
||||
apiStream: apiStreamMatch ? convertPythonFString(apiStreamMatch[1]) : "https://vidfast.pro/{STATIC_PATH}/AddlBFe5/{SERVER}",
|
||||
|
||||
aesKeyHex: keyHexMatch[1],
|
||||
aesIvHex: ivHexMatch[1],
|
||||
|
|
@ -739,12 +755,24 @@ async function ilovefeet(imdbId, isSeries = false, season = null, episode = null
|
|||
baseUrl = config.pageMovie.replace('{IMDB_ID}', imdbId);
|
||||
}
|
||||
|
||||
let defaultDomain = "https://vidfast.pro/";
|
||||
if (baseUrlMatch && baseUrlMatch[1]) {
|
||||
const urlParts = baseUrlMatch[1].match(/^(https?:\/\/[^\/]+)/);
|
||||
if (urlParts && urlParts[1]) {
|
||||
defaultDomain = urlParts[1] + '/';
|
||||
}
|
||||
}
|
||||
|
||||
const headers = {
|
||||
"Accept": "*/*",
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36",
|
||||
"Referer": "https://vidfast.pro/",
|
||||
"User-Agent": userAgentMatch ? userAgentMatch[1] : "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36",
|
||||
"Referer": refererMatch ? refererMatch[1] : defaultDomain,
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
};
|
||||
|
||||
if (csrfTokenMatch && csrfTokenMatch[1]) {
|
||||
headers["X-Csrf-Token"] = csrfTokenMatch[1];
|
||||
}
|
||||
|
||||
const pageResponse = await fetchv2(baseUrl, headers);
|
||||
const pageText = await pageResponse.text();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue