Skip to content

dmfutcher/spotify-connect-scrobbler

Repository files navigation

spotify-connect-scrobbler

This project deprecated since Spotify changed the way their Last.fm integration works. Scrobbling now happens on Spotify's servers, rather than the client, so all Connect devices can now scrobble. This is left here for posterity as it's one of my favourite hacks.

spotify-connect-scrobbler is a Last.fm music logging ("scrobbling") service for Spotify. It uses Spotify Connect to allow you to log music played on any Spotify device, including those which do not have any Last.fm support (such as Amazon Echo).

Usage

To use spotify-connect-scrobbler have your Spotify username & password, your Last.fm username & password, plus a Last.fm API key and API secret to hand.

Clone the repo,have Rust installed (v1.18 minimum required) build with Cargo (cargo build). Then run:

./target/debug/spotify-connect-scrobbler --spotify-username <Spotify username> --spotify-password <Spotify password> --lastfm-username <Last.fm username> --lastfm-password <Last.fm password> --lastfm-api-key <Last.fm API key> --lastfm-api-secret <Last.fm API secret>

The service will sit in the background and log all Spotify tracks played from any Connect enabled client to the given Last.fm account. It is strongly recommended that you turn off Last.fm integration in any Spotify client where it is enabled (Desktop & Mobile apps). Instructions for the opposite here.

Other Options

  • --name <Device name> - Sets the Spotify Connect device name (defaults to 'Scrobbler'), this name is visible in the Spotify Connect device chooser in Spotify clients

Implementation

spotify-connect-scrobbler is built on top (more accurately, is a fork of) of Paul Lietar's librespot project, an open-source Spotify Connect implementation in Rust. It connects to Spotify as a fully-fledged Spotify Connect device. The active Spotify Connect device (the one playing music) broadcasts its status to all other Connect devices on an account, in order to show now-playing track data on other clients. For example, when playing Spotify tracks on an Amazon Echo, the Echo device will broadcast the currently playing track so that it can be shown on the Spotify app on your phone). Thus spotify-connect-scrobbler can see the currently playing track and send that to be logged on your Last.fm account.

License

Released under the MIT license. See LICENSE.