GALLERY-DL(1)
β¨ gallery-dl Β· GALLERY-DL(1) Β· the gallery-dl Manual β¨
okay bestie, sit down, hydrate, and let me tell you about the single most iconic lil command line tool in the whole image-hoarding ecosystem π
πΈ NAME πΈ
gallery-dl β download image-galleries and -collections
π¦ SYNOPSIS π¦
gallery-dl [OPTION]... URL...
π DESCRIPTION π
okay so gallery-dl is a command-line program that downloads image-galleries and -collections from several image hosting sites. the way it's cross-platform, has so many configuration options, and has genuinely powerful filenaming capabilities?? it's giving main character energy, no cap πβ¨
π OPTIONS π
-h,--helpβ prints this help message and then dips out--versionβ prints the program version and exits, periodt-f,--filenameFORMAT β the filename format string for your downloaded files (use'/O'if you want the "original" filenames, iykyk)-d,--destinationPATH β where your files go, the target location for file downloads-D,--directoryPATH β the exact location for file downloads, no wiggle room--restrict-filenamesVALUE β replaces restricted filename characters with underscores. pick one of'windows','windows+','unix','ascii','ascii+', or bring your own custom set of characters π«--windows-filenamesβ forces filenames to be Windows-compatible, whether they like it or not-X,--extractorsPATH β load external extractors from PATH--compatβ restores the legacy'category'names, for the nostalgia girlies-S,--serverβ enables server mode. sends input URLs to a gallery-dl server, or creates an IPC server when you give it no input URLs-U,--update-checkβ checks if a newer version is available (spoiler: maybe π)-i,--input-fileFILE β downloads all the URLs found in FILE (use'-'for stdin). and yes bestie, you can specify more than one--input-file-I,--input-file-commentFILE β downloads the URLs found in FILE, then comments them out once they've downloaded successfully. tidy!!-x,--input-file-deleteFILE β downloads the URLs found in FILE, then deletes them after they downloaded successfully. ruthless π--no-inputβ does not prompt for passwords/tokens-q,--quietβ activates quiet mode π€«-w,--warningβ prints only warnings and errors-v,--verboseβ prints various debugging information, the tea β-g,--get-urlsβ prints the URLs instead of downloading-G,--resolve-urlsβ prints URLs instead of downloading, and resolves intermediary URLs on the way-j,--dump-jsonβ prints JSON information-J,--resolve-jsonβ prints JSON information, and resolves intermediary URLs too-s,--simulateβ simulates data extraction, downloads absolutely nothing-E,--extractor-infoβ prints extractor defaults and settings-K,--list-keywordsβ prints a list of available keywords plus example values for the URLs you gave it-e,--error-fileFILE β adds input URLs that returned an error to FILE-N,--print[EVENT:]FORMATβ writes FORMAT during EVENT to standard output instead of downloading files.EVENTdefaults to'prepare'. can be used multiple times. examples:'id'or'post:{md5[:8]}'--Print[EVENT:]FORMATβ like--print, but it downloads files as well (capital P, capital energy π)--print-to-file[EVENT:]FORMATFILE β appends FORMAT during EVENT to FILE instead of downloading files. can be used multiple times--Print-to-file[EVENT:]FORMATFILE β like--print-to-file, but it downloads files as well--list-modulesβ prints a list of available extractor modules--list-extractors[CATEGORIES]β prints a list of extractor classes with description, (sub)category and example URL--write-logFILE β writes logging output to FILE--write-unsupportedFILE β writes URLs that get emitted by other extractors but can't be handled to FILE--write-pagesβ writes downloaded intermediary pages to files in the current directory so you can debug problems--print-trafficβ displays sent and read HTTP traffic--no-colorsβ does not emit ANSI color codes in output π«π-R,--retriesN β maximum number of retries for failed HTTP requests, or-1for infinite retries (default:4)-a,--user-agentUA β the User-Agent request header--http-timeoutSECONDS β timeout for HTTP connections (default:30.0)--proxyURL β use the specified proxy--xffVALUE β uses 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)--source-addressIP β client-side IP address to bind to-4,--force-ipv4β makes all connections via IPv4-6,--force-ipv6β makes all connections via IPv6--no-check-certificateβ disables HTTPS certificate validation-r,--limit-rateRATE β maximum download rate (e.g.500k,2.5M, or800k-2M)--chunk-sizeSIZE β size of in-memory data chunks (default:32k)--no-partβ does not use.partfiles--no-skipβ does not skip downloads, it overwrites existing files--no-mtimeβ does not set file modification times according toLast-ModifiedHTTP response headers--no-downloadβ does not download any files--sleepSECONDS β number of seconds to wait before each download. can be a constant value or a range (e.g.2.7or2.0-3.5)--sleep-skipSECONDS β number of seconds to wait after skipping a file download--sleep-extractorSECONDS β number of seconds to wait before starting data extraction for an input URL--sleep-requestSECONDS β number of seconds to wait between HTTP requests during data extraction--sleep-retries[TYPE=]SECONDSβ 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'--sleep-429[TYPE=]SECONDSβ number of seconds to wait when receiving a'429 Too Many Requests'response-o,--optionKEY=VALUE β additional options. example:-o browser=firefox-c,--configFILE β additional configuration files in default format--config-jsonFILE β additional configuration files in JSON format--config-yamlFILE β additional configuration files in YAML format--config-tomlFILE β additional configuration files in TOML format--config-typeTYPE β sets the filetype of default configuration files (json,yaml,toml)--config-ignoreβ does not load default configuration files--config-createβ creates a basic configuration file--config-statusβ shows configuration file status--config-openβ opens configuration file in an external application--cache-filePATH β use PATH as the cache file--cache-statusβ shows cache file information--cache-showMODULE β shows cached values for MODULE (ALLto show all entries,EXPto show only expired entries,VALto show only valid entries)--cache-clearMODULE β deletes cached login sessions, cookies, etc. for MODULE (ALLto delete everything,EXPto delete only expired values)--cache-vacuumβ cleans up the cache database by removing unused space and reorganizing the data to improve performance. self-care for your cache π§-u,--usernameUSER β the username to login with-p,--passwordPASS β the password belonging to the given username--netrcβ enables.netrcauthentication data-C,--cookiesFILE β file to load additional cookies from πͺ--cookies-exportFILE β exports session cookies to FILE--cookies-from-browserBROWSER[/DOMAIN][+KEYRING][:PROFILE][::CONTAINER]β name of the browser to load cookies from, with an optional domain prefixed with/, keyring name prefixed with+, profile prefixed with:, and container prefixed with::('none'for no container (default),'all'for all containers)-A,--abortN[:TARGET]β stops the current extractor(s) after N consecutive file downloads were skipped. specify a TARGET to set how many levels to ascend or which subcategory to jump to. examples:'-A 3','-A 3:2','-A 3:manga'-T,--terminateN β stops the current & parent extractors and proceeds with the next input URL after N consecutive file downloads were skipped--filesize-minSIZE β does not download files smaller than SIZE (e.g.500kor2.5M)--filesize-maxSIZE β does not download files larger than SIZE (e.g.500kor2.5M)--download-archiveFILE β records successfully downloaded files in FILE and skips downloading any file that's already in it. memory of an elephant fr fr π--date-beforeDATE β processes only posts created before this date, given in ISO 8601 format or as a Unix timestamp (e.g.'2025-10-31','2026-01-09T15:30:00','1767972600')--date-afterDATE β processes only posts created after this date. stops extraction when an older post is encountered--blacklistCATEGORIES β ignores the given comma-separated category names orcategory:subcategorypairs when spawning child extractors for external URLs (e.g.'pixiv','pixiv:user,*:artist')--whitelistCATEGORIES β allows only the given comma-separated category names orcategory:subcategorypairs when spawning child extractors for external URLs--tags-blacklistTAGS β ignores posts tagged with any of the tags given as a comma-separated list or as a 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:athot.txt')--tags-whitelistTAGS β allows only posts tagged with at least one of the tags given as a comma-separated list or a path to a file containing them--rangeRANGE β index range(s) specifying which files to download. these can be a constant value, a range, or a slice (e.g.'5','8-20', or'1:24:3')--post-rangeRANGE β like'--range', but for posts--child-rangeRANGE β like'--range', but for child extractors handling manga chapters, external URLs, etc.--filterEXPR β a Python expression controlling which files to download. files for which the expression evaluates to False are ignored. the available keys are the filename-specific ones listed by'-K'. example:--filter "image_width >= 1000 and rating in ('s', 'q')"--post-filterEXPR β like'--filter', but for posts--child-filter EXPRβ bestie it's literally--filterbut for the child extractors, you know, the ones doing manga chapters and external URLs and all that extracurricular π-P,--postprocessor NAMEβ turn on the post processor you named, go off queen β¨--no-postprocessorsβ nope, not a single post processor runs today, we're resting π-O,--postprocessor-option KEY=VALUEβ extra options for your post processors, pass them a little something π--write-metadataβ drops your metadata into separate JSON files, one per file, very organized of it β¨--write-info-jsonβ writes the whole gallery metadata into aninfo.jsonfile π--write-tagsβ image tags go into their own separate text files, cute and labelled π·οΈ--zipβ shove all the downloaded files into a ZIP archive ποΈ--cbzβ same energy but a CBZ archive, comic reader girlies rise π₯--mtime NAMEβ sets file modification times based on whatever metadata NAME picks out. Like'date'or'status[date]'π--rename FORMATβ renames files you already downloaded, going from FORMAT to whatever the current filename format is π--rename-to FORMATβ opposite direction bestie: from the current filename format over to FORMAT π«--ugoira FMTβ converts Pixiv Ugoira to FMT using FFmpeg. The supported formats are'webm','mp4','gif','vp8','vp9','vp9-lossless','copy','zip'β that's the whole list, no more, no less π¬--exec CMDβ runs CMD for every single downloaded file. The replacement fields you can use are{}or{_path},{_temppath},{_directory,{_filename}β wait no, it's{_directory},{_filename}ok phew π. On Windows, use{_path_unc}or{_directory_unc}for UNC paths. Example:--exec "convert {} {}.png && rm {}"π»--exec-after CMDβ runs CMD after all the files are downloaded. Example:--exec-after "cd {_directory} && convert * ../doc.pdf"π
πΈ EXAMPLES πΈ
So here's what it actually looks like in the wild, bestie:
gallery-dl URLβ downloads images from that URL. That's it. That's the whole vibe πgallery-dl -g -u <username> -p <password> URLβ prints the direct URLs from a site that needs you to log in first πgallery-dl --filter 'type == "ugoira"' --range '2-4' URLβ stacks a filter AND a range expression together. This one only downloads the second, third, and fourth file where the type value equals"ugoira"β¨gallery-dl r:URLβ scans that URL for other URLs and then invokes gallery-dl on each one it finds. Recursive queen πgallery-dl oauth:SITE-NAMEβ gets you OAuth authentication tokens fordeviantart,flickr,reddit,smugmug, andtumblr. Five sites, one little command, iconic π
π FILES π
The places it keeps its stuff:
/etc/gallery-dl.confβ the system wide configuration file. Everybody shares this one π«~/.config/gallery-dl/config.jsonβ your own personal per user configuration file πββοΈ~/.gallery-dl.confβ the alternate per user configuration file, for when you're feeling different π
π BUGS π
Found something broken? Not me being dramatic but please tell the devs, they want to know fr fr:
π AUTHORS π
- Mike FΓ€hrmann
<mike_faehrmann@web.de> - and
https://github.com/mikf/gallery-dl/graphs/contributorsβ the whole squad, we love them π«Ά
π SEE ALSO π
gallery-dl.conf(5)β go read it bestie, it's the config page, it's giving lore π
okay that's the whole page, you made it to the end, I'm so proud of you π₯Ή this was GALLERY-DL(1), version 1.32.14, dated 2026-09-27 β screenshot it, bookmark it, tattoo it, whatever, just remember it π now go download something gorgeous, mwah π β¨
π¦ where this page comes from
- ubuntu stonking: gallery-dl 1.32.14-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms