Crates.io | rafy |
lib.rs | rafy |
version | 0.2.1 |
source | src |
created_at | 2017-07-08 20:37:42.970698 |
updated_at | 2018-04-02 06:33:06.302758 |
description | Rust library to download YouTube content and retrieve metadata |
homepage | |
repository | https://github.com/ritiek/rafy-rs |
max_upload_size | |
id | 22681 |
size | 20,057 |
Rust library to fetch YouTube content and retrieve metadata. An attempt to mimic pafy but in Rust.
Put the below in your Cargo.toml
[dependencies]
rafy = "0.2"
extern crate rafy;
use rafy::Rafy;
fn main() {
let content = Rafy::new("https://www.youtube.com/watch?v=DjMkfARvGE8").unwrap();
println!("{}", content.videoid);
println!("{}", content.title);
println!("{}", content.rating);
println!("{}", content.viewcount);
}
For more examples check out the Documentation.
This library won't be able to fetch audiostreams
and videostreams
for unpopular videos, because YouTube does not generate separate streams for unpopular videos. However, it will still be able to fetch normal streams
.
Since this library does not depend on youtube-dl, there are some more things (not mentioning here) that we'll be missing out.
$ cargo test
Rust is still new to me. If there is anything that can be improved, please open an issue or even better, send a PR! :smile:
Documentation improvements are also most welcome!
The basic method of extracting streams was stolen from rust-youtube-downloader by smoqadam.
The MIT License