Crates.io | youtubei-rs |
lib.rs | youtubei-rs |
version | 1.3.5 |
source | src |
created_at | 2022-05-31 10:27:47.965278 |
updated_at | 2022-07-05 13:14:08.423548 |
description | A asynchronous implementation of the invidious innertube aka youtubei API wrapper. |
homepage | |
repository | https://github.com/11tuvork28/youtubei-rs |
max_upload_size | |
id | 597402 |
size | 187,596 |
A asynchronous implementation of the invidious innertube aka youtubei API wrapper.
Using tokio,reqwest, serde and serde_json.
use youtubei_rs::{query::player, utils::default_client_config, types::query_results::PlayerResult};
#[tokio::main]
async fn main() {
// create default client_config with WEB client
let client_config = &default_client_config();
// get player for video with id gC6dQrScmHE
let player: PlayerResult = player(String::from("gC6dQrScmHE"),String::from(""),&client_config).await.unwrap();
println!("{}",player.video_details.title); // video title
}
For logging tracing is used so tracing_subscribe can be installed for easier use of tracing. The library has as target youtubei_rs with debug,trace and error levels.
use youtubei_rs::{query::player, utils::default_client_config};
#[tokio::main]
async fn main() {
std::env::set_var("RUST_LOG", "youtubei_rs=debug");
tracing_subscriber::fmt::init();
// create default client_config with WEB client
let client_config = &default_client_config();
// get player for video with id gC6dQrScmHE
let player: PlayerResult = player(String::from("gC6dQrScmHE"),String::from(""),&client_config).await.unwrap();
println!("{}",player.video_details.title); // video title
}