Skip to content

Commit

Permalink
Made cache_path and username optional (#567)
Browse files Browse the repository at this point in the history
* Made cache_path and username optional

* Update readme and example

* Lint

* Lint

* Feedback / add warning
  • Loading branch information
stephanebruckert authored Aug 30, 2020
1 parent d448d33 commit d0ca977
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 139 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `SpotifyImplicitGrant` warns of security considerations and recommends
`SpotifyPKCE`

### Changed

- Specifying a cache_path or username is now optional

### Fixed

- Using `SpotifyPKCE.get_authorization_url` will now generate a code
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ from spotipy.oauth2 import SpotifyOAuth
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="YOUR_APP_CLIENT_ID",
client_secret="YOUR_APP_CLIENT_SECRET",
redirect_uri="YOUR_APP_REDIRECT_URI",
username="YOUR_SPOTIFY_USERNAME",
scope="user-library-read"))

results = sp.current_user_saved_tracks()
Expand Down
8 changes: 0 additions & 8 deletions examples/my_top_tracks.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
# Shows the top tracks for a user

import sys

import spotipy
from spotipy.oauth2 import SpotifyOAuth

if len(sys.argv) > 1:
username = sys.argv[1]
else:
print("Usage: %s username" % (sys.argv[0],))
sys.exit()

scope = 'user-top-read'
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))

Expand Down
2 changes: 1 addition & 1 deletion examples/remove_specific_tracks_from_playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
track_ids.append({"uri": tid, "positions": [int(pos)]})
else:
print(
"Usage: %s username playlist_id track_id,pos track_id,pos ..." %
"Usage: %s playlist_id track_id,pos track_id,pos ..." %
(sys.argv[0],))
sys.exit()

Expand Down
2 changes: 1 addition & 1 deletion examples/replace_tracks_in_playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
playlist_id = sys.argv[1]
track_ids = sys.argv[2:]
else:
print("Usage: %s username playlist_id track_id ..." % (sys.argv[0],))
print("Usage: %s playlist_id track_id ..." % (sys.argv[0],))
sys.exit()

scope = 'playlist-modify-public'
Expand Down
3 changes: 1 addition & 2 deletions examples/show_user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# shows artist info for a URN or URL
# Shows artist info for a URN or URL

from spotipy.oauth2 import SpotifyClientCredentials
import spotipy
Expand Down
Loading

0 comments on commit d0ca977

Please sign in to comment.