Struct rafy::Rafy
[−]
[src]
pub struct Rafy { pub videoid: String, pub title: String, pub rating: String, pub viewcount: u32, pub author: String, pub length: u32, pub thumbdefault: String, pub likes: u32, pub dislikes: u32, pub commentcount: u32, pub description: String, pub streams: Vec<Stream>, pub videostreams: Vec<Stream>, pub audiostreams: Vec<Stream>, pub thumbmedium: String, pub thumbhigh: String, pub thumbstandard: String, pub thumbmaxres: String, pub published: String, pub category: u32, }
Once you have created a Rafy object using Rafy::new()
, several data attributes are available.
Examples
extern crate rafy; use rafy::Rafy; fn main() { let content = Rafy::new("https://www.youtube.com/watch?v=DjMkfARvGE8").unwrap(); println!("{}", content.title); println!("{}", content.viewcount); }
Fields
videoid: String
The 11-character video id
title: String
The title of the video
rating: String
The rating of the video (0-5)
viewcount: u32
The viewcount of the video
The author of the video
length: u32
The duration of the streams in seconds
thumbdefault: String
The url of the video’s thumbnail image
likes: u32
The number of likes received for the video
dislikes: u32
The number of dislikes received for the video
commentcount: u32
The commentcount of the video
description: String
The video description text
streams: Vec<Stream>
The available streams (containing both video and audio)
videostreams: Vec<Stream>
The available only-video streams
audiostreams: Vec<Stream>
The available only-audio streams
thumbmedium: String
The url of the video’s medium size thumbnail image
thumbhigh: String
The url of the video’s large size thumbnail image
thumbstandard: String
The url of the video’s extra large thumbnail image
thumbmaxres: String
The url of the video’s native thumbnail image
published: String
The upload date of the video
category: u32
The category ID of the video
Methods
impl Rafy
[src]
pub fn new(url: &str) -> Result<Rafy, Error>
[src]
Create a Rafy object using the Rafy::new()
function, giving YouTube URL as the argument.
Examples
extern crate rafy; use rafy::Rafy; fn main() { let content = Rafy::new("https://www.youtube.com/watch?v=DjMkfARvGE8"); }
Trait Implementations
impl Debug for Rafy
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more