readd: cookies
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
const { LogType } = require('loguix');
|
const { LogType } = require('loguix');
|
||||||
const clog = new LogType("Youtube-Stream");
|
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');
|
const { __glob } = require('../../utils/GlobalVars');
|
||||||
// Variable globale pour stocker le processus actif
|
// Variable globale pour stocker le processus actif
|
||||||
let currentYtProcess = null;
|
let currentYtProcess = null;
|
||||||
@@ -86,12 +87,11 @@ async function getStream(song, seekTime = 0) {
|
|||||||
ytArgs.push('--download-sections', `*${Math.round(seekTime)}-inf`);
|
ytArgs.push('--download-sections', `*${Math.round(seekTime)}-inf`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // --- GESTION DES COOKIES ---
|
// --- GESTION DES COOKIES ---
|
||||||
// if (__glob.COOKIES) {
|
if (__glob.COOKIES && fs.existsSync(__glob.COOKIES)) {
|
||||||
// // Utiliser le format Netscape pour les cookies est impératif
|
ytArgs.push('--cookies', __glob.COOKIES);
|
||||||
// ytArgs.push('--cookies', __glob.COOKIES);
|
ytArgs.push('--no-cache-dir');
|
||||||
// ytArgs.push('--no-cache-dir'); // Évite les conflits de cache avec les cookies
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// Lancement du nouveau processus
|
// Lancement du nouveau processus
|
||||||
const yt = spawn('yt-dlp', ytArgs);
|
const yt = spawn('yt-dlp', ytArgs);
|
||||||
|
|||||||
Reference in New Issue
Block a user