Skip to content

Instantly share code, notes, and snippets.

@WagnerMoreira
Forked from adammw/gist.js
Created December 20, 2016 19:41
Show Gist options
  • Select an option

  • Save WagnerMoreira/e8a31dd25fbb2b787321f1fc04145c39 to your computer and use it in GitHub Desktop.

Select an option

Save WagnerMoreira/e8a31dd25fbb2b787321f1fc04145c39 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