Struct rafy::Stream [] [src]

pub struct Stream {
    pub extension: String,
    pub quality: String,
    pub url: String,
    // some fields omitted
}

After creating a Stream struct, you can check its attributes or call methods on it.

Examples

extern crate rafy;
use rafy::Rafy;

fn main() {
    let content = Rafy::new("https://www.youtube.com/watch?v=DjMkfARvGE8");
    for stream in content.streams {
        println!("{}", stream.extension);
        println!("{}", stream.url);
    }
}

Fields

The extension of the stream

The quality of the stream

The url of the stream

Methods

impl Stream
[src]

Create a Vec<Stream> object by calling Rafy::new().streams .

Examples

extern crate rafy;
use rafy::Rafy;

fn main() {
    let content = Rafy::new("https://www.youtube.com/watch?v=DjMkfARvGE8");
    let streams = content.streams;
    let ref stream = streams[0];
}

Downloads the content stream from Stream object.

Examples

extern crate rafy;
use rafy::Rafy;

fn main() {
    let content = Rafy::new("https://www.youtube.com/watch?v=qOOcy2-tmbk");
    let streams = content.streams;
    let ref stream = streams[0];
    stream.download();
}