12 releases
0.3.6 | May 5, 2024 |
---|---|
0.3.5 | Jan 13, 2024 |
0.3.4 | Oct 13, 2023 |
0.3.2 | Jul 5, 2023 |
0.1.0 | Jun 23, 2021 |
#116 in HTTP client
814 downloads per month
32KB
709 lines
bilibili-api-rs
A rust library project got inspiration from bilibili-api.
- No plan for cover all apis.
- "GET" like api only.
Design
data:
- api
- user::{info, channel_series}, video::info, xlive::info
code:
- root: exports
- wbi: access(path, querymap, respschema)
- wrapper user, xlive etc
- wbi: access(path, querymap, respschema)
License
lib.rs
:
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.
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(())
}
Dependencies
~10–26MB
~356K SLoC