diff --git a/assets/images/thumb.png b/assets/images/thumb.png new file mode 100644 index 0000000..16447f0 Binary files /dev/null and b/assets/images/thumb.png differ diff --git a/src/renderer.js b/src/renderer.js index 49fb35f..833c09b 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -39,6 +39,7 @@ let downloadDir = ""; // Global variables let title, onlyvideo, id, thumbnail, ytdlp, duration, extractFormat; +let audioExtensionList = []; let rangeCmd = ""; let subs = ""; let subLangs; @@ -235,6 +236,7 @@ getId("pasteUrl").addEventListener("click", () => { // Getting video info async function getInfo(url) { + audioExtensionList = []; let selected = false; onlyvideo = false; let audioIsPresent = false; @@ -343,6 +345,7 @@ async function getInfo(url) { defaultVideoFormat = format.height; } + // Going through audio list if ( format.audio_ext !== "none" || (format.acodec !== "none" && format.video_ext === "none") @@ -352,6 +355,9 @@ async function getInfo(url) { audioSize = Number(format.filesize || format.filesize_approx) / 1000000; + if (!audioExtensionList.includes(format.audio_ext)) { + audioExtensionList.push(format.audio_ext); + } } } for (let format of formats) { @@ -511,7 +517,7 @@ getId("videoDownload").addEventListener("click", (event) => { const randId = Math.random().toFixed(10).toString().slice(2); const item = `