use makeshot_ai::api::MakeshotAI;
use makeshot_ai::types::{
ClipRequest, ClipResponse, EditRequest, EditResponse, HighlightRequest, HighlightResponse,
};
fn main() {
let api_key = "YOUR_MAKESHOOT_AI_API_KEY";
let makeshot_ai = MakeshotAI::new(api_key);
println!("Example 1: Creating a clip...");
let clip_request = ClipRequest {
video_url: "https://example.com/video.mp4".to_string(), start_time: 10.0,
end_time: 20.0,
};
match makeshot_ai.create_clip(clip_request) {
Ok(clip_response) => {
println!("Clip created successfully!");
println!("Clip URL: {}", clip_response.clip_url);
}
Err(err) => {
println!("Error creating clip: {}", err);
}
}
println!("\nExample 2: Requesting video highlights...");
let highlight_request = HighlightRequest {
video_url: "https://example.com/another_video.mp4".to_string(), num_highlights: 3,
};
match makeshot_ai.get_highlights(highlight_request) {
Ok(highlight_response) => {
println!("Highlights generated successfully!");
println!("Highlights: {:?}", highlight_response.highlights);
}
Err(err) => {
println!("Error generating highlights: {}", err);
}
}
println!("\nExample 3: Requesting video editing (placeholder)...");
let edit_request = EditRequest {
video_url: "https://example.com/yet_another_video.mp4".to_string(), instructions: "Add a title card at the beginning".to_string(), };
match makeshot_ai.edit_video(edit_request) {
Ok(edit_response) => {
println!("Video edit request successful!");
println!("Edited video URL: {}", edit_response.edited_video_url);
}
Err(err) => {
println!("Error editing video: {}", err);
}
}
println!("\nExample 4: Creating a clip from a different video...");
let clip_request_2 = ClipRequest {
video_url: "https://example.com/long_video.mp4".to_string(), start_time: 60.0,
end_time: 75.0,
};
match makeshot_ai.create_clip(clip_request_2) {
Ok(clip_response) => {
println!("Clip created successfully!");
println!("Clip URL: {}", clip_response.clip_url);
}
Err(err) => {
println!("Error creating clip: {}", err);
}
}
println!("\nExample 5: Requesting more video highlights...");
let highlight_request_2 = HighlightRequest {
video_url: "https://example.com/different_video.mp4".to_string(), num_highlights: 5,
};
match makeshot_ai.get_highlights(highlight_request_2) {
Ok(highlight_response) => {
println!("Highlights generated successfully!");
println!("Highlights: {:?}", highlight_response.highlights);
}
Err(err) => {
println!("Error generating highlights: {}", err);
}
}
println!("\nFor more advanced features and capabilities, visit https://makeshot.ai/!");
}