b0o / spotify-export

Export a listing of your saved tracks as JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spotify Export

Export a listing of your saved tracks as JSON.

Usage

  1. Install this tool locally
    1. git clone https://github.com/b0o/spotify-export
    1. cd spotify-export
    1. npm install
  1. Navigate to the Spotify Web Player and sign in

  2. Obtain your auth token

    1. Open your browser's devtools
    1. Select the Network tab
    1. Refresh the page
    1. Find any request to the domain api.spotify.com
    1. Select the request, then under Request Headers find the authorization: Bearer ... header
    1. Right click and copy the header
  1. Run index.js, passing your auth token, and redirect stdout to a file:
$ ./index.js "authorization: Bearer <token>" > spotify-saved-songs.json
  1. You can use jq to transform the JSON output as desired, e.g:
$ jq -r '.[] | "\(.track.artists | map(.name) | join(", ")) — \(.track.name)"' spotify-saved-songs.json
Photay — Warmth in the Coldest Acre
Photay — Existential Celebration
Photay — Pressure
Ol' Burger Beats — Bare Horisont - Instrumental
James Blake — Love What Happened Here
Eli Keszler — Measurement Doesn’t Change The System At All
Aphex Twin — Alberto Balsalm
Robbie Basho — Clair de lune (For Twelve-String) [Live]
Mount Kimbie, James Blake — How We Got By
Mount Kimbie — Delta
...

License

© 2020 Maddison Hellstrom

Released under the GNU General Public License, version 3.0 or later.

About

Export a listing of your saved tracks as JSON

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%