Crates.io | imgdl-rs |
lib.rs | imgdl-rs |
version | 1.2.0 |
source | src |
created_at | 2024-07-10 14:01:52.03101 |
updated_at | 2024-07-12 12:36:26.250477 |
description | A Rust library for downloading images from services like Boosty and Gelbooru |
homepage | |
repository | https://github.com/crptmem/imgdl-rs |
max_upload_size | |
id | 1298267 |
size | 21,553 |
FORMER boosty-rs
A Rust library for downloading images from such services like Boosty and Gelbooru-powered sites
$ cargo add imgdl-rs
use std::error::Error;
use boosty_rs::boosty::request;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let response = request::Client::fetch_posts("boosty".to_string(), None).await?;
println!("{:?}", response);
Ok(())
}
use std::error::Error;
use boosty_rs::boosty::request;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let response = request::Client::fetch_post("boosty".to_string(), "a4dc61c8-4ff9-495b-946b-3982efef68fe".to_string(), None).await?;
println!("{:?}", response);
Ok(())
}
use std::error::Error;
use boosty_rs::boosty::request;
use boosty_rs::boosty::auth::Auth;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let response = request::Client::fetch_posts("boosty".to_string(), Auth::new("access_token".to_string())).await?;
println!("{:?}", response);
Ok(())
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = imgdl_rs::gelbooru::request::Client::new(None);
let posts = client.fetch_posts(
"rating:general blue_sky", 3
).await?; // Fetch all posts with tags `rating:general blue_sky` from page 3
println!("{:?}", posts);
Ok(())
}