Skip to content

11philip22/cyberdrop-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hero pane

Crates.io Documentation MIT License PRs Welcome

Features · Installation · Quick Start · Running the CLI Examples · Documentation · Contributing · Support · License


Features

  • Login/register + token verification, with permissions in the response.
  • Full album management: list, create, edit metadata, toggle public/download, and rotate share links.
  • Album file listing with built‑in pagination (single page or all pages).
  • Uploads with automatic upload‑node discovery, streaming small files and chunked uploads for large files, plus per‑file progress callbacks.
  • Typed models and explicit error types (auth failures, album‑not‑found, album‑exists, missing fields).
  • Optional low‑level get for endpoints not covered by higher‑level methods.

Installation

[dependencies]
cyberdrop-client = "0.4.5"

Quick Start

Cyberdrop Example

use cyberdrop_client::CyberdropClient;
use std::path::Path;

#[tokio::main]
async fn main() -> Result<(), cyberdrop_client::CyberdropError> {
    let client = CyberdropClient::builder().build()?;
    let token = client.login("username", "password").await?;

    let authed = client.with_auth_token(token.into_string());
    let albums = authed.list_albums().await?;
    println!("albums: {}", albums.albums.len());

    let album_id = authed
        .create_album("my uploads", Some("created by cyberdrop-client"))
        .await?;
    let uploaded = authed
        .upload_file(Path::new("path/to/file.jpg"), Some(album_id))
        .await?;
    println!("uploaded {} -> {}", uploaded.name, uploaded.url);
    Ok(())
}

Bunkr Example

let client = CyberdropClient::builder()
    .base_url("https://dash.bunkr.cr")?
    .auth_token("your_auth_token_here")
    .timeout(std::time::Duration::from_secs(500))
    .build()?;

Running the CLI Examples

Examples live in examples/ and can take args or environment variables.

Environment variables used by most examples:

  • CYBERDROP_USERNAME
  • CYBERDROP_PASSWORD

Run:

cargo run --example register -- <username> <password>
cargo run --example login -- <username> <password>
cargo run --example list_albums -- <username> <password>
cargo run --example create_album -- <username> <password> "<name>" ["<description>"]
cargo run --example edit_album -- <username> <password> <album_id> ["<new_name>"] ["<new_identifier>"]
cargo run --example list_album_files -- <username> <password> <album_id> [page]
cargo run --example request_new_album_link -- <username> <password> <album_id>
cargo run --example upload_file -- <username> <password> <path> [album_id]

Documentation

For detailed API documentation, visit docs.rs/cyberdrop-client.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Support

If this crate saves you time or helps your work, support is appreciated:

Ko-fi

License

This project is licensed under the MIT License; see the license for details.

About

Rust API client for Cyberdrop and Bunkrr, with async support and typed models.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages