2024-04-07 22:07:56 +00:00
|
|
|
use clap::Parser;
|
|
|
|
|
2024-04-12 21:05:28 +00:00
|
|
|
// TODO: Possibly use https://docs.rs/ytextract/latest/ytextract/ instead of ytdlp
|
|
|
|
|
|
|
|
use crate::cli::CliArgs;
|
2024-04-07 22:07:56 +00:00
|
|
|
|
|
|
|
mod cli;
|
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-07 22:07:56 +00:00
|
|
|
|
2024-04-08 00:03:35 +00:00
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
2024-04-12 21:02:42 +00:00
|
|
|
let mut cli_args = CliArgs::parse();
|
|
|
|
cli_args.populate_extra();
|
2024-04-08 00:03:35 +00:00
|
|
|
logger::init_logger(cli_args.debug);
|
2024-04-12 21:02:42 +00:00
|
|
|
|
2024-04-08 00:03:35 +00:00
|
|
|
let manifest = match manifest::Manifest::from_path(&cli_args.manifest.as_std_path()) {
|
|
|
|
Ok(m) => m,
|
|
|
|
Err(e) => {
|
|
|
|
log::error!("Failed to parse manifest file {}: {e}", cli_args.manifest);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2024-04-12 21:02:42 +00:00
|
|
|
|
2024-04-12 21:05:28 +00:00
|
|
|
commands::command_run(&cli_args, &manifest).await;
|
2024-04-07 22:07:56 +00:00
|
|
|
}
|