diff --git a/.gitignore b/.gitignore index 7361a1d..b044080 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /ressources/ffmpeg.exe /ressources/ffprobe.exe +/ressources/deno.exe logs/*.json logs/*.log \ No newline at end of file diff --git a/package.json b/package.json index 222276b..88375e4 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,10 @@ "from": "ressources/ffprobe.exe", "to": "ffprobe.exe" }, + { + "from": "ressources/deno.exe", + "to": "deno.exe" + }, { "from": "server", "to": "server" diff --git a/public/index.html b/public/index.html index e9535ae..f922d35 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,6 @@ "> - @@ -33,10 +32,8 @@
- Audio seulement (MP3) - + diff --git a/public/script/progressBar.js b/public/script/progressBar.js index 6603520..3cc8c94 100644 --- a/public/script/progressBar.js +++ b/public/script/progressBar.js @@ -1,27 +1,27 @@ const progressWrapper = document.getElementById("downloadProgressWrapper"); const progressBar = document.getElementById("downloadProgress"); +const progressBarText = document.getElementById("downloadProgressText") function startProgress() { progressWrapper.style.display = "block"; progressBar.style.width = "0%"; + progressBarText.style.display = "block"; + progressBarText.innerHTML = "0%"; } function updateProgress(percent) { progressBar.style.width = `${percent}%`; + progressBarText.innerHTML = `${percent}%`; } -// Réinitialise et cache function resetProgress() { progressBar.style.width = "0%"; + progressBarText.innerHTML = ""; + progressBarText.style.display = "none"; progressWrapper.style.display = "none"; } -function resetProgressFile() { - progressBar.style.width = "0%"; - // progressWrapper reste visible -} - -// Connexion SSE, c'est Server-sent events est une technologie grâce à laquelle un navigateur reçoit des mises à jour automatiques à partir d'un serveur via une connexion HTTP. +// Connexion SSE const evtSource = new EventSource("/download/progress"); evtSource.onmessage = e => { if (e.data === "reset") { @@ -37,6 +37,6 @@ evtSource.onmessage = e => { const percent = parseFloat(e.data); if (!isNaN(percent)) { updateProgress(percent); - if (percent >= 100) setTimeout(resetProgressFile, 500); + if (percent >= 100) setTimeout(resetProgress, 500); } -}; \ No newline at end of file +}; diff --git a/public/styles/components/progressBar.css b/public/styles/components/progressBar.css index ea14cba..e973728 100644 --- a/public/styles/components/progressBar.css +++ b/public/styles/components/progressBar.css @@ -24,9 +24,8 @@ text-align: center; font-size: 0.8rem; color: #fff; - position: absolute; - width: 100%; - top: -20px; + content: ""; + } /* Responsive pour mobile */ diff --git a/public/styles/theme/themeimport.css b/public/styles/theme/themeimport.css index 887fb90..3e2a493 100644 --- a/public/styles/theme/themeimport.css +++ b/public/styles/theme/themeimport.css @@ -3,9 +3,6 @@ @import url("default-theme.css"); @import url("fanatic-theme.css"); @import url("light-theme.css"); -@import url("cyberpunk-theme.css"); -@import url("spicy-theme.css"); -@import url("vilbrequin-theme.css"); @import url("nf-theme.css"); @import url("drift-theme.css"); @import url("neon-theme.css"); \ No newline at end of file diff --git a/server/helpers/buildArgs.js b/server/helpers/buildArgs.js index 417f815..0d77bbe 100644 --- a/server/helpers/buildArgs.js +++ b/server/helpers/buildArgs.js @@ -13,7 +13,8 @@ function buildYtDlpArgs({ url, audioOnly, quality, outputFolder }) { "--retries", "10", "--fragment-retries", "10", "--ffmpeg-location", path.join(process.resourcesPath, "ffmpeg.exe"), - "--extractor-args","youtube:player_client=default" + "--extractor-args","youtube:player_client=default", + "--js-runtimes", `deno:${path.join(process.resourcesPath, "deno.exe")}` ]; if (audioOnly) args.push("-f", "bestaudio", "--extract-audio", "--audio-format", "mp3"); diff --git a/server/helpers/ytDlp.js b/server/helpers/ytDlp.js deleted file mode 100644 index e69de29..0000000 diff --git a/server/routes/download.js b/server/routes/download.js index 2161c8e..6bb4044 100644 --- a/server/routes/download.js +++ b/server/routes/download.js @@ -5,7 +5,6 @@ const path = require("path"); const fs = require("fs"); const { logger } = require("../logger"); -const config = require("../../config"); const { isValidUrl, isSafePath } = require("../helpers/validation"); const { buildYtDlpArgs } = require("../helpers/buildArgs"); const { notifyDownloadFinished } = require("../helpers/notify");