Fix issue with spaced paths

pull/180/head
Andrew 2 years ago
parent 9fe8d60f50
commit d74636d4cb

@ -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 .",

@ -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"))();

@ -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",

Loading…
Cancel
Save