Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nutgaard/spotifyhttpjs
A simple wrapper for Spotify's internal HTTP server.
https://github.com/nutgaard/spotifyhttpjs
Last synced: about 2 months ago
JSON representation
A simple wrapper for Spotify's internal HTTP server.
- Host: GitHub
- URL: https://github.com/nutgaard/spotifyhttpjs
- Owner: nutgaard
- License: unlicense
- Created: 2014-09-13T21:28:06.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-11T07:01:39.000Z (almost 9 years ago)
- Last Synced: 2024-11-18T08:27:48.059Z (about 2 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 15
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SpotifyHttpJs
=============A simple wrapper for Spotify's internal HTTP server.
In order for the script to work you need to extract the csrf token embedded in your Spotify HTTP server.
To get the token you can run the following command in your terminal:```
curl "https://tpcaahshvs.spotilocal.com:4371/simplecsrf/token.json?&ref=&cors=" -H "Pragma: no-cache" -H "Origin: https://embed.spotify.com" -H "Accept-Encoding: gzip,deflate" -H "Accept-Language: en-US,en;q=0.8,da;q=0.6,nb;q=0.4" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2156.0 Safari/537.36" -H "Accept: */*" -H "Referer: https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs" -H "Connection: keep-alive" -H "Cache-Control: no-cache" --compressed
```As an alternative you can go to [Spotify's webpage](https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs)
and run this javascript in your console (Press F12).```
$.get('https://tpcaahshvs.spotilocal.com:4371/simplecsrf/token.json?&ref=&cors=').done(function(d){prompt('This is your token', d.token)});
```or execute it directly in the url bar:
```
javascript:$.get('https://tpcaahshvs.spotilocal.com:4371/simplecsrf/token.json?&ref=&cors=').done(function(d){prompt('This is your token', d.token)});
```To see how to use the library please take a look at the index.html file.