Last active
August 19, 2021 13:27
-
-
Save cmd64/6cff9a6baa701d330d84309b056860e7 to your computer and use it in GitHub Desktop.
[JS]
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
// ==UserScript== | |
// @name Download Artwork From Apple Music | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Download best resolution artwork from Apple Music! | |
// @author CM | |
// @match https://music.apple.com/* | |
// @require https://code.jquery.com/jquery-3.4.1.min.js | |
// @grant GM_download | |
// ==/UserScript== | |
(function ($, undefined) { | |
$(function () { | |
var artworkContainer = $('.product-artwork').eq(0); | |
var artworkSourceSet = artworkContainer.find('source').eq(0).attr('srcset'); | |
var sources = artworkSourceSet.split(','); | |
var imgSrc = sources[sources.length-1].replace(' 3x',''); | |
var fileName = $('.product-header__identity a').text().trim() + ' - ' + $('.product-header__title').text().trim() + " (" + $('.inline-list__item time').text().trim() + ")"; | |
GM_download( { | |
url: imgSrc, | |
name: fileName | |
}); | |
}); | |
})(window.jQuery.noConflict(true)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment