Skip to content

mirrorfm/spotify-webplayer-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spotify-webplayer-token

Helper to retrieve a Spotify web player access token using the sp_dc cookie.

Uses TOTP authentication with cipher secrets from spot-secrets-go.

To obtain the sp_dc cookie (valid for ~1 year):

To obtain a Spotify token:

Programmatically

  1. Set the SPOTIFY_DC environment variable

  2. Do:

    import (
        "github.com/mirrorfm/spotify-webplayer-token/app"
    )
    
    func main() {
        token, err := app.GetAccessTokenFromEnv()
        // use token.AccessToken
    }

From the command line

  1. In the current repo, create env.json such as:

    {
        "SPOTIFY_DC": "AQAJJvY80mY--nNZ_vWVMyWrvrSse..."
    }
    
  2. Run:

    make setup && make run
    

About

Golang wrapper for Spotify's Web Player's Access token

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors