Async Rust client for a focused subset of the Cyberdrop API.
It wraps the browser-facing Cyberdrop endpoints with typed models, explicit errors, and a small reqwest-based async surface suitable for CLI tools and simple services.
Features
- Login, register, and token verification.
- Authenticated album listing, creation, metadata edits, and file listing.
- Single-file uploads with automatic upload-node discovery.
- Streaming uploads for smaller files and chunked uploads for larger files.
- Optional upload progress callback.
- Typed error model for auth failures, missing tokens, missing fields, API errors, I/O errors, and HTTP transport failures.
Installation
[]
= "0.5"
= { = "1", = ["macros", "rt-multi-thread"] }
Quick Start
use CyberdropClient;
use Path;
async
Client Setup
Use CyberdropClient::new() for defaults, or CyberdropClient::new_with_token(...) when you already have a token.
use CyberdropClient;
let client = new_with_token?;
Authenticated requests use Cyberdrop's token header, not Authorization: Bearer.
Common Tasks
Verify a token
let verification = client.verify_token.await?;
println!;
List albums and files
let albums = client.list_albums.await?;
for album in albums
Edit an album
let album = client.get_album_by_id.await?;
let edited = client
.edit_album
.await?;
Pass true as the last argument to request a new public link identifier.
Track upload progress
let uploaded = client
.upload_file_with_progress
.await?;
API Surface
| Area | Methods |
|---|---|
| Client | new, new_with_token, with_auth_token, auth_token |
| Account | login, register, verify_token |
| Albums | list_albums, get_album_by_id, create_album, edit_album |
| Files | list_album_files |
| Uploads | get_upload_url, upload_file, upload_file_with_progress |
Error Model
Higher-level methods convert non-success HTTP responses into CyberdropError:
401and403becomeAuthenticationFailed.- Other non-2xx statuses become
RequestFailed. - API-level failures become
Api. - Missing required response fields become
MissingField. - File reads become
Io. - Network, TLS, DNS, timeout, and response decode failures become
Http.
Development
Live tests are feature-gated because they create real Cyberdrop accounts, albums, and uploads: