diff --git a/docs/options.md b/docs/options.md index 4f6c1458..8dd967da 100644 --- a/docs/options.md +++ b/docs/options.md @@ -8,63 +8,75 @@ - - + + + - + + - - + + + - - + + + - - + + + - - + + + - + + - + + - + + - + + - + + - + + @@ -76,68 +88,81 @@
-h--help‑h‑‑help Print this help message and exit
--version‑‑version Print program version and exit
-i--input-file‑i‑‑input‑fileFILE Download URLs found in FILE (- for stdin). More than one --input-file can be specified
-d--destination‑d‑‑destinationPATH Target location for file downloads
-D--directory‑D‑‑directoryPATH Exact location for file downloads
-f--filename‑f‑‑filenameFORMAT Filename format string for downloaded files (/O for "original" filenames)
--proxy‑‑proxyURL Use the specified proxy
--source-address‑‑source‑addressIP Client-side IP address to bind to
--user-agent‑‑user‑agentUA User-Agent request header
--clear-cache‑‑clear‑cacheMODULE Delete cached login sessions, cookies, etc. for MODULE (ALL to delete everything)
--cookies‑‑cookiesFILE File to load additional cookies from
--cookies-from-browser‑‑cookies‑from‑browserBROWSER Name of the browser to load cookies from, with optional keyring name prefixed with +, profile prefixed with :, and container prefixed with :: (none for no container)
- - + + + - - + + + - - + + + - - + + + - - + + + - - + + + - - + + + - - + + + - + + - + + - + + - + + - + + @@ -149,78 +174,93 @@
-q--quiet‑q‑‑quiet Activate quiet mode
-v--verbose‑v‑‑verbose Print various debugging information
-g--get-urls‑g‑‑get‑urls Print URLs instead of downloading
-G--resolve-urls‑G‑‑resolve‑urls Print URLs instead of downloading; resolve intermediary URLs
-j--dump-json‑j‑‑dump‑json Print JSON information
-s--simulate‑s‑‑simulate Simulate data extraction; do not download anything
-E--extractor-info‑E‑‑extractor‑info Print extractor defaults and settings
-K--list-keywords‑K‑‑list‑keywords Print a list of available keywords and example values for the given URLs
--list-modules‑‑list‑modules Print a list of available extractor modules
--list-extractors‑‑list‑extractors Print a list of extractor classes with description, (sub)category and example URL
--write-log‑‑write‑logFILE Write logging output to FILE
--write-unsupported‑‑write‑unsupportedFILE Write URLs, which get emitted by other extractors but cannot be handled, to FILE
--write-pages‑‑write‑pages Write downloaded intermediary pages to files in the current directory to debug problems
- - + + + - - + + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + @@ -232,18 +272,21 @@
-r--limit-rate‑r‑‑limit‑rateRATE Maximum download rate (e.g. 500k or 2.5M)
-R--retries‑R‑‑retriesN Maximum number of retries for failed HTTP requests or -1 for infinite retries (default: 4)
--http-timeout‑‑http‑timeoutSECONDS Timeout for HTTP connections (default: 30.0)
--sleep‑‑sleepSECONDS Number of seconds to wait before each download. This can be either a constant value or a range (e.g. 2.7 or 2.0-3.5)
--sleep-request‑‑sleep‑requestSECONDS Number of seconds to wait between HTTP requests during data extraction
--sleep-extractor‑‑sleep‑extractorSECONDS Number of seconds to wait before starting data extraction for an input URL
--filesize-min‑‑filesize‑minSIZE Do not download files smaller than SIZE (e.g. 500k or 2.5M)
--filesize-max‑‑filesize‑maxSIZE Do not download files larger than SIZE (e.g. 500k or 2.5M)
--chunk-size‑‑chunk‑sizeSIZE Size of in-memory data chunks (default: 32k)
--no-part‑‑no‑part Do not use .part files
--no-skip‑‑no‑skip Do not skip downloads; overwrite existing files
--no-mtime‑‑no‑mtime Do not set file modification times according to Last-Modified HTTP response headers
--no-download‑‑no‑download Do not download any files
--no-postprocessors‑‑no‑postprocessors Do not run any post processors
--no-check-certificate‑‑no‑check‑certificate Disable HTTPS certificate validation
- - + + + - - + + + - + + @@ -255,18 +298,21 @@
-c--config‑c‑‑configFILE Additional configuration files
-o--option‑o‑‑optionOPT Additional <key>=<value> option values
--ignore-config‑‑ignore‑config Do not read default configuration files
- - + + + - - + + + - + + @@ -279,37 +325,44 @@ - + + - - + + + - - + + + - + + - + + - - + + + - + + @@ -322,57 +375,68 @@ - + + - + + - + + - + + - + + - + + - + + - + + - - + + + - - + + + - - + + + diff --git a/scripts/options.py b/scripts/options.py index 66b7b3fc..6e200cbc 100755 --- a/scripts/options.py +++ b/scripts/options.py @@ -36,24 +36,25 @@ TABLE = """ ROW = """ - {} + + """.format -sub = re.compile(r"'([^']+)'").sub tables = [] +sub = re.compile(r"'([^']+)'").sub +nb_hyphen = "‑" # non-breaking hyphen for group in option.build_parser()._action_groups[2:]: tbody = [] - append = tbody.append - width = ' width="28%"' for action in group._group_actions: help = action.help if help == SUPPRESS: continue + meta = action.metavar or "" try: short, long = action.option_strings @@ -65,15 +66,20 @@ for group in option.build_parser()._action_groups[2:]: short = "" if short: - short = "" + short + "" + short = "" + short.replace("-", nb_hyphen) + "" if long: - long = '' + long + "" + long = "" + long.replace("-", nb_hyphen) + "" + if meta: + meta = "" + meta.partition("[")[0] + "" if help: help = help.replace("<", "<").replace(">", ">") - help = sub("\\1", help) + if "Example: " in help: + help, sep, example = help.partition("Example: ") + help = sub("\\1", help) + "
" + sep + example + else: + help = sub("\\1", help) - append(ROW(short, width, long, help)) - width = "" + tbody.append(ROW(short, long, meta, help)) tables.append(TABLE(group.title, "\n".join(tbody)))
-u--username‑u‑‑usernameUSER Username to login with
-p--password‑p‑‑passwordPASS Password belonging to the given username
--netrc‑‑netrc Enable .netrc authentication data
--download-archive‑‑download‑archiveFILE Record all downloaded or skipped files in FILE and skip downloading any file already in it
-A--abort‑A‑‑abortN Stop current extractor run after N consecutive file downloads were skipped
-T--terminate‑T‑‑terminateN Stop current and parent extractor runs after N consecutive file downloads were skipped
--range‑‑rangeRANGE Index range(s) specifying which files to download. These can be either a constant value, range, or slice (e.g. 5, 8-20, or 1:24:3)
--chapter-range‑‑chapter‑rangeRANGE Like --range, but applies to manga chapters and other delegated URLs
--filterPython expression controlling which files to download. Files for which the expression evaluates to False are ignored. Available keys are the filename-specific ones listed by -K. Example: --filter "image_width >= 1000 and rating in (s, q)"‑‑filterEXPRPython expression controlling which files to download. Files for which the expression evaluates to False are ignored. Available keys are the filename-specific ones listed by -K.
Example: --filter "image_width >= 1000 and rating in ('s', 'q')"
--chapter-filter‑‑chapter‑filterEXPR Like --filter, but applies to manga chapters and other delegated URLs
--zip‑‑zip Store downloaded files in a ZIP archive
--ugoira-conv‑‑ugoira‑conv Convert Pixiv Ugoira to WebM (requires FFmpeg)
--ugoira-conv-lossless‑‑ugoira‑conv‑lossless Convert Pixiv Ugoira to WebM in VP9 lossless mode
--ugoira-conv-copy‑‑ugoira‑conv‑copy Convert Pixiv Ugoira to MKV without re-encoding any frames
--write-metadata‑‑write‑metadata Write metadata to separate JSON files
--write-info-json‑‑write‑info‑json Write gallery metadata to a info.json file
--write-tags‑‑write‑tags Write image tags to separate text files
--mtime-from-date‑‑mtime‑from‑date Set file modification times according to date metadata
--execExecute CMD for each downloaded file. Example: --exec convert {} {}.png && rm {}‑‑execCMDExecute CMD for each downloaded file.
Example: --exec "convert {} {}.png && rm {}"
--exec-afterExecute CMD after all files were downloaded successfully. Example: --exec-after cd {} && convert * ../doc.pdf‑‑exec‑afterCMDExecute CMD after all files were downloaded successfully.
Example: --exec-after "cd {} && convert * ../doc.pdf"
-P--postprocessor‑P‑‑postprocessorNAME Activate the specified post processor
{}{}{} {}