diff --git a/html/playlist.html b/html/playlist.html index 5e8f0d5..644dd2b 100644 --- a/html/playlist.html +++ b/html/playlist.html @@ -34,13 +34,15 @@ #advancedMenu { display: none; } + #typeSelectBox{ + display: none; + } Text copied -
@@ -82,7 +84,15 @@ - +
+
+ + +
+
diff --git a/main.js b/main.js index c96821d..13bfd1f 100644 --- a/main.js +++ b/main.js @@ -248,6 +248,7 @@ ipcMain.on("select-config", () => { }); ipcMain.on("quit", ()=>{ + isQuiting = true; app.quit() }) diff --git a/src/playlist.js b/src/playlist.js index 69e29b8..59a8579 100644 --- a/src/playlist.js +++ b/src/playlist.js @@ -106,6 +106,7 @@ function download(type) { let quality, format, downloadProcess; if (type === "video") { quality = getId("select").value; + videoType = getId("videoTypeSelect").value; const formatId = formats[quality]; if (quality === "best") { format = "-f bv*+ba/best"; @@ -114,7 +115,12 @@ function download(type) { } else if (quality === "useConfig") { format = ""; } else { - format = `-f "${formatId}+m4a/mp4[height=${quality}]+m4a/bv*[height<=${quality}]+ba/best"`; + if (videoType === "mp4"){ + format = `-f "${formatId}+m4a/mp4[height=${quality}]+m4a/bv*[height<=${quality}]+ba/best"`; + } + else{ + format = `-f "webm[height<=${quality}]+opus/bv*[height<=${quality}]+ba/${formatId}+m4a/mp4[height=${quality}]+m4a/best"`; + } } } else { format = getId("audioSelect").value; @@ -488,6 +494,16 @@ audioToggle.addEventListener("click", (event) => { getId("audioBox").style.display = "block"; }); +getId("select").addEventListener("change", () => { + value = getId("select").value + if (value == "best" || value == "worst" || value == "useConfig"){ + getId("typeSelectBox").style.display = "none" + } + else { + getId("typeSelectBox").style.display = "block" + } +}) + // More options let moreOptions = true;