// ==UserScript== // @name Soundcloud Album Art Downloader // @namespace http://www.dieterholvoet.com // @version 1.6 // @description Allows you to download album art on the Soundcloud website. // @author Dieter Holvoet // @require https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js // @include http://www.soundcloud.com/* // @include http://soundcloud.com/* // @include https://www.soundcloud.com/* // @include https://soundcloud.com/* // @grant none // @downloadURL none // ==/UserScript== setInterval(function() { $('.modal__content:not(.appeared)') .addClass('appeared') .each(function() { var possibleClasses = [".listenArtworkWrapper", ".listenInfo"], previewURL, imageURL, regexp = /t\d{3}x\d{3}/gi; for(var i = 0; i < possibleClasses.length; i++) { if($(possibleClasses[i] + " .image__full").length > 0) { imageURL = $(possibleClasses[i] + " .image__full").css('background-image'); } } if(imageURL === null || imageURL === "") { console.log("SoundCloud Album Art Downloader: No suitable selector found!"); } else { imageURL = imageURL.substring(5, imageURL.length - 2); } previewURL = imageURL.replace(regexp, "t500x500"); imageURL = imageURL.replace(regexp, "original"); $(".modal__content .image__full").parent().remove(); $(".modal__content").append(""); $(".modal__content").append("Open in new tab"); $(".modal__content").append("Download"); }); }, 250);