mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #668] Is there a way to avoid multiple redirects, when you need to use different scopes in the Authorization Code Flow? #395
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#395
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @leej11 on GitHub (Apr 13, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/668
Hi all,
I'm a new user of
spotipyand have just made a draft script to organise my saved tracks into YearMonth playlists.In my script I'm using the Authorization Code Flow since I need to access user specific information.
The challenge I've encountered is that I end up having to authenticate with the Redirect URLs multiple times. I believe this is because I'm interacting with the API in a few different scopes.
For example the scopes I'm using in the script are:
user-library-readscope is used to get my saved tracksplaylist-modify-publicscope is used to create my playlistsplaylist-read-privatescope is used to read my playlistsplaylist-modify-publicscope is used to add songs to my playlist(s)Am I misunderstanding something? Is there a way to avoid having to do multiple Redirect URL authentications if the code I'm running needs to query the API with different scopes along the way?
Thanks in advance, really keen to get advice and learn!
@stephanebruckert commented on GitHub (Apr 13, 2021):
You can request multiple scopes by doing:
and re-use the same
speverywhere.In the next version, we will also be able to pass a list as a scope, thanks to https://github.com/plamere/spotipy/pull/650
@stephanebruckert commented on GitHub (Apr 13, 2021):
@leej11 I just released 2.18.0, so you should be able to pass a list of scopes now
@stephanebruckert commented on GitHub (Apr 15, 2021):
Closing this, let me know if you have any issue with the above answer
@leej11 commented on GitHub (Apr 17, 2021):
Hi @stephanebruckert, sorry for my delay in getting back to you, had a busy week 😄 Thanks so much for your response, I've just tried it out using
2.18.0and supplying a list of scopes, works like a charm!