8 releases

0.4.1 Feb 21, 2021
0.4.0 Dec 31, 2019
0.3.2 Mar 16, 2019
0.2.0 Mar 15, 2019
0.1.1 Mar 15, 2019

#50 in #facebook

MIT license

8KB
105 lines

fbvideo

Library to get video URLs from Facebook.

Documentation Crates.io

Examples

use fbvideo::{FbVideo, Quality};
#[tokio::main]
async fn main() {
    let mut fb = FbVideo::new(
        "https://www.facebook.com/817131355292571/videos/2101344733268123/",
        Quality::Hd,
    );
    match fb.get_video_url().await {
        Ok(url) => println!("{:?}", url),
        Err(e) => panic!("{:?}", e),
    }
}

lib.rs:

This library is used to leak real video URL from Facebook.

This crate operates by fetching video page source from Facebook and searching for those string fields: hd_src_no_ratelimit, sd_src_no_ratelimit.

Networking

This crate needs network to fetch page source from Facebook's URL.

Examples

use fbvideo::{FbVideo, Quality};
async fn foo() {
    let mut fb = FbVideo::new(
        "https://www.facebook.com/817131355292571/videos/2101344733268123/",
        Quality::Hd,
    );
    match fb.get_video_url().await {
        Ok(url) => println!("{:?}", url),
        Err(e) => panic!("{:?}", e),
    }
}

Dependencies

~6–21MB
~313K SLoC