3 releases
5.0.1 |
|
---|---|
4.0.1 |
|
3.0.6 |
|
3.0.2 |
|
0.1.2 | Feb 17, 2025 |
#809 in Parser implementations
998 downloads per month
Used in pf_cmd
39KB
797 lines
pf_lib
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