Skip to content

Commit

Permalink
Fix issue with spaced paths
Browse files Browse the repository at this point in the history
  • Loading branch information
aandrew-me committed Nov 26, 2023
1 parent 9fe8d60 commit d74636d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 .",
Expand Down
2 changes: 1 addition & 1 deletion src/playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"))();
Expand Down
8 changes: 4 additions & 4 deletions src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) => {
Expand All @@ -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"))
Expand Down Expand Up @@ -260,7 +260,7 @@ async function getInfo(url) {
let info = "";

const infoProcess = cp.spawn(
ytDlp,
`"${ytDlp}"`,
[
"-j",
"--no-playlist",
Expand Down

0 comments on commit d74636d

Please sign in to comment.