Made cache_path and username optional (#567)

* Made cache_path and username optional

* Update readme and example

* Lint

* Lint

* Feedback / add warning
This commit is contained in:
Stéphane Bruckert authored and GitHub committed 2020-08-30 23:59:38 +01:00
1 parent d448d33704
commit d0ca977647
9 files changed
+126 -137

No files matched your search

-8
View File
@@ -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))
@@ -15,7 +15,7 @@ if len(sys.argv) > 2:
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()
+1 -1
View File
@@ -10,7 +10,7 @@ if len(sys.argv) > 3:
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'
+1 -2
View File
@@ -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