Skip to content
forked from CleeSim/ccobalt

[Fork] A Rust library to download media using the Cobalt API.

License

Notifications You must be signed in to change notification settings

Fulturate/ccobalt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
        }
    }
}

About

[Fork] A Rust library to download media using the Cobalt API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%