Support paths with spaces for yt-dlp

release
aandrew-me 4 days ago
parent 39324c1055
commit b73980e38d

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

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

Loading…
Cancel
Save