| Crates.io | picdl-rs |
| lib.rs | picdl-rs |
| version | 0.2.1 |
| created_at | 2024-12-14 13:44:13.881599+00 |
| updated_at | 2024-12-14 14:41:37.010337+00 |
| description | A Rust library to download pictures from some services |
| homepage | |
| repository | https://github.com/korupi/picdl-rs |
| max_upload_size | |
| id | 1483150 |
| size | 22,460 |
A simple Rust library to download media from various services, such as Gelbooru.
cargo add picdl_rs
Fetch one post by tags
#[tokio::main]
async fn main() {
let client = picdl_rs::gelbooru::Gelbooru::<picdl_rs::http::reqwest::ReqwestClient>::new();
let post = client.fetch("omori rating:general", 1, 1, 0).await.unwrap().post[0].clone(); // "omori rating:general" is the tags to get posts by. Meta-tags are supported. Second argument is the count of posts to get (limit), third is page number and the last is change id, you can keep it 0.
println!("Tags: {}", post.tags);
println!("File URL: {}", post.file_url);
}
Fetch one post from blog
#[tokio::main]
async fn main() {
let client = picdl_rs::boosty::Boosty::<picdl_rs::http::reqwest::ReqwestClient>::new();
let post = client.fetch("boosty", 1).await.unwrap(); // Here, "boosty" is the name of a blog to get posts from, and 1 is count of posts to get (limit)
println!("Post title: {}", post.data[0].title);
}