begin implementing generic download function

This commit is contained in:
mykola2312 2024-02-21 18:48:03 +02:00
parent ed013fae4d
commit 819e30c1fa

View file

@ -1,3 +1,27 @@
use self::spawn::SpawnError;
use self::yt_dlp::YtDlpError;
pub mod ffmpeg;
mod spawn;
pub mod yt_dlp;
pub enum DownloadError {
Message(String)
}
impl From<SpawnError> for DownloadError {
fn from(value: SpawnError) -> Self {
Self::Message(value.to_string())
}
}
impl From<YtDlpError> for DownloadError {
fn from(value: YtDlpError) -> Self {
Self::Message(value.to_string())
}
}
pub async fn download(url: &str) -> Result<String, DownloadError> {
todo!()
}