From d74636d4cb667e084bc8328e91bc0686f7e460c6 Mon Sep 17 00:00:00 2001 From: Andrew <66430340+aandrew-me@users.noreply.github.com> Date: Sun, 26 Nov 2023 19:06:45 +0300 Subject: [PATCH] Fix issue with spaced paths --- package.json | 2 +- src/playlist.js | 2 +- src/renderer.js | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index b4879ae..1554549 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "yt-dlp-wrap-plus": "^2.3.18" }, "name": "ytdownloader", - "version": "3.15.0", + "version": "3.15.1", "main": "main.js", "scripts": { "start": "electron .", diff --git a/src/playlist.js b/src/playlist.js index 8a80de7..dd29e7d 100644 --- a/src/playlist.js +++ b/src/playlist.js @@ -6,7 +6,7 @@ const fs = require("fs"); const {execSync} = require("child_process"); let url; const ytDlp = localStorage.getItem("ytdlp"); -const ytdlp = new YTDlpWrap(ytDlp); +const ytdlp = new YTDlpWrap(`"${ytDlp}"`); let downloadDir = localStorage.getItem("downloadPath"); getId("path").textContent = downloadDir; const i18n = new (require("../translations/i18n"))(); diff --git a/src/renderer.js b/src/renderer.js index 9b93862..d95d571 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -132,7 +132,7 @@ async function downloadYtdlp() { getId("popupBox").style.display = "none"; ytDlp = ytdlpPath; - ytdlp = new YTDlpWrap(ytDlp); + ytdlp = new YTDlpWrap(`"${ytDlp}"`); localStorage.setItem("ytdlp", ytDlp); getId("pasteUrl").style.display = "inline-block"; console.log("yt-dlp bin Path: " + ytDlp); @@ -142,7 +142,7 @@ async function downloadYtdlp() { const fullYtdlpBinIsPresent = !!localStorage.getItem("fullYtdlpBinPresent"); -cp.exec(`${ytdlpPath} --version`, (error, stdout, stderr) => { +cp.exec(`"${ytdlpPath}" --version`, (error, stdout, stderr) => { if (error || !fullYtdlpBinIsPresent) { getId("popupBox").style.display = "block"; process.on("uncaughtException", (reason, promise) => { @@ -164,7 +164,7 @@ cp.exec(`${ytdlpPath} --version`, (error, stdout, stderr) => { } else { console.log("yt-dlp binary is present in PATH"); ytDlp = ytdlpPath; - ytdlp = new YTDlpWrap(ytDlp); + ytdlp = new YTDlpWrap(`"${ytDlp}"`); localStorage.setItem("ytdlp", ytDlp); cp.spawn(`${ytDlp}`, ["-U"]).stdout.on("data", (data) => console.log(data.toString("utf8")) @@ -260,7 +260,7 @@ async function getInfo(url) { let info = ""; const infoProcess = cp.spawn( - ytDlp, + `"${ytDlp}"`, [ "-j", "--no-playlist",