mirror of
https://github.com/TeamPiped/piped-rust-sdk.git
synced 2024-08-14 23:56:06 +00:00
21 lines
527 B
Rust
21 lines
527 B
Rust
use piped::piped::PipedClient;
|
|
use reqwest::ClientBuilder;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let httpclient = ClientBuilder::new()
|
|
.user_agent("Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0")
|
|
.build()
|
|
.unwrap();
|
|
|
|
let instance = "https://pipedapi.kavin.rocks".to_string();
|
|
|
|
let client = PipedClient::new(httpclient, instance);
|
|
|
|
let video = client
|
|
.get_video_from_id("__hYx6ZzFbQ".to_string())
|
|
.await
|
|
.unwrap();
|
|
|
|
println!("{:?}", video);
|
|
}
|