Skip to content

Instantly share code, notes, and snippets.

View succinct's full-sized avatar

Nicholas Van Dusen succinct

  • Wiland
  • Denver, CO
View GitHub Profile
@succinct
succinct / trackimage.py
Created March 21, 2022 03:51
Retrieve cover art from Spotify API by searching for artist and track title
# Spotipy: https://spotipy.readthedocs.io/
import argparse, os, re, requests, shutil, spotipy, sys
from spotipy.oauth2 import SpotifyClientCredentials
def main():
parser=argparse.ArgumentParser()
parser.add_argument('--id', help='[REQUIRED] Your Spotify API app client ID (see https://developer.spotify.com/dashboard)')
parser.add_argument('--secret', help='[REQUIRED] Your Spotify API app client secret')
parser.add_argument('--track', help='The full label for the track, in the format "<artist> - <title>"')
parser.add_argument('--artist', help='The track artist (overrides the --track argument)')