mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
29 lines
607 B
Python
29 lines
607 B
Python
"""
|
|
Deletes user saved album
|
|
|
|
"""
|
|
|
|
import sys
|
|
import spotipy
|
|
import spotipy.util as util
|
|
|
|
if len(sys.argv) > 1:
|
|
username = sys.argv[1]
|
|
else:
|
|
print("Usage: %s username" % (sys.argv[0],))
|
|
sys.exit()
|
|
|
|
scope = 'user-library-modify'
|
|
token = util.prompt_for_user_token(username, scope)
|
|
|
|
if token:
|
|
sp = spotipy.Spotify(auth=token)
|
|
sp.trace = False
|
|
uris = input("input a list of album URIs, URLs or IDs: ")
|
|
uris = list(map(str, uris.split()))
|
|
deleted = sp.current_user_saved_albums_delete(uris)
|
|
print("Deletion successful.")
|
|
|
|
else:
|
|
print("Can't get token for", username)
|