Skip to content

Instantly share code, notes, and snippets.

@adammw
Created September 14, 2015 09:33
Show Gist options
  • Save adammw/cfacea8b863afeb30c1d to your computer and use it in GitHub Desktop.
Save adammw/cfacea8b863afeb30c1d to your computer and use it in GitHub Desktop.
Spotify Web Player Hacks
// 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