2024-04-15 14:47:43 +00:00
|
|
|
use config::ConfigWrapper;
|
2024-04-07 22:07:56 +00:00
|
|
|
|
|
|
|
|
2024-04-15 14:47:43 +00:00
|
|
|
// TODO: Possibly use https://docs.rs/ytextract/latest/ytextract/ instead of ytdlp
|
2024-04-08 00:03:35 +00:00
|
|
|
mod manifest;
|
|
|
|
mod logger;
|
|
|
|
mod downloader;
|
|
|
|
mod util;
|
2024-04-12 21:02:42 +00:00
|
|
|
mod commands;
|
|
|
|
mod prompt;
|
2024-04-15 14:47:43 +00:00
|
|
|
mod config;
|
|
|
|
mod constants;
|
2024-04-07 22:07:56 +00:00
|
|
|
|
2024-04-08 00:03:35 +00:00
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
2024-04-15 14:47:43 +00:00
|
|
|
let Ok(cfg) = ConfigWrapper::parse().await else {
|
|
|
|
return;
|
|
|
|
};
|
2024-04-12 21:02:42 +00:00
|
|
|
|
2024-04-15 14:47:43 +00:00
|
|
|
let mut manifest = match manifest::Manifest::from_path(&cfg.cli.manifest.as_std_path()) {
|
2024-04-08 00:03:35 +00:00
|
|
|
Ok(m) => m,
|
|
|
|
Err(e) => {
|
2024-04-15 14:47:43 +00:00
|
|
|
log::error!("Failed to parse manifest file {}: {e}", cfg.cli.manifest);
|
2024-04-08 00:03:35 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2024-04-12 21:02:42 +00:00
|
|
|
|
2024-04-15 14:47:43 +00:00
|
|
|
let _ = commands::command_run(&cfg, &mut manifest).await;
|
2024-04-07 22:07:56 +00:00
|
|
|
}
|