mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-10-11 17:10:45 +00:00
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:
1 parent
d448d33704
commit
d0ca977647
9 files changed
+126
-137
No files matched your search
@@ -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()
|
||||
|
||||
|
||||
@@ -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,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
|
||||
|
||||
Reference in new issue
Block a user