Last active
May 18, 2018 01:33
-
-
Save naari3/e4b5bbc7ca80c3be5d1d584e33f69c12 to your computer and use it in GitHub Desktop.
soundcloud artwork download bookmarklet
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
https://codepen.io/naari3/pen/gzQKrw |
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
var url = new URL(document.querySelector('.listenArtworkWrapper span.sc-artwork').style.backgroundImage.slice(5,-2)); | |
fetch(url).then(response => response.blob()).then(blob => { | |
var a = document.createElement("a"); | |
a.href = window.URL.createObjectURL(blob); | |
a.download = url.pathname.split('/').pop(); | |
a.click(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment