| 1 |
#compdef gallery-dl |
| 2 |
|
| 3 |
local curcontext="$curcontext" |
| 4 |
typeset -A opt_args |
| 5 |
|
| 6 |
local rc=1 |
| 7 |
_arguments -s -S \ |
| 8 |
{-h,--help}'[Print this help message and exit]' \ |
| 9 |
--version'[Print program version and exit]' \ |
| 10 |
{-f,--filename}'[Filename format string for downloaded files ('\''/O'\'' for "original" filenames)]':'<format>' \ |
| 11 |
{-d,--destination}'[Target location for file downloads]':'<path>' \ |
| 12 |
{-D,--directory}'[Exact location for file downloads]':'<path>' \ |
| 13 |
--restrict-filenames'[Replace restricted filename characters with underscores. One of '\''windows'\'', '\''windows+'\'', '\''unix'\'', '\''ascii'\'', '\''ascii+'\'', or a custom set of characters]':'<value>' \ |
| 14 |
--windows-filenames'[Force filenames to be Windows-compatible]' \ |
| 15 |
{-X,--extractors}'[Load external extractors from PATH]':'<path>' \ |
| 16 |
--compat'[Restore legacy '\''category'\'' names]' \ |
| 17 |
{-S,--server}'[Enable server mode. Send input URLs to a gallery-dl server or create an IPC server when no input URLs are given]' \ |
| 18 |
{-U,--update-check}'[Check if a newer version is available]' \ |
| 19 |
{-i,--input-file}'[Download URLs found in FILE ('\''-'\'' for stdin). More than one --input-file can be specified]':'<file>':_files \ |
| 20 |
{-I,--input-file-comment}'[Download URLs found in FILE. Comment them out after they were downloaded successfully.]':'<file>':_files \ |
| 21 |
{-x,--input-file-delete}'[Download URLs found in FILE. Delete them after they were downloaded successfully.]':'<file>':_files \ |
| 22 |
--no-input'[Do not prompt for passwords/tokens]' \ |
| 23 |
{-q,--quiet}'[Activate quiet mode]' \ |
| 24 |
{-w,--warning}'[Print only warnings and errors]' \ |
| 25 |
{-v,--verbose}'[Print various debugging information]' \ |
| 26 |
{-g,--get-urls}'[Print URLs instead of downloading]' \ |
| 27 |
{-G,--resolve-urls}'[Print URLs instead of downloading; resolve intermediary URLs]' \ |
| 28 |
{-j,--dump-json}'[Print JSON information]' \ |
| 29 |
{-J,--resolve-json}'[Print JSON information; resolve intermediary URLs]' \ |
| 30 |
{-s,--simulate}'[Simulate data extraction; do not download anything]' \ |
| 31 |
{-E,--extractor-info}'[Print extractor defaults and settings]' \ |
| 32 |
{-K,--list-keywords}'[Print a list of available keywords and example values for the given URLs]' \ |
| 33 |
{-e,--error-file}'[Add input URLs which returned an error to FILE]':'<file>':_files \ |
| 34 |
{-N,--print}'[Write FORMAT during EVENT (default '\''prepare'\'') to standard output instead of downloading files. Can be used multiple times. Examples: '\''id'\'' or '\''post:{md5\[:8\]}'\'']':'<[event:]format>' \ |
| 35 |
--Print'[Like --print, but downloads files as well]':'<[event:]format>' \ |
| 36 |
--print-to-file'[Append FORMAT during EVENT to FILE instead of downloading files. Can be used multiple times]':'<[event:]format file>' \ |
| 37 |
--Print-to-file'[Like --print-to-file, but downloads files as well]':'<[event:]format file>' \ |
| 38 |
--list-modules'[Print a list of available extractor modules]' \ |
| 39 |
--list-extractors'[Print a list of extractor classes with description, (sub)category and example URL]':'<[categories]>' \ |
| 40 |
--write-log'[Write logging output to FILE]':'<file>':_files \ |
| 41 |
--write-unsupported'[Write URLs, which get emitted by other extractors but cannot be handled, to FILE]':'<file>':_files \ |
| 42 |
--write-pages'[Write downloaded intermediary pages to files in the current directory to debug problems]' \ |
| 43 |
--print-traffic'[Display sent and read HTTP traffic]' \ |
| 44 |
--no-colors'[Do not emit ANSI color codes in output]' \ |
| 45 |
{-R,--retries}'[Maximum number of retries for failed HTTP requests or -1 for infinite retries (default: 4)]':'<n>' \ |
| 46 |
{-a,--user-agent}'[User-Agent request header]':'<ua>' \ |
| 47 |
--http-timeout'[Timeout for HTTP connections (default: 30.0)]':'<seconds>' \ |
| 48 |
--proxy'[Use the specified proxy]':'<url>' \ |
| 49 |
--xff'[Use a fake '\''X-Forwarded-For'\'' HTTP header to try bypassing geographic restrictions. Can be IP blocks in CIDR notation or two-letter ISO 3166-2 country codes (12.0.0.0/8,FR,CN)]':'<value>' \ |
| 50 |
--source-address'[Client-side IP address to bind to]':'<ip>' \ |
| 51 |
{-4,--force-ipv4}'[Make all connections via IPv4]' \ |
| 52 |
{-6,--force-ipv6}'[Make all connections via IPv6]' \ |
| 53 |
--no-check-certificate'[Disable HTTPS certificate validation]' \ |
| 54 |
{-r,--limit-rate}'[Maximum download rate (e.g. 500k, 2.5M, or 800k-2M)]':'<rate>' \ |
| 55 |
--chunk-size'[Size of in-memory data chunks (default: 32k)]':'<size>' \ |
| 56 |
--no-part'[Do not use .part files]' \ |
| 57 |
--no-skip'[Do not skip downloads; overwrite existing files]' \ |
| 58 |
--no-mtime'[Do not set file modification times according to Last-Modified HTTP response headers]' \ |
| 59 |
--no-download'[Do not download any files]' \ |
| 60 |
--sleep'[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)]':'<seconds>' \ |
| 61 |
--sleep-skip'[Number of seconds to wait after skipping a file download]':'<seconds>' \ |
| 62 |
--sleep-extractor'[Number of seconds to wait before starting data extraction for an input URL]':'<seconds>' \ |
| 63 |
--sleep-request'[Number of seconds to wait between HTTP requests during data extraction]':'<seconds>' \ |
| 64 |
--sleep-retries'[Number of seconds to wait before retrying an HTTP request. Can be prefixed with '\''lin\[:START\[:MAX\]\]'\'' or '\''exp\[:BASE\[:START\[:MAX\]\]\]'\'' for linear or exponential growth between consecutive retries (e.g. '\''30'\'', '\''exp=40'\'', '\''lin:20=30-60'\'']':'<[type=]seconds>' \ |
| 65 |
--sleep-429'[Number of seconds to wait when receiving a '\''429 Too Many Requests'\'' response]':'<[type=]seconds>' \ |
| 66 |
{-o,--option}'[Additional options. Example: -o browser=firefox]':'<key=value>' \ |
| 67 |
{-c,--config}'[Additional configuration files in default format]':'<file>':_files \ |
| 68 |
--config-json'[Additional configuration files in JSON format]':'<file>':_files \ |
| 69 |
--config-yaml'[Additional configuration files in YAML format]':'<file>':_files \ |
| 70 |
--config-toml'[Additional configuration files in TOML format]':'<file>':_files \ |
| 71 |
--config-type'[Set filetype of default configuration files (json, yaml, toml)]':'<type>' \ |
| 72 |
--config-ignore'[Do not load default configuration files]' \ |
| 73 |
--config-create'[Create a basic configuration file]' \ |
| 74 |
--config-status'[Show configuration file status]' \ |
| 75 |
--config-open'[Open configuration file in external application]' \ |
| 76 |
--cache-file'[Use PATH as cache file]':'<path>' \ |
| 77 |
--cache-status'[Show cache file information]' \ |
| 78 |
--cache-show'[Show cached values for MODULE (ALL to show all entries, EXP to show only expired entries, VAL to show only valid entries)]':'<module>' \ |
| 79 |
--cache-clear'[Delete cached login sessions, cookies, etc. for MODULE (ALL to delete everything, EXP to delete only expired values)]':'<module>' \ |
| 80 |
--cache-vacuum'[Clean up the cache database by removing unused space and reorganizing the data to improve performance]' \ |
| 81 |
{-u,--username}'[Username to login with]':'<user>' \ |
| 82 |
{-p,--password}'[Password belonging to the given username]':'<pass>' \ |
| 83 |
--netrc'[Enable .netrc authentication data]' \ |
| 84 |
{-C,--cookies}'[File to load additional cookies from]':'<file>':_files \ |
| 85 |
--cookies-export'[Export session cookies to FILE]':'<file>':_files \ |
| 86 |
--cookies-from-browser'[Name of the browser to load cookies from, with optional domain prefixed with '\''/'\'', keyring name prefixed with '\''+'\'', profile prefixed with '\'':'\'', and container prefixed with '\''::'\'' ('\''none'\'' for no container (default), '\''all'\'' for all containers)]':'<browser[/domain][+keyring][:profile][::container]>' \ |
| 87 |
{-A,--abort}'[Stop current extractor(s) after N consecutive file downloads were skipped. Specify a TARGET to set how many levels to ascend or to which subcategory to jump to. Examples: '\''-A 3'\'', '\''-A 3:2'\'', '\''-A 3:manga'\'']':'<n[:target]>' \ |
| 88 |
{-T,--terminate}'[Stop current & parent extractors and proceed with the next input URL after N consecutive file downloads were skipped]':'<n>' \ |
| 89 |
--filesize-min'[Do not download files smaller than SIZE (e.g. 500k or 2.5M)]':'<size>' \ |
| 90 |
--filesize-max'[Do not download files larger than SIZE (e.g. 500k or 2.5M)]':'<size>' \ |
| 91 |
--download-archive'[Record successfully downloaded files in FILE and skip downloading any file already in it]':'<file>':_files \ |
| 92 |
--date-before'[Process only posts created before this date given in ISO 8601 format or as Unix timestamp (e.g. '\''2025-10-31'\'', '\''2026-01-09T15:30:00'\'', '\''1767972600'\'')]':'<date>' \ |
| 93 |
--date-after'[Process only posts created after this date. Stop extraction when an older post is encountered]':'<date>' \ |
| 94 |
--blacklist'[Ignore the given comma-separated category names or category:subcategory pairs when spawning child extractors for external URLs (e.g. '\''pixiv'\'', '\''pixiv:user,*:artist'\'')]':'<categories>' \ |
| 95 |
--whitelist'[Allow only the given comma-separated category names or category:subcategory pairs to allow when spawning child extractors for external URLs]':'<categories>' \ |
| 96 |
--tags-blacklist'[Ignore posts tagged with any of the tags given as comma-separated list or path to a file containing them. Danbooru blacklist rules are supported. Can be '\''/import'\'' to use your account'\''s blacklist. (e.g. '\''1girl'\'', '\''shirt,highres -blush,smile'\'', '\''C:\path\to\list.txt'\'')]':'<tags>' \ |
| 97 |
--tags-whitelist'[Allow only posts tagged with at least one of the tags given as comma-separated list or path to a file containing them]':'<tags>' \ |
| 98 |
--range'[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'\'')]':'<range>' \ |
| 99 |
--post-range'[Like '\''--range'\'', but for posts]':'<range>' \ |
| 100 |
--child-range'[Like '\''--range'\'', but for child extractors handling manga chapters, external URLs, etc.]':'<range>' \ |
| 101 |
--filter'[Python 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'\'')"]':'<expr>' \ |
| 102 |
--post-filter'[Like '\''--filter'\'', but for posts]':'<expr>' \ |
| 103 |
--child-filter'[Like '\''--filter'\'', but for child extractors handling manga chapters, external URLs, etc.]':'<expr>' \ |
| 104 |
{-P,--postprocessor}'[Activate the specified post processor]':'<name>' \ |
| 105 |
--no-postprocessors'[Do not run any post processors]' \ |
| 106 |
{-O,--postprocessor-option}'[Additional post processor options]':'<key=value>' \ |
| 107 |
--write-metadata'[Write metadata to separate JSON files]' \ |
| 108 |
--write-info-json'[Write gallery metadata to a info.json file]' \ |
| 109 |
--write-tags'[Write image tags to separate text files]' \ |
| 110 |
--zip'[Store downloaded files in a ZIP archive]' \ |
| 111 |
--cbz'[Store downloaded files in a CBZ archive]' \ |
| 112 |
--mtime'[Set file modification times according to metadata selected by NAME. Examples: '\''date'\'' or '\''status\[date\]'\'']':'<name>' \ |
| 113 |
--rename'[Rename previously downloaded files from FORMAT to the current filename format]':'<format>' \ |
| 114 |
--rename-to'[Rename previously downloaded files from the current filename format to FORMAT]':'<format>' \ |
| 115 |
--ugoira'[Convert Pixiv Ugoira to FMT using FFmpeg. Supported formats are '\''webm'\'', '\''mp4'\'', '\''gif'\'', '\''vp8'\'', '\''vp9'\'', '\''vp9-lossless'\'', '\''copy'\'', '\''zip'\''.]':'<fmt>' \ |
| 116 |
--exec'[Execute CMD for each downloaded file. Supported replacement fields are {} or {_path}, {_temppath}, {_directory}, {_filename}. On Windows, use {_path_unc} or {_directory_unc} for UNC paths. Example: --exec "convert {} {}.png && rm {}"]':'<cmd>' \ |
| 117 |
--exec-after'[Execute CMD after all files were downloaded. Example: --exec-after "cd {_directory} && convert * ../doc.pdf"]':'<cmd>' && rc=0 |
| 118 |
|
| 119 |
return rc |