mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
Translate English
This commit is contained in:
@@ -17,19 +17,19 @@ function fetchDownload(options, listeners, speedListeners) {
|
||||
|
||||
const child = execFile(userYtDlp, args);
|
||||
|
||||
child.on("error", err => reject(new Error(`Erreur yt-dlp : ${err.message}`)));
|
||||
child.on("error", err => reject(new Error(`YT-DLP Error : ${err.message}`)));
|
||||
|
||||
child.on("close", code => {
|
||||
listeners.forEach(fn => fn("done"));
|
||||
if (code === 0) resolve(outputFolder);
|
||||
else reject(new Error(`yt-dlp a échoué avec le code : ${code}`));
|
||||
else reject(new Error(`YT-DLP failed with code : ${code}`));
|
||||
});
|
||||
|
||||
|
||||
child.stdout.on("data", data => {
|
||||
data.toString().split("\n").forEach(line => {
|
||||
if (!line.trim()) return;
|
||||
logger.info(`[yt-dlp stdout] ${line}`);
|
||||
logger.info(`[yt-dlp] ${line}`);
|
||||
|
||||
/* Barre de Chargement*/
|
||||
if (line.startsWith("[download] Destination:")) listeners.forEach(fn => fn("reset"));
|
||||
|
||||
@@ -25,24 +25,24 @@ function fetchInfo(url) {
|
||||
if (stderr) {
|
||||
const lower = stderr.toLowerCase();
|
||||
if (lower.includes("sign in to confirm") || lower.includes("failed to decrypt") || lower.includes("could not copy")) {
|
||||
return reject(new Error(`Impossible d'extraire les cookies depuis ${getUserBrowser()}. Connectez-vous dans ce navigateur et réessayez.`));
|
||||
return reject(new Error(`Unable to extract cookies from ${getUserBrowser()}. Please log in to this browser and try again.`));
|
||||
}
|
||||
}
|
||||
|
||||
if (error) {
|
||||
logger.error(`Erreur yt-dlp: ${error.message}`);
|
||||
logger.error(`YT-DLP Error: ${error.message}`);
|
||||
if (stderr) logger.debug(`stderr: ${stderr}`);
|
||||
return reject(new Error("Impossible de récupérer les infos."));
|
||||
return reject(new Error("Unable to fetch Info."));
|
||||
}
|
||||
|
||||
if (!stdout) return reject(new Error("Aucune donnée reçue."));
|
||||
if (!stdout) return reject(new Error("No Data Received."));
|
||||
|
||||
try {
|
||||
const data = JSON.parse(stdout);
|
||||
resolve(data);
|
||||
} catch (e) {
|
||||
logger.error(`Erreur parsing JSON: ${e.message}`);
|
||||
reject(new Error("JSON illisible."));
|
||||
logger.error(`JSON Parsing Error: ${e.message}`);
|
||||
reject(new Error("JSON unreadable."));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user