From 58dc0dfe1d033619ecc3df21da3ad95ccb4ceee8 Mon Sep 17 00:00:00 2001 From: Sneed Group Holder Date: Mon, 28 Oct 2024 11:52:50 -0500 Subject: [PATCH] modify to watch not view. --- script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script.js b/script.js index 50c7291..df6abb7 100644 --- a/script.js +++ b/script.js @@ -17,7 +17,7 @@ document.getElementById('search-button').addEventListener('click', async () => { listItem.innerHTML = ` ${video.title} (${video.views} views) by ${video.author}
- Download + Watch `; resultsList.appendChild(listItem); }); @@ -28,13 +28,13 @@ document.getElementById('search-button').addEventListener('click', async () => { 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 blob = await downloadResponse.blob(); - const url = window.URL.createObjectURL(blob); + //const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.style.display = 'none'; a.href = url; - a.download = 'video.mp4'; // You might want to set this dynamically + //a.download = 'video.mp4'; // You might want to set this dynamically document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url);