Works with cmus. Requires Python 3 and has no additional dependencies.
Features:
- offline mode,
- multiple servers,
- now playing request,
- uses MusicBrainz id if present,
- handles pause status well and
- is a short-lived program (not a continuously running process).
Leave cmus_status_scrobbler.ini
file as is after removing servers you don't use.
- Call the program with
--auth
option and follow instructions. - After authenticating with services,
cmus_status_scrobbler.ini
file is edited and saved with new credentials. - Set
cmus_status_scrobbler.py
as your only status display program by invoking:set status_display_program=path/to/cmus_status_scrobbler.py
incmus
or add it to your existing script forcmus
.
Bash script example:
# some other display programs
cmus_status_scrobbler.py "$@" &
# more display programs
#10 (comment)
Make sure to run chmod +rx status_display_program.sh
(or chmod +rx cmus_status_scrobbler.py
) before :set status_display_program=...
.
Example file cmus_status_scrobbler.ini
is in the repository.
It is assumed that this configuration file is stored in ~/.config/cmus/
directory. You can configure db_path
and other options if you do not like the
defaults.
Delete the block for the service that you aren't using.
Pausing a track will not make it scrobble. Continuing the paused track and finishing or stopping it will result in a scrobble if new playing time and playing time before pause satisfy the scrobble requirement (playing time >= 50% of track duration or at least 4 minutes).
Uses sqlite3 to support offline mode and to synchronize the processes in case of multiple status updates (like holding the pause/play button too long).
I use this Python script to scrobble to librefm, lastfm, listenbrainz and my own family scrobbling service.