diff options
| author | A Farzat <a@farzat.xyz> | 2026-03-08 08:33:47 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-03-08 08:33:47 +0300 |
| commit | b83dfc5da6424fce7bda8c551303cc5bd91447e3 (patch) | |
| tree | fb6856bbb36366bd92bf4375fadd9647a5b8061e /src/main.rs | |
| parent | a4d8965250d2ebefc6476a19ead74b51fd610ed9 (diff) | |
| download | oreilly-epub-b83dfc5da6424fce7bda8c551303cc5bd91447e3.tar.gz oreilly-epub-b83dfc5da6424fce7bda8c551303cc5bd91447e3.zip | |
Allow skipping downloads
This streamlines testing.
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 00e38a5..c7de6ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,9 +23,9 @@ struct Args { /// Path to the cookies.json file. #[arg(long, default_value = "cookies.json")] cookies: String, - /// Do not delete the log file on success. - #[arg(long = "preserve-log")] - preserve_log: bool, + /// Do not download files. Use if they were already downloaded in a previous run. + #[arg(long = "skip-download")] + skip_download: bool, } /// Fetches EPUB structural data (like the chapters URL). @@ -117,7 +117,9 @@ async fn main() -> Result<()> { let dest_root = format!("Books/{}/epub_root", args.bookid); let dest_root = Path::new(&dest_root); - download_all_files(&client, &file_entries, dest_root).await?; + if !args.skip_download { + download_all_files(&client, &file_entries, dest_root).await?; + } let epub_path = format!("Books/{0}/{0}.epub", args.bookid); let epub_path = Path::new(&epub_path); create_epub_archive(&epub_data, dest_root, epub_path, &file_entries, &chapters)?; |
