An open API service indexing awesome lists of open source software.

https://github.com/harisekhon/spotify-tools

Spotify Tools - Playlists Backups, Spotify CLI, URI translator, duplication detection / removal, API search queries, API automation etc.
https://github.com/harisekhon/spotify-tools

bash cli golang hacktoberfest perl spotify spotify-api spotify-cmd spotify-metadata-api spotify-uri spotify-web-api tool tools

Last synced: 3 months ago
JSON representation

Spotify Tools - Playlists Backups, Spotify CLI, URI translator, duplication detection / removal, API search queries, API automation etc.

Awesome Lists containing this project

README

          

# Spotify Tools

[![Spotify Profile](https://img.shields.io/badge/Spotify%20Profile-HariSekhon-brightgreen?logo=spotify&style=social)](https://open.spotify.com/user/harisekhon)
[![GitHub stars](https://img.shields.io/github/stars/harisekhon/spotify-tools?logo=github)](https://github.com/HariSekhon/Spotify-tools/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/harisekhon/spotify-tools?logo=github)](https://github.com/HariSekhon/Spotify-tools/network)
[![LineCount](https://sloc.xyz/github/HariSekhon/Spotify-tools/?badge-bg-color=2081C2)](https://github.com/boyter/scc/)
[![Cocomo](https://sloc.xyz/github/HariSekhon/Spotify-tools/?badge-bg-color=2081C2&category=cocomo)](https://github.com/boyter/scc/)
[![My LinkedIn](https://img.shields.io/badge/LinkedIn%20Profile-HariSekhon-blue?logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIGZpbGw9IiNmZmZmZmYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+TGlua2VkSW48L3RpdGxlPjxwYXRoIGQ9Ik0yMC40NDcgMjAuNDUyaC0zLjU1NHYtNS41NjljMC0xLjMyOC0uMDI3LTMuMDM3LTEuODUyLTMuMDM3LTEuODUzIDAtMi4xMzYgMS40NDUtMi4xMzYgMi45Mzl2NS42NjdIOS4zNTFWOWgzLjQxNHYxLjU2MWguMDQ2Yy40NzctLjkgMS42MzctMS44NSAzLjM3LTEuODUgMy42MDEgMCA0LjI2NyAyLjM3IDQuMjY3IDUuNDU1djYuMjg2ek01LjMzNyA3LjQzM2MtMS4xNDQgMC0yLjA2My0uOTI2LTIuMDYzLTIuMDY1IDAtMS4xMzguOTItMi4wNjMgMi4wNjMtMi4wNjMgMS4xNCAwIDIuMDY0LjkyNSAyLjA2NCAyLjA2MyAwIDEuMTM5LS45MjUgMi4wNjUtMi4wNjQgMi4wNjV6bTEuNzgyIDEzLjAxOUgzLjU1NVY5aDMuNTY0djExLjQ1MnpNMjIuMjI1IDBIMS43NzFDLjc5MiAwIDAgLjc3NCAwIDEuNzI5djIwLjU0MkMwIDIzLjIyNy43OTIgMjQgMS43NzEgMjRoMjAuNDUxQzIzLjIgMjQgMjQgMjMuMjI3IDI0IDIyLjI3MVYxLjcyOUMyNCAuNzc0IDIzLjIgMCAyMi4yMjIgMGguMDAzeiIvPjwvc3ZnPgo=)](https://www.linkedin.com/in/HariSekhon/)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/HariSekhon/Spotify-Tools?logo=github)](https://github.com/HariSekhon/Spotify-tools/commits/master)

[![Codacy](https://app.codacy.com/project/badge/Grade/afe697b0ce3f4df79f16b4b3d2ded54b)](https://www.codacy.com/gh/HariSekhon/Spotify-tools/dashboard)
[![CodeFactor](https://www.codefactor.io/repository/github/harisekhon/spotify-tools/badge)](https://www.codefactor.io/repository/github/harisekhon/spotify-tools)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_Spotify-tools&metric=alert_status)](https://sonarcloud.io/dashboard?id=HariSekhon_Spotify-tools)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_Spotify-tools&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=HariSekhon_Spotify-tools)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_Spotify-tools&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=HariSekhon_Spotify-tools)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_Spotify-tools&metric=security_rating)](https://sonarcloud.io/dashboard?id=HariSekhon_Spotify-tools)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=HariSekhon_Spotify-tools&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=HariSekhon_Spotify-tools)
[![Linux](https://img.shields.io/badge/OS-Linux-blue?logo=linux)](https://github.com/HariSekhon/Spotify-tools#spotify-tools)
[![Mac](https://img.shields.io/badge/OS-Mac-blue?logo=apple)](https://github.com/HariSekhon/Spotify-tools#spotify-tools)

[![CI Builds Overview](https://img.shields.io/badge/CI%20Builds-Overview%20Page-blue?logo=circleci)](https://harisekhon.github.io/CI-CD/)
[![Jenkins](https://img.shields.io/badge/Jenkins-ready-blue?logo=jenkins&logoColor=white)](https://github.com/HariSekhon/Spotify-tools/blob/master/Jenkinsfile)
[![Concourse](https://img.shields.io/badge/Concourse-ready-blue?logo=concourse)](https://github.com/HariSekhon/Spotify-tools/blob/master/cicd/.concourse.yml)
[![GoCD](https://img.shields.io/badge/GoCD-ready-blue?logo=go)](https://github.com/HariSekhon/Spotify-tools/blob/master/cicd/.gocd.yml)
[![TeamCity](https://img.shields.io/badge/TeamCity-ready-blue?logo=teamcity)](https://github.com/HariSekhon/TeamCity-CI)

[![CircleCI](https://circleci.com/gh/HariSekhon/Spotify-tools.svg?style=svg)](https://circleci.com/gh/HariSekhon/Spotify-tools)
[![BuildKite](https://img.shields.io/buildkite/cb0dcf2e1eed7a2c3d6035b8c5ca1bf4a741c1153b89688fcf/master?label=BuildKite&logo=buildkite)](https://buildkite.com/hari-sekhon/Spotify-tools)
[![AppVeyor](https://img.shields.io/appveyor/build/harisekhon/Spotify-tools/master?logo=appveyor&label=AppVeyor)](https://ci.appveyor.com/project/HariSekhon/Spotify-tools/branch/master)
[![Drone](https://img.shields.io/drone/build/HariSekhon/Spotify-tools/master?logo=drone&label=Drone)](https://cloud.drone.io/HariSekhon/Spotify-tools)
[![Codefresh](https://g.codefresh.io/api/badges/pipeline/harisekhon/GitHub%2FSpotify-tools?branch=master&key=eyJhbGciOiJIUzI1NiJ9.NWU1MmM5OGNiM2FiOWUzM2Y3ZDZmYjM3.O69674cW7vYom3v5JOGKXDbYgCVIJU9EWhXUMHl3zwA&type=cf-1)](https://g.codefresh.io/pipelines/edit/new/builds?id=5ec401171350573576125f8d&pipeline=Spotify-tools&projects=GitHub&projectId=5e52ca8ea284e00f882ea992&rightbar=steps&advanced=0&context=github&filter=page:1;pageSize:10;timeFrameStart:week)
[![Cirrus CI](https://img.shields.io/cirrus/github/HariSekhon/Spotify-tools/master?logo=Cirrus%20CI&label=Cirrus%20CI)](https://cirrus-ci.com/github/HariSekhon/Spotify-tools)
[![Semaphore](https://harisekhon.semaphoreci.com/badges/Spotify-tools.svg)](https://harisekhon.semaphoreci.com/projects/Spotify-tools)
[![Buddy](https://img.shields.io/badge/Buddy-ready-1A86FD?logo=buddy)](https://github.com/HariSekhon/Spotify-tools/blob/master/buddy.yml)
[![Shippable](https://img.shields.io/badge/Shippable-legacy-lightgrey?logo=jfrog&label=Shippable)](https://github.com/HariSekhon/Spotify-tools/blob/master/shippable.yml)
[![Travis CI](https://img.shields.io/badge/TravisCI-ready-blue?logo=travis&label=Travis%20CI)](https://github.com/HariSekhon/Spotify-tools/blob/master/.travis.yml)

[![Azure DevOps](https://dev.azure.com/harisekhon/GitHub/_apis/build/status/HariSekhon.spotify-tools?branchName=master)](https://dev.azure.com/harisekhon/GitHub/_build/latest?definitionId=3&branchName=master)
[![GitLab Pipeline](https://img.shields.io/badge/GitLab%20CI-legacy-lightgrey?logo=gitlab)](https://gitlab.com/HariSekhon/spotify-tools/pipelines)
[![BitBucket Pipeline](https://img.shields.io/badge/Bitbucket%20CI-legacy-lightgrey?logo=bitbucket)](https://bitbucket.org/harisekhon/spotify-tools/addon/pipelines/home#!/)
[![AWS CodeBuild](https://img.shields.io/badge/AWS%20CodeBuild-ready-blue?logo=amazon%20aws)](https://github.com/HariSekhon/Spotify-tools/blob/master/cicd/buildspec.yml)
[![GCP Cloud Build](https://img.shields.io/badge/GCP%20Cloud%20Build-ready-blue?logo=google%20cloud&logoColor=white)](https://github.com/HariSekhon/Spotify-tools/blob/master/cicd/cloudbuild.yaml)

[![Repo on GitHub](https://img.shields.io/badge/repo-GitHub-2088FF?logo=github)](https://github.com/HariSekhon/Spotify-tools)
[![Repo on GitLab](https://img.shields.io/badge/repo-GitLab-FCA121?logo=gitlab)](https://gitlab.com/HariSekhon/Spotify-tools)
[![Repo on Azure DevOps](https://img.shields.io/badge/repo-Azure%20DevOps-0078D7?logo=azure%20devops)](https://dev.azure.com/harisekhon/GitHub/_git/Spotify-tools)
[![Repo on BitBucket](https://img.shields.io/badge/repo-BitBucket-0052CC?logo=bitbucket)](https://bitbucket.org/HariSekhon/Spotify-tools)

[![ShellCheck](https://github.com/HariSekhon/Spotify-tools/actions/workflows/shellcheck.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/shellcheck.yaml)
[![JSON](https://github.com/HariSekhon/Spotify-tools/actions/workflows/json.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/json.yaml)
[![YAML](https://github.com/HariSekhon/Spotify-tools/actions/workflows/yaml.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/yaml.yaml)
[![XML](https://github.com/HariSekhon/Spotify-tools/actions/workflows/xml.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/xml.yaml)
[![Markdown](https://github.com/HariSekhon/Spotify-tools/actions/workflows/markdown.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/markdown.yaml)
[![Validation](https://github.com/HariSekhon/Spotify-tools/actions/workflows/validate.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/validate.yaml)
[![Kics](https://github.com/HariSekhon/Spotify-tools/actions/workflows/kics.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/kics.yaml)
[![Grype](https://github.com/HariSekhon/Spotify-tools/actions/workflows/grype.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/grype.yaml)
[![Semgrep](https://github.com/HariSekhon/Spotify-tools/actions/workflows/semgrep.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/semgrep.yaml)
[![Semgrep Cloud](https://github.com/HariSekhon/Spotify-tools/actions/workflows/semgrep-cloud.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/semgrep-cloud.yaml)
[![Trivy](https://github.com/HariSekhon/Spotify-tools/actions/workflows/trivy.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/trivy.yaml)

[![GitHub Actions Ubuntu](https://github.com/HariSekhon/Spotify-tools/workflows/GitHub%20Actions%20Ubuntu/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22GitHub+Actions+Ubuntu%22)
[![Mac](https://github.com/HariSekhon/Spotify-tools/actions/workflows/mac.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/mac.yaml)
[![Mac 11](https://github.com/HariSekhon/Spotify-tools/actions/workflows/mac_11.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/mac_11.yaml)
[![Mac 12](https://github.com/HariSekhon/Spotify-tools/actions/workflows/mac_12.yaml/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions/workflows/mac_12.yaml)
[![Ubuntu](https://github.com/HariSekhon/Spotify-tools/workflows/Ubuntu/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Ubuntu%22)
[![Ubuntu 20.04](https://github.com/HariSekhon/Spotify-tools/workflows/Ubuntu%2020.04/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Ubuntu+20.04%22)
[![Ubuntu 22.04](https://github.com/HariSekhon/Spotify-tools/workflows/Ubuntu%2022.04/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Ubuntu+22.04%22)
[![Debian](https://github.com/HariSekhon/Spotify-tools/workflows/Debian/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Debian%22)
[![Debian 10](https://github.com/HariSekhon/Spotify-tools/workflows/Debian%2010/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Debian+10%22)
[![Debian 11](https://github.com/HariSekhon/Spotify-tools/workflows/Debian%2011/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Debian+11%22)
[![Debian 12](https://github.com/HariSekhon/Spotify-tools/workflows/Debian%2012/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Debian+12%22)
[![Fedora](https://github.com/HariSekhon/Spotify-tools/workflows/Fedora/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Fedora%22)
[![Alpine](https://github.com/HariSekhon/Spotify-tools/workflows/Alpine/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Alpine%22)
[![Alpine 3](https://github.com/HariSekhon/Spotify-tools/workflows/Alpine%203/badge.svg)](https://github.com/HariSekhon/Spotify-tools/actions?query=workflow%3A%22Alpine+3%22)

[git.io/spotify](https://git.io/spotify)

Spotify tools to make it easy to:

- query and control Spotify
- backup all your Spotify playlists
- keep human-readable `Artist - Track` playlists (could migrate to another music system)

My epic [Spotify Playlists](https://github.com/HariSekhon/Spotify-Playlists) collection (recently open sourced) uses this heavily.

Hari Sekhon

Cloud & Big Data Architect, United Kingdom

[![My LinkedIn](https://img.shields.io/badge/LinkedIn%20Profile-HariSekhon-blue?logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIGZpbGw9IiNmZmZmZmYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+TGlua2VkSW48L3RpdGxlPjxwYXRoIGQ9Ik0yMC40NDcgMjAuNDUyaC0zLjU1NHYtNS41NjljMC0xLjMyOC0uMDI3LTMuMDM3LTEuODUyLTMuMDM3LTEuODUzIDAtMi4xMzYgMS40NDUtMi4xMzYgMi45Mzl2NS42NjdIOS4zNTFWOWgzLjQxNHYxLjU2MWguMDQ2Yy40NzctLjkgMS42MzctMS44NSAzLjM3LTEuODUgMy42MDEgMCA0LjI2NyAyLjM3IDQuMjY3IDUuNDU1djYuMjg2ek01LjMzNyA3LjQzM2MtMS4xNDQgMC0yLjA2My0uOTI2LTIuMDYzLTIuMDY1IDAtMS4xMzguOTItMi4wNjMgMi4wNjMtMi4wNjMgMS4xNCAwIDIuMDY0LjkyNSAyLjA2NCAyLjA2MyAwIDEuMTM5LS45MjUgMi4wNjUtMi4wNjQgMi4wNjV6bTEuNzgyIDEzLjAxOUgzLjU1NVY5aDMuNTY0djExLjQ1MnpNMjIuMjI1IDBIMS43NzFDLjc5MiAwIDAgLjc3NCAwIDEuNzI5djIwLjU0MkMwIDIzLjIyNy43OTIgMjQgMS43NzEgMjRoMjAuNDUxQzIzLjIgMjQgMjQgMjMuMjI3IDI0IDIyLjI3MVYxLjcyOUMyNCAuNzc0IDIzLjIgMCAyMi4yMjIgMGguMDAzeiIvPjwvc3ZnPgo=)](https://www.linkedin.com/in/HariSekhon/)
[![Spotify Profile](https://img.shields.io/badge/Spotify%20Profile-HariSekhon-brightgreen?logo=spotify&style=social)](https://open.spotify.com/user/harisekhon)

*(you're welcome to connect with me on LinkedIn)*

## Inventory

- bash-tools/spotify/spotify_*.sh` - [Spotify](https://www.spotify.com/) API scripts
- list all public playlists for any given user, even followed playlists
- list all private playlists for the currently authorized user
- backup all playlists or a selection of playlists by partial name or ID
- download playlist contents as Spotify URIs / `Artists - Track` / CSV format
- convert Spotify track URIs to human readable `Artist - Track` / CSV format
- iterate any command against all playlists - command can be templated with `{playlist}` name or `{playlist_id}` which will be auto-populated on each iteration
- convert a playlist name to an ID, or an ID to a playlist name
- search for tracks / artists / albums and output in either human readable form or as Spotify URIs for fast loading into the Spotify app or automated chaining with other adjacent tools
- list liked / top tracks / artists in either human readable form or as Spotify URIs
- generate a Spotify API token (used by all other bash scripts)
- query any Spotify API endpoint with authentication (used by all other bash scripts)
- `spotify-cmd.pl` - Spotify desktop app control from the command line on Mac via AppleScript calls. Useful for automation that Mac HotKeys don't help with such as auto-nexting tracks every N seconds if you want to skip through sampling a playlist

## Quick Start

If you want to recover an entire deleted playlist, you can do that quickly in the Spotify web interface -> Account -> [Recover Playlists](https://www.spotify.com/uk/account/recover-playlists/) page.

For deleted songs in the desktop app, you can immediately press Control + Shift + Z on Windows or Control + Z on Mac to undo it.

This repo is for everything else - Backups, Conversions from HTTP URIs to readable `Artist - Track` format, tracking individual songs removed from playlists over time (if Spotify loses the rights to them they silently disappear and you won't notice if not Git revision controlling them like my repo [Spotify Playlists](https://github.com/harisekhon/spotify-playists) etc.

### Ready to run Docker image

These programs and their pre-compiled dependencies can be found ready to run on [DockerHub](https://hub.docker.com/r/harisekhon/spotify-tools/).

List all programs:

```shell
docker run harisekhon/spotify-tools
```

Run any given program:

```shell
docker run harisekhon/spotify-tools
```

### Automated Build from source

```shell
git clone https://github.com/HariSekhon/Spotify-tools
cd spotify-tools
make
```

This builds all dependencies after which the programs can be run.

Alternatively see the [Manual Setup](https://github.com/HariSekhon/Spotify-tools#manual-setup) section instead.

## Examples

### Backup Spotify Playlists

Downloads the list of public playlists to `playlists.txt` (names) and `spotify/playlists.txt` (IDs + names in TSV format)

For each playlist, downloads the list of playlist tracks to a file of the same name in both human and Spotify usable formats

As it progresses, it outputs the playlist name followed by the progress of the URI download then the human readable download

`playlists/` files contain the human readable `Artist - Track` format

`playlists/spotify/` files contain the Spotify URI format (for restores or copying to new playlists)

```shell
$ ./bash-tools/spotify/spotify_backup.sh
================================================================================
Running Spotify Playlists Backup
================================================================================

2020-07-05 01:23:41 Dumping list of Spotify playlists to spotify/playlists.txt

2020-07-05 01:23:43 Stripping spotify playlist IDs from spotify/playlists.txt => playlists.txt

2020-07-05 01:23:44 Backing up Spotify playlists to /Users/hari/github/spotify-tools/playlists

My Shazam Tracks => URIs OK => Tracks OK
Upbeat & Sexual Pop => URIs OK => Tracks OK
Best R&B => URIs OK => Tracks OK
Best Pop => URIs OK => Tracks OK
Best Rock => URIs OK => Tracks OK
Best Motown / Funk / Boogie / Groove / Soul => URIs OK => Tracks OK
Chill => URIs OK => Tracks OK
2019 06-07 Venice & Budapest => URIs OK => Tracks OK
2019 05 - Winchester => URIs OK => Tracks OK
2019 04 April - Bath => URIs OK => Tracks OK
2019 01 Jan - South Woodford => URIs OK => Tracks OK
2018 10 Oct - Dec => URIs OK => Tracks OK
2018 09 Sept - Dec => URIs OK => Tracks OK
2018 09 Sept => URIs OK => Tracks OK
2018 08 - Aug - Vienna => URIs OK => Tracks OK
2018 Gemma => URIs OK => Tracks OK
2018 03 March - July Mix => URIs OK => Tracks OK
2018 03 Driving Rock => URIs OK => Tracks OK
2018 02 Feb Mix - London => URIs OK => Tracks OK
2018 Jan - London - A New Beginning => URIs OK => Tracks OK
2017 12 December Mix - Back in London Baby => URIs OK => Tracks OK
2017 11 November Mix - Copenhagen => URIs OK => Tracks OK
2017 10 October Mix - Copenhagen => URIs OK => Tracks OK
2017 09 September Mix - Copenhagen => URIs OK => Tracks OK
2017 08 August Mix - London & Copenhagen => URIs OK => Tracks OK
2017 07 July Mix - Johannesburg => URIs OK => Tracks OK
2017 06 June Mix - Johannesburg => URIs OK => Tracks OK
...
2020-07-05 01:41:42 Spotify playlists backup finished in 1078 seconds
```

### Convert Spotify URIs to Human readable Artist - Track

You can copy and paste the tracks from the Spotify desktop app or web player directly into text files, which puts them in Spotify URI format such as:

```none
http://open.spotify.com/track/61oGXsKgJOI0e3uS2wg1BV
http://open.spotify.com/track/1j6API7GnhE8MRRedK4bda
http://open.spotify.com/track/0RxFoUhB3mAI3qpgLSf7eM
```

or

```none
spotify:track:61oGXsKgJOI0e3uS2wg1BV
spotify:track:1j6API7GnhE8MRRedK4bda
spotify:track:0RxFoUhB3mAI3qpgLSf7eM
```

Then convert this to readable `Artist - Track` form for saving independently of Spotify but running `spotify_uri_to_name.sh` against the file:

```shell
$ ./bash-tools/spotify/spotify_uri_to_name.sh Pendulum.txt
Pendulum - Watercolour
Pendulum - Witchcraft
Pendulum - The Island - Pt. I
...
```

You can also pipe one or more Spotify URIs through standard input in either format that Spotify uses:

```shell
$ echo http://open.spotify.com/track/5TOYgNohZAFEPOtnchPhZS | ./bash-tools/spotify/spotify_uri_to_name.sh
Foo Fighters - Arlandria

echo spotify:track:5TOYgNohZAFEPOtnchPhZS | ./bash-tools/spotify/spotify_uri_to_name.sh
Foo Fighters - Arlandria
```

### Set all the tracks from your favourite playlist to "Liked"

Give the playlist file full of Spotify URIs (dumped by the spotify_backup*.sh scripts above), you can mark all the songs from your favourite playlists as `Liked Songs` which then appear in your `Liked Songs` playlist too:

```shell
spotify_set_tracks_uri_to_liked.sh playlists/spotify/My_Favourite_Playlist
```

If you've been using Spotify a long time, you'll remember that marked songs used to be called `Starred`, but were replaced by `Liked Songs`. Unfortunately Spotify made `Starred` a regular playlist and didn't carry them over, but you can easily mark all previously `Starred` songs as the newer `Liked Songs`:

```shell
spotify_set_tracks_uri_to_liked.sh playlists/spotify/Starred
```

### Spotify Cmd --help

```shell
$ ./spotify-cmd.pl --help

Command line interface to Spotify on Mac that leverages AppleScript

Useful for automation that Mac HotKeys don't help with, such as auto skipping
to next track every N secs to sample a playlist while working

usage: spotify-cmd.pl

commands:

play Play
pause / stop Pause
playpause Toggle Play/Pause
previous Previous Track and print previous track information
next [secs] Next Track and print next track information.
Specifying optional secs will skip to next track
every [secs] seconds. Handy for skipping through a playlist
every 60 secs automatically and grabbing the good songs. Prints
track information every time it skips to the next track

status Show current track details

vol up Turn volume up
vol down Turn volume down
vol <1-100> Set volume to number <1-100>

exit / quit Exit Spotify

-q --quiet Quiet mode. Do not print track information or volume after
completing action
-t --timeout Timeout in secs (default: 10)
-v --verbose Verbose mode (-v, -vv, -vvv ...)
-h --help Print description and usage options
-V --version Print version and exit
```

### Manual Setup

Enter the directory and run git submodule init and git submodule update to fetch my library repo:

```shell
git clone https://github.com/HariSekhon/Spotify-tools
cd spotify-tools
git submodule init
git submodule update
```

Then you will also need to fetch the following CPAN modules listed in `setup/cpan-requirements.txt` and `lib/setup/cpan-requirements.txt`:

Running the cpan command followed by the list of modules (as root) will fetch them for you, or you can use this script:

```shell
bash-tools/perl/perl_cpanm_install.sh setup/cpan-requirements.txt lib/setup/cpan-requirements.txt
```

### Contributions

Patches, improvements and even general feedback are welcome in the form of GitHub pull requests and issue tickets.

### Updating

Run:

```shell
make update
```

This will git pull and then git submodule update which is necessary to pick up corresponding library updates.
ndencies.

If you update often and want to just quickly git pull + submodule update but skip rebuilding all those dependencies each
time then run `make update-no-recompile` (will miss new library dependencies - do full `make update` if you encounter
issues).

[git.io/spotify](https://git.io/spotify)

## More Core Repos

### Knowledge

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Knowledge-Base&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Knowledge-Base)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Diagrams-as-Code&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Diagrams-as-Code)

### DevOps Code

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Bash-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Bash-tools)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Python-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Python-tools)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Perl-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Perl-tools)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Golang-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Golang-tools)

### Containerization

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Kubernetes-configs&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Kubernetes-configs)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Dockerfiles&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Dockerfiles)

### CI/CD

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=GitHub-Actions&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/GitHub-Actions)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Jenkins&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Jenkins)

### DBA - SQL

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=SQL-scripts&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/SQL-scripts)

### DevOps Reloaded

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Nagios-Plugins&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Nagios-Plugins)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=HAProxy-configs&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/HAProxy-configs)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Terraform&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Terraform)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Packer-templates&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Packer-templates)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Nagios-Plugin-Kafka&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Nagios-Plugin-Kafka)

### Templates

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Templates&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Templates)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Template-repo&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Template-repo)

### Misc

[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Spotify-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Spotify-tools)
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Spotify-playlists&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Spotify-playlists)

The rest of my original source repos are
[here](https://github.com/HariSekhon?tab=repositories&q=&type=source&language=&sort=stargazers).

Pre-built Docker images are available on my [DockerHub](https://hub.docker.com/u/harisekhon/).

![](https://hit.yhype.me/github/profile?user_id=2211051)