Something, something music sharing.
Pequod is an experiment into a friend-to-friend music sharing system.
Pequod can observes what is being played in MPD and creates XMPP posts for every song listened:
$ dune exec src/pequod/pequod.exe -- scrobble --jid email@example.com --password pencil -v pequod.exe: [INFO] Connected to MPD. pequod.exe: [INFO] Opening TCP socket to 127.0.0.1 (port: 5222; disable_ssl: true) pequod.exe: [INFO] XMPP Client connected as firstname.lastname@example.org/berwsTgK. pequod.exe: [INFO] Scrobbling track urn:uuid:a944e6fe-9357-3230-8028-b0c7efe7c58a (Jay Dee - Think Twice) to XMPP.
See vocabulary.md for details on the data model and vocabularies used.
To get scrobbles:
$ dune exec src/pequod/pequod.exe -- get --jid email@example.com --password pencil xmpp:firstname.lastname@example.org (2022-01-20 11:31:11 +00:00): Jay Dee - Think Twice (urn:uuid:a944e6fe-9357-3230-8028-b0c7efe7c58a)
Of course this is ugly. A nicer UI will eventually come...
You can also get scrobbles from other users (who share their presence with you) with
pequod get email@example.com.
See this blog post for details on how this works.
WARNING: Pequod will re-configure the PEP node
net.openengiadina.xmpp.activitystreams to persist 256 items. By default only a single item is persisted on most XMPP servers. In the future this should be less forcefull and configurable.
TODOs and Ideas
A nice UI for viewing scrobbles
Uploading scrobbles is not really useful if there is no way to view them. We need a little client UI that can be used to view your own and your friends scrobbles. Would be nice to have things like weekly/monthly statistics and such.
MPRIS is a D-Bus interface for media players. It can be used to get information on what tracks are being played.
It seems that players do not expose the Musicbrainz metadata via MPRIS, even if the audio files are properly tagged. MPRIS does seem to expose the location of the audio file, so we could get the missing tags by looking at the file directly. This does require using something like Taglib.
Initial experiments with ocaml-taglib failed, as the Musicbrainz tags seems to be in ID3v2 frames or Vorbis metadata that does not seem to be exposed in the OCaml bindings.
Add the ERIS read-capability of the audio file to the scrobbled track. Eventually also make the blocks available and allow sharing of music (and not only music metadata).
A suitable development environment can be set up with Guix:
guix shell -D -f guix.scm
This is currently the easiest way to get hacking as many OCaml dependencies have not yet been published to OPAM.
dune exec src/pequod/pequod.exe to run Pequod.
Inspriation and Related Projects
Provided an RDF interface to last.fm/Audioscrobbler data.
They use the Music Ontology, FOAF and a simple ontology for describing Scrobbles based on the Event Ontology.
A scrobbler that listens for media players on MPRIS.
pukkamustard [at] posteo [dot] net