Skip to main content

Simple Last.fm Scrobbling Daemon

Project description

slsd - simple last.fm scrobbling daemon

PyPI - Version GitHub Actions Workflow Status

This project was a personal tool of mine turned into a more full (yet minimalistic) program/daemon. It is used for background scrobbling of music to last.fm and is compatible with any music player (and browsers, or other apps) as long as they expose an MPRIS interface to DBus (which most players do). The difference between this program and others is in the daemonization, where compatability is maximized since systemd can be odd sometimes, and with the setup -- installing the program is easy with pipx, and the program itself provides a cli for setting up the systemd service file.

Installation

pipx install slsd
slsd install-service (or 'slsd run' to run it in the foreground)

After install, simply follow the steps that will be displayed in your terminal:

Systemd user service file created successfully!
Path: /home/aidan/.config/systemd/user/slsd.service

Please set up the config file in $XDG_CONFIG_HOME/slsd/config.toml
template can be found in the README

To enable the service::
  systemctl --user daemon-reload
  systemctl --user enable --now slsd.service

To check its status and logs:
  systemctl --user status slsd.service
  journalctl --user -u slsd.service -f

Configuration

This project looks for $XDG_CONFIG_HOME/slsd/config.toml

Template:

[credentials]
username = "lastfm_username"
password = "lastfm_password"
api_key = "7abd4278b39f061fc108bdf148c67db4" # Get these from your account page
api_secret = "4281fcb749ba1ec9c1e32121d85c0192c"

[options]
blacklist = ["firefox-esr", "playerctl", "spotify"]
threshold = 30 

Given that this is a universal scrobbler for all programs that expose an MPRIS interface, here are some things that you might want to blacklist:

  1. Browsers - unless you want to scrobble your youtube watch history
  2. Programs that may cause conflict. Example: playerctl which proxies over other mpris programs, resulting in duplicate scrobbles and other race conditions
  3. Programs which you prefer to use the native scrobbling implementation (ex. last.fm's official spotify scrobbler)

The threshold key defines your hard scrobble threshold in seconds. The program will scrobble depending on what comes first between: the threshold defined above, half of the song length (if song =>30s), and 4 minutes. With the last two being official last.fm scrobbling spec.

Development

This project uses uv, please ensure that it is installed.

git clone https://github.com/coolport/slsd
cd slsd
uv sync
uv run src/slsd/main.py

to run tests do

uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slsd-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slsd-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file slsd-0.1.0.tar.gz.

File metadata

  • Download URL: slsd-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for slsd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 68bc918451508dcb13ab8971b9b24d77f576ad475bc9d82ac9239e44b75978d2
MD5 791db79e29d9cee885be6e85ba0a5de9
BLAKE2b-256 3ac565ce9430352a873f82acba06df8312dd1ad2d2050783f0d15c5270a7604f

See more details on using hashes here.

File details

Details for the file slsd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: slsd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for slsd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfd2550d441e98f59e8f210f4888a87b9753754c222dc46c89990d289ad718c1
MD5 f954b6061944cb8dd950580ee91e6a27
BLAKE2b-256 06a48d0eb3421940548deb5317d276189aecc94025238f8c377e4a049504849c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page