Announcements

Help Wizard

Step 1

NEXT STEP

Obtain list of liked albums through non-interactive script

Obtain list of liked albums through non-interactive script

Hi

 

I'm trying to write a script that can be run periodically (cron) and fetches the albums I saved/liked/followed to my library and writes the list to json.

 

Accessing this endpoint requires the 'user-library-read' scope.

https://developer.spotify.com/documentation/general/guides/authorization/scopes/#user-library-read

 

According to the docs, this can only be obtained through the authorization code flow and the implicit grant flow (I'm not 100% sure about the latter but what I gathered from the docs that should be possible). From my understanding, both these flows are meant to be used interactively where the user gets redirected to the spotify account page where he grants those scopes once and then gets an access token everytime upon login. I fear that this login process will be near impossible to automate from a script since it most likely will be using protection against non interactive use (i.e. captchas).

 

Is there any way to obtain a list of the albums I liked in a non-interactive/programatical way?

 

Any help is appreciated, Cheers!

Reply
1 Reply

I recommend you to write the script in Python and use the module  SpotiPy.

If you use that module, you only need to log in once. After that, the module will use the cached access token and refresh token for subsequent runs.

 

 

 

 

 

Suggested posts