Created
October 13, 2020 20:59
-
-
Save freaktechnik/3dc1800bb78cce3da18630ce42908b9b to your computer and use it in GitHub Desktop.
Qobuz makes you download individual tracks in big orders. This automatically downloads an entire album.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function download(album) { | |
const albums = document.querySelectorAll('.order-tracklisting .table'); | |
const target = albums[album]; | |
const downloads = target.querySelectorAll('.btn.tracks'); | |
function wait(time) { | |
return new Promise((resolve) => setTimeout(resolve, time)); | |
} | |
for (const button of downloads) { | |
button.click(); | |
console.log('download'); | |
await wait(2000); | |
document.querySelector('div.close').click(); | |
console.log('close'); | |
} | |
console.log('cover'); | |
target.querySelector('.btn').click(); | |
console.log('done', album); | |
} | |
// download first album in the order | |
download(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment