10 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

#956 in Parser implementations

Download history 13/week @ 2025-03-16 2/week @ 2025-03-23 118/week @ 2025-03-30 141/week @ 2025-04-06 11/week @ 2025-04-13 3/week @ 2025-04-20 10/week @ 2025-04-27 5/week @ 2025-05-04 22/week @ 2025-05-11 5/week @ 2025-05-18 1/week @ 2025-05-25 115/week @ 2025-06-01 5/week @ 2025-06-08 204/week @ 2025-06-29

210 downloads per month
Used in pf_cmd

GPL-3.0-or-later

39KB
790 lines

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),
        }
    }
}

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),
    }
}

Dependencies

~9–21MB
~288K SLoC