Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
feat(cakto): implement CaktoDownloader with platform handling capabilities
Tonhoe03aaf9ba81e
diff --git a/src-tauri/src/platforms/cakto/mod.rs b/src-tauri/src/platforms/cakto/mod.rsnew file mode 100644index 00000000..46c088cf--- /dev/null+++ b/src-tauri/src/platforms/cakto/mod.rs@@ -0,0 +1,67 @@+use anyhow::anyhow;+use async_trait::async_trait;+use tokio::sync::mpsc;++use crate::models::media::{DownloadOptions, DownloadResult, MediaInfo, MediaType, VideoQuality};+use crate::platforms::traits::PlatformDownloader;++pub struct CaktoDownloader;++impl Default for CaktoDownloader {+ fn default() -> Self {+ Self::new()+ }+}++impl CaktoDownloader {+ pub fn new() -> Self {+ Self+ }+}++#[async_trait]+impl PlatformDownloader for CaktoDownloader {+ fn name(&self) -> &str {+ "cakto"+ }++ fn can_handle(&self, url: &str) -> bool {+ if let Ok(parsed) = url::Url::parse(url) {+ if let Some(host) = parsed.host_str() {+ let host = host.to_lowercase();+ return host == "cakto.com.br"+ || host == "aluno.cakto.com.br"+ || host == "app.cakto.com.br";+ }+ }+ false+ }++ async fn get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo> {+ Ok(MediaInfo {+ title: "Cakto".to_string(),+ author: String::new(),+ platform: "cakto".to_string(),+ duration_seconds: None,+ thumbnail_url: None,+ available_qualities: vec![VideoQuality {+ label: "Original".to_string(),+ width: 0,+ height: 0,+ url: url.to_string(),+ format: "course".to_string(),+ }],+ media_type: MediaType::Course,+ file_size_bytes: None,+ })+ }++ async fn download(+ &self,+ _info: &MediaInfo,+ _opts: &DownloadOptions,+ _progress: mpsc::Sender<f64>,+ ) -> anyhow::Result<DownloadResult> {+ Err(anyhow!("Use the courses interface to download from Cakto"))+ }+}