{"id":16707722,"url":"https://github.com/mariusor/mpris-scrobbler","last_synced_at":"2025-03-15T13:30:54.550Z","repository":{"id":21560629,"uuid":"87954371","full_name":"mariusor/mpris-scrobbler","owner":"mariusor","description":"A minimalistic user daemon to submit the songs you're playing to audioscrobbler services like listenbrainz.org, libre.fm and last.fm.","archived":false,"fork":false,"pushed_at":"2024-04-28T12:58:58.000Z","size":1694,"stargazers_count":135,"open_issues_count":10,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-29T00:13:25.816Z","etag":null,"topics":["dbus","lastfm","librefm","listenbrainz","mpris","scrobble"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mariusor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-11T16:07:58.000Z","updated_at":"2024-05-01T15:02:42.251Z","dependencies_parsed_at":"2024-05-01T15:02:41.036Z","dependency_job_id":"d95b862d-22a3-4f2c-b431-ebcd1e4ca5f7","html_url":"https://github.com/mariusor/mpris-scrobbler","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusor%2Fmpris-scrobbler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusor%2Fmpris-scrobbler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusor%2Fmpris-scrobbler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusor%2Fmpris-scrobbler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariusor","download_url":"https://codeload.github.com/mariusor/mpris-scrobbler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735797,"owners_count":20339530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbus","lastfm","librefm","listenbrainz","mpris","scrobble"],"created_at":"2024-10-12T19:40:43.614Z","updated_at":"2025-03-15T13:30:54.544Z","avatar_url":"https://github.com/mariusor.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mpris-scrobbler\n\nIs a minimalistic user daemon which submits the currently playing song to libre.fm and compatible services.\nTo retrieve song information it uses the MPRIS DBus interface, so it works with any media player that exposes this interface.\n\n[![MIT Licensed](https://img.shields.io/github/license/mariusor/mpris-scrobbler.svg)](https://raw.githubusercontent.com/mariusor/mpris-scrobbler/master/LICENSE)\n[![Build status](https://builds.sr.ht/~mariusor/mpris-scrobbler.svg)](https://builds.sr.ht/~mariusor/mpris-scrobbler)\n[![Coverity Scan status](https://img.shields.io/coverity/scan/14230.svg)](https://scan.coverity.com/projects/14230)\n[![Latest build](https://img.shields.io/github/release/mariusor/mpris-scrobbler.svg)](https://github.com/mariusor/mpris-scrobbler/releases/latest)\n[![AUR package](https://img.shields.io/aur/version/mpris-scrobbler.svg)](https://aur.archlinux.org/packages/mpris-scrobbler/)\n\nIn order to compile the application you must have a valid development environment containing pkg-config, a compiler - known to work are `clang\u003e=5.0` or `gcc\u003e=7.0` - and the build system `meson` plus `ninja`.\n\nThe compile time dependencies are: `libevent`, `dbus-1.0\u003e=1.9`, `libcurl`, `json-c` and their development equivalent packages.\n\n## Getting the source\n\nYou can clone the git repository or download the latest release from [here](https://github.com/mariusor/mpris-scrobbler/releases/latest).\n\n    $ git clone git@github.com:mariusor/mpris-scrobbler.git\n    $ cd mpris-scrobbler\n\n## Installing\n\nFor **packagers** please see the note at the [bottom](#packaging).\n\n### CentOS, RHEL\n\n`mpris-scrobbler` is available for CentOS and RHEL 7 or later via the [EPEL repository](https://fedoraproject.org/wiki/EPEL \"EPEL: Extra Packages for Enterprise Linux\").\nRun the following commands to install it:\n\n```sh\n$ sudo yum install epel-release\n$ sudo yum install mpris-scrobbler\n```\n\n### Fedora\n\n`mpris-scrobbler` is available since Fedora 28.\nRun the following command to install it:\n\n```sh\n$ sudo dnf install mpris-scrobbler\n```\n\n### Mageia, openSUSE\n\n`mpris-scrobbler` is available for Mageia, openSUSE, and other RPM distributions via the [COPR repository](https://copr.fedorainfracloud.org/coprs/jflory7/mpris-scrobbler/).\nFirst, install the correct repository for your operating system from COPR.\nThen, install the `mpris-scrobbler` package with your package manager of choice.\n\n### Ubuntu\n\nInstall the dependencies:\n\n#### Ubuntu 18.04\n\n```sh\nsudo apt install libevent-2.1-6 libevent-dev libdbus-1-dev dbus dbus-user-session \\\nlibcurl4 libcurl4-openssl-dev libjson-c-dev libjson-c3 meson\n```\n\n#### Ubuntu 20.04\n\n```sh\nsudo apt install libevent-2.1-7 libevent-dev libdbus-1-dev dbus dbus-user-session \\\nlibcurl4 libcurl4-openssl-dev libjson-c-dev libjson-c-dev meson m4 scdoc\n```\n\nD-bus will need to be restarted:\n\n    $ systemctl --user restart dbus.service\n\n### Compile from source\n\nTo compile the scrobbler manually, you need to already have installed the dependencies mentioned above.\nBy default the prefix for the installation is `/usr`.\n\n    $ meson setup build/\n\n    $ ninja -C build/\n\n    $ sudo ninja -C build/ install\n\n## Usage\n\nThe scrobbler is comprised of two binaries: the daemon and the signon helper.\n\nThe daemon is meant run as a user systemd service which listens for any signals coming from your MPRIS enabled media player. To have it start at login, please execute the following command:\n\n    $ systemctl --user enable --now mpris-scrobbler.service\n\nIf the command above didn't start the service, you can do it manually:\n\n    $ systemctl --user start mpris-scrobbler.service\n\nIt can submit the tracks being played to the [last.fm](https://last.fm) and [libre.fm](https://libre.fm) services, and to [listenbrainz.org](https://listenbrainz.org/).\n\nAt first nothing will get submitted as you need to enable one or more of the available services and also generate a valid API session for your account.\n\nThe valid services that mpris-scrobbler knows are: `librefm`, `lastfm` and `listenbrainz`.\n\n### Enabling a service\n\nEnabling a service is done automatically once you obtain a valid token/session for it. See the [authentication](#authenticate-to-the-service) section.\n\nYou can however disable submitting tracks to a service by invoking:\n\n    $ mpris-scrobbler-signon disable \u003cservice\u003e\n\nIf you want to re-enable a service which you previously disabled you can call, without the need to re-authenticate:\n\n    $ mpris-scrobbler-signon enable \u003cservice\u003e\n\n### Authenticate to the service\n\n##### ListenBrainz\n\nBecause ListenBrainz doesn't have yet support for OAuth authentication, the credentials must be added manually using the signon binary.\nFirst you need to get the **user token** from  your [ListenBrainz profile page](https://listenbrainz.org/profile).\nThen you call the following command and type or paste the token, then press Enter:\n\n    $ mpris-scrobbler-signon token listenbrainz\n    Token for listenbrainz.org:\n\n\n##### Audioscrobbler compatible\n\nLibre.fm and Last.fm are using the same API for authentication and currently this is the mechanism:\n\nUse the signon binary in the following sequence:\n\n    $ mpris-scrobbler-signon token \u003cservice\u003e\n\n    $ mpris-scrobbler-signon session \u003cservice\u003e\n\nThe valid service labels are: `librefm` and `lastfm`.\n\nThe first step opens a browser window -- for this to work your system requires `xdg-open` binary -- which asks you to login to last.fm or libre.fm and then approve access for the `mpris-scrobbler` application.\n\nAfter granting permission to the application from the browser, you execute the second command to create a valid API session and complete the process.\n\nThe daemon loads the new generated credentials automatically and you don't need to do it manually.\n\nThe authentication for the libre.fm and listenbrainz.org services supports custom URLs that can be passed to the signon binary using the `--url` argument.\n\n    $ mpris-scrobbler-signon --url http://127.0.0.1:8080 token [listenbrainz|librefm]\n\nFor the moment we don't support multiple entries for the same API. Ex, have a local instance for the ListenBrainz API and use the official one at the same time.\n\n## Troubleshooting\n\nIf `mpris-scrobbler` does not seem to be working after following all usage instructions, confirm that `~/.local/share/mpris-scrobbler/credentials` contains:\n\n    [yourservice]             ;; where yourservice is lastfm, librefm or listenbrainz\n\tenabled = true            ;; set via $ mpris-scrobbler-signon enable \u003cservice\u003e\n\tusername = {USERNAME}     ;; set via $ mpris-scrobbler-signon session \u003cservice\u003e - only available for lastfm/librefm\n\ttoken = {TOKEN}           ;; set via $ mpris-scrobbler-signon token \u003cservice\u003e\n\tsession = {SESSION}       ;; set via $ mpris-scrobbler-signon session \u003cservice\u003e - only available for lastfm/librefm\n\n### Enhanced output verbosity\n\nIf the credentials are correct for the service you're having trouble with it could be helpfull to increase the verbosity of the logs. This can be achieved with the verbosity flag:\n\n    $ mpris-scrobbler -v      # enable    INFO messages\n    $ mpris-scrobbler -vv     # enable   DEBUG messages\n    $ mpris-scrobbler -vvv    # enable TRACING messages\n\nFurther verbosity can be achieved by compiling the scrobbler using the `debug` build type, and then running it using the `-vvvv` maximum verbosity output flag, which makes the `TRACING` logs be even more verbose, including the actual requests sent to the scrobbling services and potentially sensitive information like credentials or authorization tokens.\n\n    $ meson setup -Dbuildtype=debug build/\n\n    $ ninja -C build\n\n    $ ./build/mpris-scrobbler -vvvv # enable TRACING2 messages\n\nFor the exceptional cases when you might require verbosity from the libraries that the scrobbler links against, the following options can be additionally passed at build time:\n\n* `-Dlibcurldebug=true` to enable **libcurl** debug messages\n* `-Dlibeventdebug=true` to enable **libevent2** debug messages\n* `-Dlibdbusdebug=true` does not enable libdbus verbose logging, only a couple of extra logs related to loading the MPRIS metadata from the DBus messages.\n\nAn example for compiling the scrobbler with maximum verbosity would look like this:\n\n    $ meson setup --reconfigure -Dbuildtype=debug -Dlibcurldebug=true -Dlibeventdebug=true -Dlibdbusdebug=true ./build\n    $ ninja -C ./build\n\n## Packaging\n\nIf you are a packager for mpris-scrobbler, please create separate credentials for the last.fm API at the [following URL](https://www.last.fm/api/account/create) instead of using the default ones packaged with the upstream source.\n\nTo use them in your build they need to be passed to meson setup:\n\n    $ meson setup --reconfigure -Dlastfm_api_key=2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -Dlastfm_api_secret=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY build/\n\n## Resources\n\nFor discussions related to the project without requiring a Github account please see our mailing list: [https://lists.sr.ht/~mariusor/mpris-tools](https://lists.sr.ht/~mariusor/mpris-tools).\n\nThe documentation in the README file will be soon moved to a dedicated [wiki](https://man.sr.ht/~mariusor/mpris-tools/mpris-scrobbler/)\n\nCheck out the following articles and resources about mpris-scrobbler:\n\n* [2 new apps for music tweakers on Fedora Workstation - Fedora Magazine](https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/ \"2 new apps for music tweakers on Fedora Workstation\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariusor%2Fmpris-scrobbler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariusor%2Fmpris-scrobbler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariusor%2Fmpris-scrobbler/lists"}