Crate bilibili_api_rs

Source
Expand description

bilibili-api-rs is a rust library project got inspiration from bilibili-api.

Currently “GET” apis only. Api interface User, Xlive derive from Client

Api result is part of response, alike bilibili-api, is response["data"]. Invalid response treated as error then bail. Note that init retries and token refresh also be treated as error.

High overhead: to anti-detect, client open one whole new connection in every request; must recreate User/Xlive/.. helper if failed, better recreate every times but with higher cost.

§Example

use bilibili_api_rs::Client;
use anyhow::Result;
async fn test_xlive() -> Result<()> {
    let mut cli = Client::new();
    let area_virtual = 9;
    let type_all = 0;
    cli.xlive(area_virtual, type_all).list(1).await.ok(); // usually retry once for init
    let lives = cli.xlive(area_virtual, type_all).list(2).await?;
    Ok(())
}

Re-exports§

pub use wbi::Client;

Modules§

wbi
WBI means “web bibilili interface”.

Traits§

Lodash
Lodash-like get helper, implemented for serde_json