gallery-dl

Gallery-DL is a powerful command-line program designed to download image galleries and collections from various websites. It provides a convenient way to download entire galleries or collections with just a few simple commands. For videos see yt-dlp.

Command-Line Options

Usage: gallery-dl [url]

General Options:

OptionDescription
-f, --filename FORMATFilename format string for downloaded files (‘/O’ for “original” filenames)
-d, --destination PATHTarget location for file downloads
-D, --directory PATHExact location for file downloads
-X, --extractors PATHLoad external extractors from PATH
--proxy URLUse the specified proxy
--source-address IPClient-side IP address to bind to
--user-agent UAUser-Agent request header
--clear-cache MODULEDelete cached login sessions, cookies, etc. for MODULE (ALL to delete everything)

Input Options:

OptionDescription
-i, --input-file FILEDownload URLs found in FILE (’-’ for stdin). More than one --input-file can be specified.
-I, --input-file-comment FILEDownload URLs found in FILE. Comment them out after they were downloaded successfully.
-x, --input-file-delete FILEDownload URLs found in FILE. Delete them after they were downloaded successfully.

Output Options:

OptionDescription
-q, --quietActivate quiet mode
-v, --verbosePrint various debugging information
-g, --get-urlsPrint URLs instead of downloading
-G, --resolve-urlsPrint URLs instead of downloading; resolve intermediary URLs
-j, --dump-jsonPrint JSON information
-s, --simulateSimulate data extraction; do not download anything
-E, --extractor-infoPrint extractor defaults and settings
-K, --list-keywordsPrint a list of available keywords and example values for the given URLs
-e, --error-file FILEAdd input URLs which returned an error to FILE
--list-modulesPrint a list of available extractor modules
--list-extractorsPrint a list of extractor classes with description, (sub)category and example URL
--write-log FILEWrite logging output to FILE
--write-unsupported FILEWrite URLs, which get emitted by other extractors but cannot be handled, to FILE
--write-pagesWrite downloaded intermediary pages to files in the current directory to debug problems

Downloader Options:

OptionDescription
-r, --limit-rate RATEMaximum download rate (e.g. 500k or 2.5M)
-R, --retries NMaximum number of retries for failed HTTP requests or -1 for infinite retries (default: 4)
--http-timeout SECONDSTimeout for HTTP connections (default: 30.0)
--sleep SECONDSNumber 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 SECONDSNumber of seconds to wait between HTTP requests during data extraction
--sleep-extractor SECONDSNumber of seconds to wait before starting data extraction for an input URL
--filesize-min SIZEDo not download files smaller than SIZE (e.g. 500k or 2.5M)
--filesize-max SIZEDo not download files larger than SIZE (e.g. 500k or 2.5M)
--chunk-size SIZESize of in-memory data chunks (default: 32k)
--no-partDo not use .part files
--no-skipDo not skip downloads; overwrite existing files
--no-mtimeDo not set file modification times according to Last-Modified HTTP response headers
--no-downloadDo not download any files
--no-postprocessorsDo not run any post processors
--no-check-certificateDisable HTTPS certificate validation

Configuration Options:

OptionDescription
-o, --option KEY=VALUEAdditional options. Example: -o browser=firefox
-c, --config FILEAdditional configuration files
--config-yaml FILEAdditional configuration files in YAML format
--config-toml FILEAdditional configuration files in TOML format
--config-createCreate a basic configuration file
--config-ignoreDo not read default configuration files

Authentication Options:

OptionDescription
-u, --username USERUsername to login with
-p, --password PASSPassword belonging to the given username
--netrcEnable .netrc authentication data
OptionDescription
-C, --cookies FILEFile to load additional cookies from
--cookies-export FILEExport session cookies to FILE
--cookies-from-browser BROWSER[/DOMAIN][+KEYRING][:PROFILE][::CONTAINER]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’)

Selection Options:

OptionDescription
--download-archive FILERecord all downloaded or skipped files in FILE and skip downloading any file already in it
-A, --abort NStop current extractor run after N consecutive file downloads were skipped
-T, --terminate NStop current and parent extractor runs after N consecutive file downloads were skipped
--range RANGEIndex 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 RANGELike ‘—range’, but applies to manga chapters and other delegated URLs
--filter EXPRPython 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 EXPRLike ‘—filter’, but applies to manga chapters and other delegated URLs

Post-processing Options:ooo

OptionDescription
-P, --postprocessor NAMEActivate the specified post processor
-O, --postprocessor-option KEY=VALUEAdditional post processor options
--write-metadataWrite metadata to separate JSON files
--write-info-jsonWrite gallery metadata to a info.json file
--write-tagsWrite image tags to separate text files
--zipStore downloaded files in a ZIP archive
--cbzStore downloaded files in a CBZ archive
--mtime NAMESet file modification times according to metadata selected by NAME. Examples: ‘date’ or ‘status[date]‘
--ugoira FORMATConvert Pixiv Ugoira to FORMAT using FFmpeg. Supported formats are ‘webm’, ‘mp4’, ‘gif’, ‘vp8’, ‘vp9’, ‘vp9-lossless’, ‘copy’.
--exec CMDExecute CMD for each downloaded file. Supported replacement fields are {} or {_path}, {_directory}, {_filename}. Example: —exec “convert {} {}.png && rm {}“
--exec-after CMDExecute CMD after all files were downloaded. Example: —exec-after “cd {_directory} && convert * ../doc.pdf”