From 312a688c893f13d7f9763370c96b54b653478f58 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 28 May 2024 13:27:53 +0400 Subject: [PATCH] Frontend: proxy checkbox --- frontend/index.html | 4 +++- frontend/script.js | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 5b72722..b17faeb 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -15,11 +15,13 @@
+
+ +
diff --git a/frontend/script.js b/frontend/script.js index 2aeb5c5..5d791cb 100644 --- a/frontend/script.js +++ b/frontend/script.js @@ -3,14 +3,15 @@ addEventListener('DOMContentLoaded', () => { const urlField = document.getElementById('url') /** @type{HTMLSelectElement} */ const site = document.getElementById('site-select') + /** @type{HTMLInputElement} */ + const proxyFlag = document.getElementById('proxy-cb') document.getElementById('guess-site-btn').addEventListener('click', () => { const url = urlField.value if (url.includes('/watch?v=') || url.includes('/playlist?list=')) { - if (site.value == 'yt_proxied') { - return - } site.value = 'youtube' + } else if (url.includes('soundcloud.com/')) { + site.value = 'soundcloud' } else if (url.includes('://music.yandex.')) { site.value = 'yandex' } @@ -28,6 +29,7 @@ addEventListener('DOMContentLoaded', () => { action: 'list', site: site.value, url: urlField.value, + proxy: proxyFlag.checked, })) logField.textContent = '' // clear }) @@ -37,6 +39,7 @@ addEventListener('DOMContentLoaded', () => { action: 'download', site: site.value, url: urlField.value, + proxy: proxyFlag.checked, items: items, })) items = []