GithubHelp home page GithubHelp logo

peregrine05 / spotify-image-downloader Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 12 KB

Python command-line tool to download images from Spotify

License: MIT License

Python 100.00%
spotify spotify-api spotify-web-api python spotipy

spotify-image-downloader's Introduction

spotify-image-downloader

This is a simple command-line utility written in Python for downloading most Spotify images accessible through the Spotify Web API. API access requires a Spotify application, which in turn requires a user account. Follow the Setup instructions below.

Setup

This tool requires Python 3 (3.8+ is preferable). Download the code with git clone or with Download ZIP (accessible with the green Code button).

  1. Create a virtual environment (optional).

  2. Run the command:

pip install -r requirements.txt
  1. Package the script with PyInstaller (optional).

Spotify Application Setup

  1. Register a Spotify account. If you are seeking to use this tool, then chances are, you already have one.

  2. Go to the Spotify Developer Dashboard, and create a new application.

  3. Populate the App name, App description, and Redirect URI fields. The Redirect URI field may be set to http://localhost:3000, for example.

  4. Select the Web API to be used.

  5. Read and agree to the Developer Terms of Service. Save the application.

  6. Go to the application settings. You need the information here for the initial use of the script.

First Use

Copy the Client ID and paste it in place of CLIENT_ID in the command below. Copy the Client secret and paste it in place of CLIENT_SECRET in the command below. Then go to Spotify and copy the URL of an artist, an album, a playlist, a user, or a track. Paste it in place of URL in the command below.

python spotify-image-downloader.py URL --client-id CLIENT_ID --client-secret CLIENT_SECRET

After the command completes successfully, --client-id and --client-secret need not be passed in subsequent runs, unless a change is desired or necessary.

General Usage

usage: spotify-image-downloader [-h] [-o OUTPUT] [--client-id CLIENT_ID] [--client-secret CLIENT_SECRET] [--one-time] [--clear] id

Simple command-line utility to download images for Spotify artists, albums, playlists, users, and tracks.

positional arguments:
  id                    URL or URI of the Spotify resource.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output file.

authorization:
  --client-id CLIENT_ID
                        Spotify client ID. Only required on first run.
  --client-secret CLIENT_SECRET
                        Spotify client secret. Only required on first run.
  --one-time            Use the provided authorization without overwriting the saved configuration.
  --clear               Removes the current saved Spotify client configuration.

Pass --one-time along with the Spotify application information to use the provided information without overwriting the configuration saved in the 'config' file.

Pass --clear to delete the saved configuration from the 'config' file and then exit.

Examples

Downloading an image from a Spotify URL:

python spotify-image-downloader.py "https://open.spotify.com/artist/0CGpNBihXlpMsjwHjVKNIO"

Downloading an image from a Spotify URI:

python spotify-image-downloader.py "spotify:artist:0CGpNBihXlpMsjwHjVKNIO"

Specifying a custom output file:

python spotify-image-downloader.py "spotify:artist:0CGpNBihXlpMsjwHjVKNIO" --output "./images/artist.jpg"

spotify-image-downloader's People

Contributors

peregrine05 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.