diff --git a/package.json b/package.json index 561fa62..f69efe0 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,14 @@ { "from": "build/confirm-icon.png", "to": "confirm-icon.png" + }, + { + "from": "ressources/yt-dlp 2025.08.27.exe", + "to": "yt-dlp 2025.08.27.exe" + }, + { + "from": "ressources/ffmpeg.exe", + "to": "ffmpeg.exe" } ], "win": { diff --git a/server/routes/download.js b/server/routes/download.js index 16d3006..21e818b 100644 --- a/server/routes/download.js +++ b/server/routes/download.js @@ -22,8 +22,8 @@ const { Notification } = require("electron"); const logger = require("../logger").logger; // Path vers le fichier exécutable yt-dlp (outil tiers pour le téléchargement) -// const ytDlpPath = path.join(__dirname, '../../yt-dlp.exe'); -const ytDlpPath = path.join(__dirname, '../../ressources/yt-dlp 2025.08.27.exe'); +// const ytDlpPath = path.join(process.resourcesPath, '../../yt-dlp.exe'); +const ytDlpPath = path.join(process.resourcesPath, 'yt-dlp 2025.08.27.exe'); router.post("/", (req, res) => { try { @@ -85,7 +85,7 @@ router.post("/", (req, res) => { "--concurrent-fragments", "8",// accélère le téléchargement "--retries", "10", // réessaie jusqu'à 10 fois en cas d'erreur "--fragment-retries", "10" , // réessaie aussi 10 fois chaque fragment - "--ffmpeg-location", path.join(__dirname, "../../ressources/ffmpeg.exe") + "--ffmpeg-location", path.join(process.resourcesPath, "ffmpeg.exe") ]; // Si l'option audioOnly est activée, on ajoute les flags pour extraction audio en mp3