Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cmd64/6cff9a6baa701d330d84309b056860e7 to your computer and use it in GitHub Desktop.
Save cmd64/6cff9a6baa701d330d84309b056860e7 to your computer and use it in GitHub Desktop.
[JS]
// ==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