Crates.io | ytextract |
lib.rs | ytextract |
version | 0.11.2 |
source | src |
created_at | 2021-04-17 14:49:13.177909 |
updated_at | 2023-01-29 16:32:42.511171 |
description | A library for getting YouTube metadata |
homepage | |
repository | https://github.com/ATiltedTree/ytextract/ |
max_upload_size | |
id | 385776 |
size | 133,083 |
This includes:
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Get a Client for making request
let client = ytextract::Client::new();
// Get information about the Video identified by the id "nI2e-J6fsuk".
let video = client.video("nI2e-J6fsuk".parse()?).await?;
// Print the title of the Video
println!("Title: {}", video.title());
Ok(())
}
More examples can be found here: examples
This library always expects to be used with the latest version of rust. It may run on older rust versions, but not guarantee is made, that it won't break between versions.
All functions that return subscriber counts only return 3-digit precision
values as that is all that YouTube returns. That means if channel has
exactly 164_583
subscribers, this library will return 164_000
.
This library should never panic. If it does, it should be reported as a bug. Panics mostly mean, that YouTube changed something that this library could not deal with.