From 516f185e31c44f6aa4d7aa4c97e71763e1ae6ba5 Mon Sep 17 00:00:00 2001 From: evilchili Date: Wed, 4 Sep 2024 23:46:50 -0700 Subject: [PATCH] Add qobuz_bulk_downloader.js --- qobuz_bulk_downloader.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 qobuz_bulk_downloader.js diff --git a/qobuz_bulk_downloader.js b/qobuz_bulk_downloader.js new file mode 100644 index 0000000..b2a61c0 --- /dev/null +++ b/qobuz_bulk_downloader.js @@ -0,0 +1,37 @@ +// ==UserScript== +// @name Qobuz Batch Downloader +// @namespace https://git.evilchi.li/evilchili/qobuz-bulk-downloader +// @version 2024-09-05 +// @description Fuck you and your downloader app. +// @author evilchili +// @match https://www.qobuz.com/account/download/* +// @icon https://www.google.com/s2/favicons?sz=64&domain=qobuz.com +// @grant none +// ==/UserScript== + +(function() { + 'use strict'; + + var btn = document.createElement('div'); + btn.innerHTML = "DOWNLOAD ALL TRACKS"; + btn.setAttribute("class", "btn-white"); + document.querySelector('.product-title').appendChild(btn); + document.getElementById('QBD_download_all').addEventListener('click', () => { + var links = document.querySelectorAll('.tracks'); + var index = 0; + + const click_interval = setInterval(function() { + links[index].click(); + index++; + if (index == links.length) { + clearInterval(click_interval); + } + }, 3000); + + const cover_link = Array.from(document.getElementsByTagName('a')).filter(function (el) { return el.href.indexOf("/cover") > 0 }); + if (cover_link.length > 0) { + cover_link[0].click(); + } + }); + +})(); \ No newline at end of file