From 0f45fe2526d7be48d77ef60b7505a196d533b4f4 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Thu, 5 Oct 2023 15:27:46 -0700 Subject: Add new options to readme and man page --- README.md | 8 +++++--- wikiget.1 | 9 ++++++++- wikiget.1.md | 10 +++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9bf9250..4faadf4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Requires Python 3.7+. Get it with `pip install --user wikiget` or `pipx install ## Usage -`wikiget [-h] [-V] [-q | -v] [-f] [-s SITE] [-P PATH] [-u USERNAME] [-p PASSWORD] [-o OUTPUT | -a] [-l LOGFILE] FILE` +`wikiget [-h] [-V] [-q | -v] [-f] [-s SITE] [-P PATH] [-u USERNAME] [-p PASSWORD] [-o OUTPUT | -a] [-l LOGFILE] [-j THREADS] FILE` The only required parameter is `FILE`, which is the file you want to download. It can either be the name of the file on the wiki, including the namespace prefix, or a link to the file description page. If `FILE` is in the form @@ -36,7 +36,10 @@ By default, the program won't overwrite existing files with the same name as the Files can be batch downloaded with the `-a` or `--batch` flag. In this mode, `FILE` will be treated as an input file containing multiple files to download, one filename or URL per line. If an error is encountered, execution stops -immediately and the offending filename is printed. +immediately and the offending filename is printed. For large batches, the process can be sped up by downloading files +in parallel. The number of parallel downloads can be set with `-j`. For instance, with `-a -j4`, wikiget will download +four files at once. Without `-j` or with `-j` by itself without a number, wikiget will download the files one at a +time. ### Example usage @@ -48,7 +51,6 @@ wikiget https://en.wikipedia.org/wiki/File:Example.jpg -o test.jpg ## Future plans -- download multiple files at once in batch mode - continue batch download even if input is malformed or file doesn't exist (possibly by raising exceptions in `download()`) - batch download by (Commons) category or user uploads diff --git a/wikiget.1 b/wikiget.1 index 060fd54..03a0c41 100644 --- a/wikiget.1 +++ b/wikiget.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.1.8 .\" -.TH "WIKIGET" "1" "October 3, 2023" "Version 0.5.1" "Wikiget User Manual" +.TH "WIKIGET" "1" "October 5, 2023" "Version 0.5.1" "Wikiget User Manual" .SH NAME wikiget - download files from MediaWiki sites .SH SYNOPSIS @@ -76,6 +76,10 @@ Force existing files to be overwritten. If this flag is set, \f[B]wikiget\f[R] will run in batch download mode (see \f[I]BATCHFILE\f[R]). .TP +-\f[B]j\f[R], --\f[B]threads\f[R] +Number of parallel downloads to attempt in batch mode. +This option has no effect if -\f[B]a\f[R] is not also set. +.TP -\f[B]v\f[R], --\f[B]verbose\f[R] Print additional information, such as the site used and the full URL of the file. @@ -84,6 +88,9 @@ Additional invocations will increase the level of detail. -\f[B]q\f[R], --\f[B]quiet\f[R] Silence warnings and minimize printed output. .TP +-\f[B]V\f[R], --\f[B]version\f[R] +Print the version number of the program. +.TP -\f[B]h\f[R], --\f[B]help\f[R] Print a brief summary of these options. .SH EXAMPLES diff --git a/wikiget.1.md b/wikiget.1.md index d05aaf1..45184f4 100644 --- a/wikiget.1.md +++ b/wikiget.1.md @@ -1,6 +1,6 @@ % WIKIGET(1) Version 0.5.1 | Wikiget User Manual % Cody Logan -% October 3, 2023 +% October 5, 2023 # NAME @@ -68,6 +68,10 @@ the file name or the URL of its description page. : If this flag is set, **wikiget** will run in batch download mode (see *BATCHFILE*). +\-**j**, \-\-**threads** + +: Number of parallel downloads to attempt in batch mode. This option has no effect if \-**a** is not also set. + \-**v**, \-\-**verbose** : Print additional information, such as the site used and the full URL of the file. Additional invocations will @@ -77,6 +81,10 @@ the file name or the URL of its description page. : Silence warnings and minimize printed output. +\-**V**, \-\-**version** + +: Print the version number of the program. + \-**h**, \-\-**help** : Print a brief summary of these options. -- cgit v1.2.3