7 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

#945 in Parser implementations

Download history 116/week @ 2025-01-11 130/week @ 2025-01-18 4/week @ 2025-01-25 188/week @ 2025-02-01 513/week @ 2025-02-08 399/week @ 2025-02-15 45/week @ 2025-02-22 14/week @ 2025-03-01 242/week @ 2025-03-08 16/week @ 2025-03-15 4/week @ 2025-03-22 113/week @ 2025-03-29 142/week @ 2025-04-05 15/week @ 2025-04-12 3/week @ 2025-04-19 3/week @ 2025-04-26

166 downloads per month
Used in pf_cmd

GPL-3.0-or-later

39KB
797 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

~10–22MB
~299K SLoC