mirror of
https://github.com/TeamPiped/piped-rust-sdk.git
synced 2024-08-14 23:56:06 +00:00
8a7a87824f
* Make functions take references, moved user agent into lib * Improved error handling
18 lines
379 B
Rust
18 lines
379 B
Rust
use piped::PipedClient;
|
|
use reqwest::Client;
|
|
|
|
const INSTANCE: &'static str = "https://pipedapi.kavin.rocks";
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let httpclient = Client::new();
|
|
|
|
let client = PipedClient::new(&httpclient, INSTANCE);
|
|
|
|
let video = client
|
|
.video_from_id("__hYx6ZzFbQ".to_string())
|
|
.await
|
|
.unwrap();
|
|
|
|
println!("{:#?}", video);
|
|
}
|