Skip to content

Instantly share code, notes, and snippets.

@freaktechnik
Created October 13, 2020 20:59
Show Gist options
  • Save freaktechnik/3dc1800bb78cce3da18630ce42908b9b to your computer and use it in GitHub Desktop.
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.
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