From b8c9fca4b66700960e9a8f79f062e2a389477af4 Mon Sep 17 00:00:00 2001 From: Sneed Group Holder Date: Mon, 28 Oct 2024 13:07:32 -0500 Subject: [PATCH] "patches, and patches for the patches" --- script.js | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/script.js b/script.js index b59e993..cbe9a51 100644 --- a/script.js +++ b/script.js @@ -21,29 +21,11 @@ document.getElementById('search-button').addEventListener('click', async () => { listItem.innerHTML = ` ${video.title} (${video.views} views) by ${video.author}
- Download + Download `; resultsList.appendChild(listItem); }); - // Add event listeners to download links - document.querySelectorAll('.download-link').forEach(link => { - link.addEventListener('click', async (e) => { - e.preventDefault(); - const videoUrl = e.target.dataset.url; - const downloadResponse = await fetch(`https://ubertuberbe.nodemixaholic.com/download?url=${encodeURIComponent(videoUrl)}`); - const blob = await downloadResponse.blob(); - - const url = window.URL.createObjectURL(blob); - const a = document.createElement('a'); - a.style.display = 'none'; - a.href = url; - a.download = `${getRandomHex}.webm`; // You might want to set this dynamically - document.body.appendChild(a); - window.URL.revokeObjectURL(url); - }); - }); - } catch (error) { console.error('Error fetching videos:', error); alert('An error occurred while searching for videos.');