mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
23 lines
568 B
Python
23 lines
568 B
Python
# shows acoustic features for tracks for the given artist
|
|
|
|
import json
|
|
import sys
|
|
import time
|
|
|
|
import spotipy
|
|
from spotipy.oauth2 import SpotifyClientCredentials
|
|
|
|
client_credentials_manager = SpotifyClientCredentials()
|
|
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
|
|
sp.trace = True
|
|
|
|
if len(sys.argv) > 1:
|
|
tids = sys.argv[1:]
|
|
print(tids)
|
|
|
|
start = time.time()
|
|
features = sp.audio_features(tids)
|
|
delta = time.time() - start
|
|
print(json.dumps(features, indent=4))
|
|
print(f"features retrieved in {delta:.2f} seconds")
|