readd: cookies
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user