2 releases

0.7.2 May 30, 2024
0.7.1 Mar 10, 2024

#294 in Audio

Download history 101/week @ 2024-06-15 9/week @ 2024-06-22 47/week @ 2024-06-29 70/week @ 2024-07-06 2/week @ 2024-07-13 11/week @ 2024-07-20 13/week @ 2024-07-27 7/week @ 2024-08-03 54/week @ 2024-08-10 62/week @ 2024-08-17 16/week @ 2024-08-24 19/week @ 2024-08-31 66/week @ 2024-09-07 5/week @ 2024-09-14 24/week @ 2024-09-21 7/week @ 2024-09-28

103 downloads per month
Used in listenbrainz-cli-tools

MIT license

67KB
1.5K SLoC

DO NOT USE THIS

use listenbrainz-rs instead

This is just a temporary fork with some merged pull requests to allow the CI of listenbrainz-cli-tools to work. Concider it as a nighly version of https://github.com/InputUsername/listenbrainz-rs with selective feature merging.

I will break compatibility, and I wont care about your crates. listenbrainz-rs is still actively maintained, so use it instead.


lib.rs:

API bindings for ListenBrainz.

This crate aims to be an idiomatic wrapper of the ListenBrainz HTTP API (version 1). It contains functionality for direct access to the API in the [raw] module, as well as a more convenient ListenBrainz client which is easier to use.

Generally, using the raw functionality is more cumbersome, as its types and functions map one-to-one to the HTTP API's JSON input- and response data. Using the ListenBrainz type is therefore recommended.

Example

Submit a currently playing song to ListenBrainz.org:

#
let mut client = ListenBrainz::new();

client.authenticate("LISTENBRAINZ TOKEN")
    .expect("Could not authenticate with ListenBrainz");

client.playing_now("The Beatles", "Here Comes the Sun", Some("Abbey Road"))
    .expect("Could not submit 'playing now' request");

Use a custom API URL, for example to submit songs to Maloja:

#
let mut client = ListenBrainz::new_with_url("http://maloja.example.com/apis/listenbrainz");

client.authenticate("MALOJA API KEY")
    .expect("Could not authenticate with Maloja");

client.listen("Lymbyc Systym", "Split Stones", None)
    .expect("Could not submit listen");

Dependencies

~2.4–3.5MB
~85K SLoC