mangofetch-core 0.5.0

Core download engine for MangoFetch
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use async_trait::async_trait;

use crate::models::media::{DownloadOptions, DownloadResult, MediaInfo};

#[async_trait]
pub trait PlatformDownloader: Send + Sync {
    fn name(&self) -> &str;
    fn can_handle(&self, url: &str) -> bool;
    async fn get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo>;
    async fn download(
        &self,
        info: &MediaInfo,
        opts: &DownloadOptions,
        progress: tokio::sync::mpsc::Sender<f64>,
    ) -> anyhow::Result<DownloadResult>;
}