From b73980e38d944a965637e25c4c3d7334420866ca Mon Sep 17 00:00:00 2001 From: aandrew-me Date: Sat, 22 Nov 2025 22:29:48 +0300 Subject: [PATCH] Support paths with spaces for yt-dlp --- src/playlist.js | 12 ++++++++---- src/renderer.js | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/playlist.js b/src/playlist.js index 28c3755..8442621 100644 --- a/src/playlist.js +++ b/src/playlist.js @@ -106,7 +106,7 @@ const playlistDownloader = { loadInitialConfig() { // yt-dlp path this.state.ytDlpPath = localStorage.getItem("ytdlp"); - this.state.ytDlpWrap = new YTDlpWrap(this.state.ytDlpPath); + this.state.ytDlp = new YTDlpWrap(`"${this.state.ytDlpPath}"`); const defaultDownloadsDir = path.join(os.homedir(), "Downloads"); let preferredDir = @@ -142,9 +142,13 @@ const playlistDownloader = { initEventListeners() { this.ui.pasteLinkBtn.addEventListener("click", () => this.pasteLink()); document.addEventListener("keydown", (event) => { - if ((event.ctrlKey && event.key === "v") || (event.metaKey && event.key === "v" && os.platform() === "darwin") && - document.activeElement.tagName !== "INPUT" && - document.activeElement.tagName !== "TEXTAREA" + if ( + (event.ctrlKey && event.key === "v") || + (event.metaKey && + event.key === "v" && + os.platform() === "darwin" && + document.activeElement.tagName !== "INPUT" && + document.activeElement.tagName !== "TEXTAREA") ) { this.pasteLink(); } diff --git a/src/renderer.js b/src/renderer.js index fd9bff4..d21b904 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -142,7 +142,7 @@ class YtDownloaderApp { try { this.state.ytDlpPath = await this._findOrDownloadYtDlp(); - this.state.ytDlp = new YTDlpWrap(this.state.ytDlpPath); + this.state.ytDlp = new YTDlpWrap(`"${this.state.ytDlpPath}"`); this.state.ffmpegPath = await this._findFfmpeg(); this.state.jsRuntimePath = await this._getJsRuntimePath();