Skip to main content

# Spotify Tracker

Track all the songs you listen to in the Spotify OS X app and save them in a Spotify playlist.

Living in NYC, I spend a fair amount of time underground without cell service. I also listen to a bunch of music on Spotify, and often times I’ll have a song stuck in my head that isn’t saved on my phone. Bad times, right? So on a Hackday, I decided to solve the problem. I created a history playlist where I would save everything I listen to. That way, when someone recommends the sweet new [St. Lucia album](https://open.spotify.com/album/4qH5TQZxM5v7tKT0E09WAK) at work, and I jam out to it, I don’t have to remember to save it or something so I can listen to it on my phone underground.

## The rub

Spotify doesn’t let you see what a user is currently listening to from their web api. Boo. (There’s an issue open on their [web api github page](https://github.com/spotify/web-api/issues/12) that get’s a +1 a day or so, if you want to join…) So instead, I hacked together some AppleScript to grab the current song from the OS X Spotify Client. So, at least for now, this is OS X only. ¯_(ツ)_/¯

## Installation

It’s all setup with pip, so just

` pip install spotifytracker `

It’s written in Python 3, so you’ll need that installed. You’ll also need to setup a Spotify Application. It’s very easy, but you’ll have to quickly signup for a developer account. You can create one [here](https://developer.spotify.com/my-applications/#!/applications). One you have that setup, you can create an app. You’ll need to specify a callback url, but it can be anything. Once that’s all set, you should create a playlist to save your songs to, and then run

` spotifytracker setup `

and add your username, Client ID, Client Secret, and Callback URL. You’ll then authorize your app, and then be asked to pick the playlist to save your history to.

Then, to run

` spotifytracker watch `

## Development

To run from source, use

` python -m spotify_tracker.runner `

## Contribute

This was a Hackday thing, so I don’t have anything specifically planned for this, but if you think it could be better, open a PR!

## License

MIT all the way.

Metadata

Release files for spotifytracker 0.0.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spotifytracker 0.0.17
File Size Uploaded
spotifytracker-0.0.17.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spotifytracker 0.0.17
File Interpreter ABI Platform
spotifytracker-0.0.17-py3-none-any.whl Python 3 none any Details

Total release size: 14.9 kB

Release files / spotifytracker-0.0.17.tar.gz

Download URL spotifytracker-0.0.17.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
61e864ada486ae8a6e23dc2fecb696b773fba24834499fb8fe6916343763f5ef
BLAKE2b-256 checksum
How to use checksums
2d14e4efc94d68714abfa67044d813029b29cac7fe402bee77d0d7a9f98f268b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release files / spotifytracker-0.0.17-py3-none-any.whl

Download URL spotifytracker-0.0.17-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
207d18e3bedc7e042eda5496f4158208a60340a6f8d0d55e11906b3648dfa19e
BLAKE2b-256 checksum
How to use checksums
ffd657183de14cee05aab434b78786c1e78abd55f748e6991484ddd87851aa93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release history Release notifications | RSS feed

0.0.18

2 release files

This release

0.0.17 This release

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page