3 releases

5.0.1 Feb 11, 2025
4.0.1 Feb 10, 2025
3.0.6 Feb 4, 2025
3.0.2 Dec 7, 2024
0.1.2 Feb 17, 2025

#809 in Parser implementations

Download history 8/week @ 2024-10-30 2/week @ 2024-11-06 254/week @ 2024-12-04 35/week @ 2024-12-11 60/week @ 2025-01-01 58/week @ 2025-01-08 227/week @ 2025-01-15 7/week @ 2025-01-22 53/week @ 2025-01-29 431/week @ 2025-02-05 465/week @ 2025-02-12

998 downloads per month
Used in pf_cmd

GPL-3.0-or-later

39KB
797 lines

pf_lib

crates.io version

A Rust library to retrieve WordPress MP4 videos. Supports filtering by date and including/excluding specific IDs, categories, and tags.

Example

use futures_util::pin_mut;
use futures_util::stream::StreamExt;
use pf_lib::{FinderConfig, FinderTarget};

let config = FinderConfig {
    url: "http://example.com".to_string(),
    target: FinderTarget::Media,
    ..Default::default()
};

let stream = pf_lib::find(&config);

pin_mut!(stream); // needed for iteration

while let Some(res) = stream.next().await {
    match res {
        Ok(url) => println!("{}", url),
        Err(e) => eprintln!("{}", e),
    }
}

lib.rs:

pf_lib

This crate provides functionality to retrieve existing video URLs from a WordPress websites that use the REST API. It supports both media and posts resources.

Usage

use futures_util::pin_mut;
use futures_util::stream::StreamExt;

#[tokio::main]
async fn main() {
    let config = pf_lib::FinderConfig {
        url: "http://example.com".to_string(),
        ..Default::default()
    };

    let stream = pf_lib::find(&config);

    pin_mut!(stream); // needed for iteration

    while let Some(res) = stream.next().await {
        match res {
            Ok(url) => println!("{}", url),
            Err(e) => eprintln!("{}", e),
        }
    }
}

Dependencies

~9–22MB
~290K SLoC