mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
* Add python_requires to help pip * Update supported versions in tox.ini * Upgrade Python syntax with pyupgrade --py37-plus * Bump GitHub Actions * Add Python 3.11 and 3.12 to CI * Remove six dependency * Remove redundant dependencies * Remove redudant Python 3.5 code * Drop support for EOL Python 3.7 * Upgrade Python syntax with pyupgrade --py38-plus * Update CHANGELOG * More f-strings --------- Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
20 lines
439 B
Python
20 lines
439 B
Python
# Prints whether a track exists in your collection of saved tracks
|
|
|
|
import pprint
|
|
import sys
|
|
|
|
import spotipy
|
|
from spotipy.oauth2 import SpotifyOAuth
|
|
|
|
scope = 'user-library-read'
|
|
|
|
if len(sys.argv) > 1:
|
|
tid = sys.argv[1]
|
|
else:
|
|
print(f"Usage: {sys.argv[0]} track-id ...")
|
|
sys.exit()
|
|
|
|
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
|
|
results = sp.current_user_saved_tracks_contains(tracks=[tid])
|
|
pprint.pprint(results)
|