ccobalt

Crates.ioccobalt
lib.rsccobalt
version0.2.1
created_at2025-06-08 10:50:58.209764+00
updated_at2025-07-17 14:06:15.427376+00
descriptionA Rust library to download media using the Cobalt API.
homepagehttps://github.com/CleeSim/ccobalt
repositoryhttps://github.com/CleeSim/ccobalt.git
max_upload_size
id1704772
size69,676
iku (notiku)

documentation

https://docs.rs/ccobalt

README

CCobalt

CCobalt allows you to easily interact with the Cobalt API.

Example

use ccobalt::{
    Client,
    model::request::{DownloadRequest, VideoQuality},
};

#[tokio::main]
async fn main() {
    let client = Client::builder()
        .base_url("https://api.example.com/")
        .api_key("YOUR_API_KEY")
        .build()
        .expect("Failed to build client");

    let request = DownloadRequest {
        url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ".to_string(),
        video_quality: Some(VideoQuality::Q4320),
        ..Default::default()
    };

    match client.download_and_save(&request, "download", ".").await {
        Ok(path) => {
            println!("File saved to: {:?}", path);
        }
        Err(err) => {
            eprintln!("Download failed: {}", err);
        }
    }
}
Commit count: 0

cargo fmt