diff --git a/config.js b/config.js index a856fe5..3c7d6a7 100644 --- a/config.js +++ b/config.js @@ -2,5 +2,6 @@ module.exports = { version: "1.3.0", applicationPort: "8787", debugMode: true, + localMode: true, DiscordRPCID: "1410934537051181146", } \ No newline at end of file diff --git a/ressources/yt-dlp.exe b/ressources/yt-dlp.exe index e5d9be2..59ea495 100644 Binary files a/ressources/yt-dlp.exe and b/ressources/yt-dlp.exe differ diff --git a/server/helpers/path.js b/server/helpers/path.js index 69f69b8..80fa111 100644 --- a/server/helpers/path.js +++ b/server/helpers/path.js @@ -1,13 +1,18 @@ const path = require("path"); const fs = require("fs"); const { app } = require("electron"); +const config = require("../../config"); -const userYtDlp = path.join(app.getPath("userData"), "yt-dlp.exe"); +let userYtDlp; const sourceYtDlp = path.join(process.resourcesPath, "yt-dlp.exe"); -if (!fs.existsSync(userYtDlp)) fs.copyFileSync(sourceYtDlp, userYtDlp); +if (config.localMode === true) { -module.exports = { - userYtDlp, - sourceYtDlp -}; + userYtDlp = path.join(__dirname, "../../ressources/yt-dlp.exe"); +} else { + + userYtDlp = path.join(app.getPath("userData"), "yt-dlp.exe"); + if (!fs.existsSync(userYtDlp)) fs.copyFileSync(sourceYtDlp, userYtDlp); +} + +module.exports = { userYtDlp, sourceYtDlp };