[GH-ISSUE #523] Python how to play songs without redirect uri (only using IDLE) #314

Closed
opened 2026-02-27 23:21:57 +03:00 by kerem · 3 comments
Owner

Originally created by @Raj-Dave368 on GitHub (Jun 30, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/523

This is my Code:

import spotipy
from spotipy.oauth2 import SpotifyOAuth
from pprint import pprint
from time import sleep

scope = "user-read-playback-state,user-modify-playback-state"
sp = spotipy.Spotify(client_credentials_manager=SpotifyOAuth(scope=scope))

res = sp.devices()
pprint(res)

sp.start_playback(uris=['spotify:track:6gdLoMygLsgktydTQ71b15'])

sp.volume(100)
sleep(2)
sp.volume(50)
sleep(2)
sp.volume(100)

I just want to play this song in my device using only python IDLE
how can i do it

If I specify localhost as a redirect uri then i got error that "specify some port"
if i specify port then i got error that is "code is not provided"
spotipy.oauth2.SpotifyOauthError: error: invalid_request, error_description: code must be supplied

what should i do

Originally created by @Raj-Dave368 on GitHub (Jun 30, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/523 This is my Code: import spotipy from spotipy.oauth2 import SpotifyOAuth from pprint import pprint from time import sleep scope = "user-read-playback-state,user-modify-playback-state" sp = spotipy.Spotify(client_credentials_manager=SpotifyOAuth(scope=scope)) res = sp.devices() pprint(res) sp.start_playback(uris=['spotify:track:6gdLoMygLsgktydTQ71b15']) sp.volume(100) sleep(2) sp.volume(50) sleep(2) sp.volume(100) I just want to play this song in my device using only python IDLE how can i do it If I specify localhost as a redirect uri then i got error that "specify some port" if i specify port then i got error that is "code is not provided" spotipy.oauth2.SpotifyOauthError: error: invalid_request, error_description: code must be supplied what should i do
kerem 2026-02-27 23:21:57 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@stephanebruckert commented on GitHub (Jul 5, 2020):

Does IDLE open your web browser at any point?

<!-- gh-comment-id:653866774 --> @stephanebruckert commented on GitHub (Jul 5, 2020): Does IDLE open your web browser at any point?
Author
Owner

@Raj-Dave368 commented on GitHub (Jul 13, 2020):

Yes for sure, i have enter passwords but after that console produces an error

<!-- gh-comment-id:657332652 --> @Raj-Dave368 commented on GitHub (Jul 13, 2020): Yes for sure, i have enter passwords but after that console produces an error
Author
Owner

@Raj-Dave368 commented on GitHub (Oct 8, 2020):

I was a beginner and was doing the wrong things, there was no issue.

<!-- gh-comment-id:705680846 --> @Raj-Dave368 commented on GitHub (Oct 8, 2020): I was a beginner and was doing the wrong things, there was no issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#314
No description provided.