Giter Club home page Giter Club logo

spotifyexport's Introduction

Export your personal Spotify data: playlists, saved tracks/albums/shows, etc. as JSON.

Setting up

  1. The easiest way is pip3 install --user git+https://github.com/karlicoss/spotifyexport.

    Alternatively, use git clone --recursive, or git pull && git submodule update --init. After that, you can use pip3 install --editable ..

  2. To use the API, you need to create a new app on Spotify for Developers

    For redirect_uri: you can pick pretty much anything, e.g. https://github.com. After that you’ll get client_id and client_secret.

  3. On the first script run, you’ll be prompted to approve the script access.

    Once approved, the token is saved to cache_path (will be created if doesn’t exist). After that you won’t need to enter the password again as long as you pass the same cache_path.

Exporting

Usage:

Recommended: create secrets.py keeping your api parameters, e.g.:

client_id = "CLIENT_ID"
client_secret = "CLIENT_SECRET"
redirect_uri = "REDIRECT_URI"
cache_path = "CACHE_PATH"

After that, use:

python3 -m spotifyexport.export --secrets /path/to/secrets.py > output.json

That way you type less and have control over where you keep your plaintext secrets.

Alternatively, you can pass parameters directly, e.g.

python3 -m spotifyexport.export --client_id <client_id> --client_secret <client_secret> --redirect_uri <redirect_uri> --cache_path <cache_path> > output.json

However, this is verbose and prone to leaking your keys/tokens/passwords in shell history.

I highly recommend checking exported files at least once just to make sure they contain everything you expect from your export. If not, please feel free to ask or raise an issue!

API limitations

  • you might want to do a GDPR export in addition, just in case
  • “Recently played” API endpoint **only returns the 50 most recent tracks**, which makes it kind of useless unless you export the data every hour or so.

    If you care about them, might be a good idea to connect Spotify to Last.FM.

    GPDR export has more tracks, but also seems incomplete (e.g. my data is missing first few years).

Using the data

need to implement the data access bit

spotifyexport's People

Contributors

cobertos avatar karlicoss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

spotifyexport's Issues

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.