5 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.4 Mar 8, 2025

#814 in Parser implementations

Download history 232/week @ 2024-12-02 57/week @ 2024-12-09 112/week @ 2025-01-06 118/week @ 2025-01-13 121/week @ 2025-01-20 3/week @ 2025-01-27 251/week @ 2025-02-03 578/week @ 2025-02-10 293/week @ 2025-02-17 24/week @ 2025-02-24 183/week @ 2025-03-03

1,088 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–21MB
~290K SLoC