25 releases (10 breaking)

0.11.0 Apr 5, 2022
0.10.7 Mar 30, 2022
0.10.1 Dec 9, 2021
0.10.0 Oct 18, 2021
0.6.0 Jul 31, 2021

#15 in Multimedia

Download history 13/week @ 2022-01-29 15/week @ 2022-02-05 4/week @ 2022-02-12 24/week @ 2022-02-19 47/week @ 2022-02-26 80/week @ 2022-03-12 62/week @ 2022-03-19 95/week @ 2022-03-26 75/week @ 2022-04-02 21/week @ 2022-04-09 3/week @ 2022-04-16 108/week @ 2022-04-23 217/week @ 2022-04-30 251/week @ 2022-05-07 429/week @ 2022-05-14

1,005 downloads per month

MIT/Apache

92KB
2.5K SLoC

ytextract - A library for getting YouTube metadata

Github Crates.io docs.rs GitHub Workflow Status


This includes:

  • Videos
  • Streams (e.g. downloading of videos)
  • Playlists
  • Channels
  • Community Posts
  • Comments
  • Closed Captions
  • Search
  • Live Streams

Basic Example

#[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

Notes

  • Compiler support

    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.

  • Subscriber count

    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.

  • Panic behavior

    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.

Dependencies

~4–13MB
~266K SLoC