Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Issue with Device Recognition When Using Multiple Accounts in Spotify App Development

Solved!

Issue with Device Recognition When Using Multiple Accounts in Spotify App Development

Hello,

I have a family plan on Spotify, and to keep my playlists separate, I created a second account specifically for app development, which we'll call acc_DEV My main account is acc_MAIN. I created an app on the Spotify Developer Dashboard with the acc_DEV account, called "timing playlist."

I wrote a program on my Raspberry Pi and connected it to the app via spotifyd. I used the client_id and client_secret from the app I created, which I entered into my configuration file. Here's a simplified version of my code (without the actual client_id and client_secret):

import spotipy
from spotipy.oauth2 import SpotifyOAuth

sp = spotipy.Spotify(auth_manager=SpotifyOAuth(
    client_id='your_client_id',
    client_secret='your_client_secret',
    redirect_uri='http://127.0.0.1:8888/callback',
    scope='user-library-read user-read-playback-state user-modify-playback-state'
))

# Try to get list of devices
devices = sp.devices()
print(devices)

 

The issue I'm encountering is that when I run the program, the "Raspberry Pi" device is not found. The only device shown is another one that is linked to my acc_DEV account. However, when I check via my phone (which is logged into my main account, acc_MAIN), I can see and control the "Raspberry Pi" device just fine.

It seems like I may have logged into the app with the wrong user account on my raspberry pi. How can I ensure that my app uses the correct account acc_DEV to control the "Raspberry Pi"?

Thank you in advance for your help!

Best regards,

Renรฉ

Reply

Accepted Solutions
Marked as solution

Hi @Rene25 

The sp.me() function allows you to access the information of the account you initially logged into when executing the script.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

View solution in original post

2 Replies
Marked as solution

Hi @Rene25 

The sp.me() function allows you to access the information of the account you initially logged into when executing the script.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

thanks, ok, I found out, that I created the access token for the wrong user...

Suggested posts

Type a product name