| Crates.io | osx-scrobbler |
| lib.rs | osx-scrobbler |
| version | 0.3.4 |
| created_at | 2026-01-15 00:20:56.657887+00 |
| updated_at | 2026-01-21 19:27:51.333036+00 |
| description | A lightweight macOS menu bar application that scrobbles your music to Last.fm and ListenBrainz |
| homepage | |
| repository | https://github.com/theli-ua/osx-scrobbler |
| max_upload_size | |
| id | 2044237 |
| size | 196,763 |
A lightweight macOS menu bar application that scrobbles your music to Last.fm and ListenBrainz.
[Explicit], [Clean], etc.)The easiest way to install OSX Scrobbler:
# Install the binary
cargo install osx-scrobbler
# Create a macOS app bundle in /Applications/
osx-scrobbler --install-app
That's it! The app will:
~/Library/Logs/osx-scrobbler.logTo start at login: Add "OSX Scrobbler" to System Settings โ General โ Login Items
Note: If you get a permission error during installation, run with sudo:
sudo osx-scrobbler --install-app
The configuration file is located at:
~/Library/Application Support/osx_scrobbler.conf
A default configuration will be created automatically on first run.
# Polling interval in seconds
refresh_interval = 5
# Scrobble after playing this % of the track (or 4 minutes, whichever comes first)
scrobble_threshold = 50
Remove unwanted tags from track/album/artist names before scrobbling:
[cleanup]
enabled = true
patterns = [
# Remove explicit/clean tags
"\\s*\\[Explicit\\]",
"\\s*\\[Clean\\]",
"\\s*\\(Explicit\\)",
"\\s*\\(Clean\\)",
"\\s*- Explicit",
"\\s*- Clean",
]
Add custom patterns:
patterns = [
# ... default patterns ...
# Remove featuring artists
"\\s*\\(feat\\..*?\\)",
"\\s*\\(ft\\..*?\\)",
# Remove remastered tags
"\\s*-\\s*Remastered.*",
"\\s*\\(Remastered.*?\\)",
# Remove year tags
"\\s*\\(\\d{4}\\)",
]
Patterns are standard regex and are applied in order. Remember to escape special characters with \\ in TOML.
Control which apps OSX Scrobbler listens to for scrobbling. When a new app starts playing music, you'll be prompted to allow or ignore it.
[app_filtering]
# Whether to prompt when encountering a new app
prompt_for_new_apps = true
# Whether to scrobble from apps that don't provide bundle_id
scrobble_unknown = true
# Apps to scrobble from (bundle IDs)
allowed_apps = [
"com.spotify.client",
"com.apple.Music"
]
# Apps to ignore (bundle IDs)
ignored_apps = [
"com.apple.Safari" # Don't scrobble YouTube in browser
]
How it works:
allowed_apps and ignored_apps listsscrobble_unknown settingprompt_for_new_apps = falseCommon bundle IDs:
com.spotify.clientcom.apple.Musicorg.videolan.vlccom.apple.Safaricom.google.Chrome[lastfm]
enabled = true
api_key = "your_api_key_here"
api_secret = "your_api_secret_here"
session_key = "" # Leave empty initially
Run the authentication helper:
osx-scrobbler --auth-lastfm
This will:
After authentication, your config will have the session_key filled in and enabled = true.
[[listenbrainz]]
enabled = true
name = "Primary"
token = "your_listenbrainz_token"
api_url = "https://api.listenbrainz.org"
You can scrobble to multiple ListenBrainz instances (e.g., self-hosted):
[[listenbrainz]]
enabled = true
name = "Primary"
token = "token_for_listenbrainz_org"
api_url = "https://api.listenbrainz.org"
[[listenbrainz]]
enabled = true
name = "Self-hosted"
token = "token_for_your_instance"
api_url = "https://your.instance.com"
Simply run:
osx-scrobbler
The app will:
Click the menu bar icon to see:
# Show help
osx-scrobbler --help
# Show version
osx-scrobbler --version
# Install as macOS app bundle in /Applications/
osx-scrobbler --install-app
# Uninstall the app bundle from /Applications/
osx-scrobbler --uninstall-app
# Authenticate with Last.fm
osx-scrobbler --auth-lastfm
# Force console output (show logs in terminal even when not running from one)
osx-scrobbler --console
The app automatically detects how it's being run:
~/Library/Logs/osx-scrobbler.log--console flag to always show logs in terminalTo view logs when running in background:
tail -f ~/Library/Logs/osx-scrobbler.log
The app follows Last.fm's scrobbling rules:
OSX Scrobbler works with any media player that integrates with macOS Media Remote, including:
If it shows up in your macOS Control Center or Lock Screen, it will work with OSX Scrobbler.
enabled = true for at least one serviceosx-scrobbler --auth-lastfm to re-authenticateRUST_LOG=debug osx-scrobbler --consoletail -f ~/Library/Logs/osx-scrobbler.logcleanup.enabled = true| Setting | Type | Default | Description |
|---|---|---|---|
refresh_interval |
integer | 5 |
How often (in seconds) to poll for now playing info |
scrobble_threshold |
integer | 50 |
Percentage of track to play before scrobbling (1-100) |
| Setting | Type | Default | Description |
|---|---|---|---|
cleanup.enabled |
boolean | true |
Enable text cleanup |
cleanup.patterns |
array of strings | See config | Regex patterns to remove from track names |
| Setting | Type | Required | Description |
|---|---|---|---|
lastfm.enabled |
boolean | Yes | Enable Last.fm scrobbling |
lastfm.api_key |
string | Yes | Your Last.fm API key |
lastfm.api_secret |
string | Yes | Your Last.fm API secret |
lastfm.session_key |
string | No* | Session key (obtained via --auth-lastfm) |
*Required for scrobbling, but obtained automatically via authentication
| Setting | Type | Required | Description |
|---|---|---|---|
listenbrainz.enabled |
boolean | Yes | Enable this ListenBrainz instance |
listenbrainz.name |
string | Yes | Friendly name for this instance |
listenbrainz.token |
string | Yes | Your ListenBrainz user token |
listenbrainz.api_url |
string | Yes | API URL (usually https://api.listenbrainz.org) |
git clone https://github.com/yourusername/osx-scrobbler.git
cd osx-scrobbler
cargo build
cargo run
cargo test
RUST_LOG=debug cargo run
cargo clippy
Inspired by rescrobbled but built specifically for macOS using the media_remote crate.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Copyright 2026 OSX Scrobbler Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributions are welcome! Please feel free to submit a Pull Request.
By contributing to this project, you agree that your contributions will be licensed under the Apache License, Version 2.0.