Created
September 14, 2015 09:33
-
-
Save adammw/cfacea8b863afeb30c1d to your computer and use it in GitHub Desktop.
Spotify Web Player Hacks
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
// Get the Spotify.Core instance | |
var spotify = Spotify.Instances.get(/(SPFBIn_\d+)_player/.exec(document.querySelector('[id^="SPFBIn"]').id)[1]); | |
// Request the 160kbps MP3 url for a specific track | |
spotify.services.storageResolver.list('spotify:track:0M3adYbGtyRHACP86dey1H', '', function(data) { console.log('Opening MP3 in new window:', a.uri); window.open(a.uri); }, function(e){ console.log('Error:', e); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment