begin implementing generic download function
This commit is contained in:
parent
d8ea0e7490
commit
a3217274e3
1 changed files with 24 additions and 0 deletions
24
src/dl.rs
24
src/dl.rs
|
|
@ -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!()
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue