From c3079d81ff4e2e50fabe1e9d2c6a75666e963af3 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 24 Aug 2023 21:40:23 +0700 Subject: [PATCH] download video --- extension/script.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extension/script.js b/extension/script.js index 8776ead..cf15a36 100644 --- a/extension/script.js +++ b/extension/script.js @@ -358,15 +358,17 @@ function buildVideoButton(titleContainer) { dlButton.addEventListener('click', e => { e.preventDefault(); - sendButton(dlButton); + sendDownload(dlButton); e.stopPropagation(); }); return dlButton; } -function sendButton(button) { - console.log(button); +function sendDownload(button) { + let url = button.dataset.id; + if (!url) return; + sendUrl(url, 'download', button); } function buttonError(button) {