From 6ed38b62f821a5f9a1e0bdb21bebc28976c26bdd Mon Sep 17 00:00:00 2001 From: Raphix Date: Sun, 28 Jun 2026 14:03:03 +0200 Subject: [PATCH] readd: cookies --- src/player/Method/Youtube.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/player/Method/Youtube.js b/src/player/Method/Youtube.js index 18a2824..8abaf7c 100644 --- a/src/player/Method/Youtube.js +++ b/src/player/Method/Youtube.js @@ -1,6 +1,7 @@ const { LogType } = require('loguix'); const clog = new LogType("Youtube-Stream"); -const { spawn } = require('child_process'); +const { spawn, exec } = require('child_process'); +const fs = require('fs'); const { __glob } = require('../../utils/GlobalVars'); // Variable globale pour stocker le processus actif let currentYtProcess = null; @@ -86,12 +87,11 @@ async function getStream(song, seekTime = 0) { ytArgs.push('--download-sections', `*${Math.round(seekTime)}-inf`); } - // // --- GESTION DES COOKIES --- - // if (__glob.COOKIES) { - // // Utiliser le format Netscape pour les cookies est impératif - // ytArgs.push('--cookies', __glob.COOKIES); - // ytArgs.push('--no-cache-dir'); // Évite les conflits de cache avec les cookies - // } + // --- GESTION DES COOKIES --- + if (__glob.COOKIES && fs.existsSync(__glob.COOKIES)) { + ytArgs.push('--cookies', __glob.COOKIES); + ytArgs.push('--no-cache-dir'); + } // Lancement du nouveau processus const yt = spawn('yt-dlp', ytArgs);