mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
YTDLP Path DevMode
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user