### Logging Configuration Examples Source: https://gdl-org.github.io/docs/configuration.html Examples showing basic file logging settings and level-specific format definitions. ```json { "format" : "{asctime} {name}: {message}", "format-date": "%H:%M:%S", "path" : "~/log.txt", "encoding" : "ascii", "defer" : true } ``` ```json { "level" : "debug", "format": { "debug" : "debug: {message}", "info" : "[{name}] {message}", "warning": "Warning: {message}", "error" : "ERROR: {message}" } } ``` -------------------------------- ### Custom Output Format String Example Source: https://gdl-org.github.io/docs/configuration.html Specify a custom format string for the 'start' output message, including a number for shorten compatibility. ```json "start" : [12, "Downloading {}"] ``` -------------------------------- ### Postprocessor Configuration Examples Source: https://gdl-org.github.io/docs/configuration.html Examples of defining post-processors, including simple name-based configurations and those with specific options like filters and whitelists. ```json { "name": "mtime" } ``` ```json { "name" : "metadata/print@prepare", "format": "{id}: {date}" } ``` ```json { "name" : "zip", "compression": "store", "extension" : "cbz", "filter" : "extension not in ('zip', 'rar')", "whitelist" : ["mangadex", "pixiv"] } ``` -------------------------------- ### Custom Output Mode Configuration Source: https://gdl-org.github.io/docs/configuration.html Define custom output format strings for start, success, skip, progress, and progress-total messages. This example replicates 'color' mode. ```json { "start" : "{}", "success": "\r\u001b[1;32m{}[0m\n", "skip" : "\u001b[2m{}[0m\n", "progress" : "\r{0:>7}B {1:>7}B/s ", "progress-total": "\r{3:>3}% {0:>7}B {1:>7}B/s " } ``` -------------------------------- ### Base Directory Configuration Source: https://gdl-org.github.io/docs/configuration.html Examples of setting the base download directory using simple paths or conditional logic. ```json "~/Downloads/gallery-dl" ``` ```json { "score >= 100": "$DL", "duration" : "$DL/video", "" : "/tmp/files/" } ``` -------------------------------- ### Basic Replacement Field Examples Source: https://gdl-org.github.io/docs/formatting.html Common examples of simple replacement fields. ```text {title} ``` ```text {content!W} ``` ```text {date:Olocal/%Y%m%d %H%M} ``` -------------------------------- ### Filename Format Configuration Source: https://gdl-org.github.io/docs/configuration.html Examples of simple format strings and conditional objects for generating file names. ```json "{manga}_c{chapter}_{page:>03}.{extension}" ``` ```json { "extension == 'mp4'": "{id}_video.{extension}", "'nature' in title" : "{id}_{title}.{extension}", "" : "{id}_default.{extension}" } ``` -------------------------------- ### API Tokens & IDs Setup Source: https://gdl-org.github.io/docs/configuration.html Instructions for obtaining and configuring API tokens and IDs for various services. ```APIDOC ## extractor.deviantart.client-id & .client-secret ### Description API credentials for DeviantArt. ### Type string ### How To 1. Login and visit DeviantArt's Applications & Keys section. 2. Click "Register Application". 3. Scroll to "OAuth2 Redirect URI Whitelist (Required)" and enter "https://mikf.github.io/gallery-dl/oauth-redirect.html". 4. Scroll to the bottom and agree to the API License Agreement, Submission Policy, and Terms of Service. 5. Click "Save". 6. Copy `client_id` and `client_secret` of your new application and put them in your configuration file as "client-id" and "client-secret". 7. Clear your cache to delete any remaining access-token entries (e.g., `gallery-dl --clear-cache deviantart`). 8. Get a new refresh-token for the new client-id (e.g., `gallery-dl oauth:deviantart`). ## extractor.flickr.api-key & .api-secret ### Description API credentials for Flickr. ### Type string ### How To 1. Login and Create an App in Flickr's App Garden. 2. Click "APPLY FOR A NON-COMMERCIAL KEY". 3. Fill out the form with a random name and description and click "SUBMIT". 4. Copy Key and Secret and put them in your configuration file as "api-key" and "api-secret". ## extractor.mangadex.client-id & .client-secret ### Description API credentials for MangaDex. ### Type string ### How To 1. Login and go to your User Settings. 2. Open the "API Clients" section. 3. Click "+ Create". 4. Choose a name. 5. Click "✔️ Create". 6. Wait for approval / reload the page. 7. Copy the value after "AUTOAPPROVED ACTIVE" in the form "personal-client-..." and put it in your configuration file as "client-id". 8. Click "Get Secret", then "Copy Secret", and paste it into your configuration file as "client-secret". ## extractor.reddit.client-id & .user-agent ### Description API credentials and user-agent for Reddit. ### Type string ### How To 1. Login and visit the apps section of your account's preferences. 2. Click the "are you a developer? create an app..." button. 3. Fill out the form: - Choose a name. - Select "installed app". - Set "redirect uri" to `http://localhost:6414/`. - Solve the "I'm not a robot" challenge if needed. - Click "create app". 4. Copy the client id (third line, under your application's name and "installed app") and put it in your configuration file as "client-id". 5. Use "Python::v1.0 (by /u/)" as user-agent and replace `` and `` accordingly (see Reddit's API access rules). 6. Clear your cache to delete any remaining access-token entries (e.g., `gallery-dl --clear-cache reddit`). 7. Get a refresh-token for the new client-id (e.g., `gallery-dl oauth:reddit`). ``` -------------------------------- ### Configure Archive Storage Source: https://gdl-org.github.io/docs/configuration.html Examples of paths or connection URIs for storing downloaded file IDs in an archive. ```text * "$HOME/.archives/{category}.sqlite3" * "postgresql://user:pass@host/database" ``` -------------------------------- ### Define exec postprocessor configuration Source: https://gdl-org.github.io/docs/configuration.html Example structure for an exec postprocessor configuration object. ```json { "name" : "exec", "async" : false, "command": "...", "event" : "after" } ``` -------------------------------- ### List Keywords Command Source: https://gdl-org.github.io/docs/configuration.html Example output of the command-line tool used to inspect available keywords for a specific URL. ```bash $ gallery-dl -K http://seiga.nicovideo.jp/seiga/im5977527 Keywords for directory names: ----------------------------- category seiga subcategory image Keywords for filenames: ----------------------- category seiga extension None image-id 5977527 subcategory image ``` -------------------------------- ### Configure Postprocessor Chain Source: https://gdl-org.github.io/docs/configuration.html Specify a list of postprocessors to apply to downloaded files. This example shows a 'zip' postprocessor with 'store' compression and an 'exec' postprocessor that runs a script with dynamic arguments. ```json [ { "name": "zip" , "compression": "store" }, { "name": "exec", "command": ["/home/foobar/script", "{category}", "{image_id}"] } ] ``` -------------------------------- ### Directory Path Configuration Source: https://gdl-org.github.io/docs/configuration.html Examples of defining directory paths using lists of format strings or conditional objects. ```json ["{category}", "{manga}", "c{chapter} - {title}"] ``` ```json { "'nature' in content": ["Nature Pictures"], "retweet_id != 0" : ["{category}", "{user[name]}", "Retweets"], "" : ["{category}", "{user[name]}"] } ``` -------------------------------- ### Set Additional Postprocessor Options Source: https://gdl-org.github.io/docs/configuration.html Provide additional options for postprocessors. This example sets 'archive' to null and 'keep-files' to true, which can influence how postprocessors behave. ```json { "archive": null, "keep-files": true } ``` -------------------------------- ### Ugoira FFmpeg Arguments Example Source: https://gdl-org.github.io/docs/configuration.html Provide additional command-line arguments for FFmpeg when processing Ugoira files. This is useful for fine-tuning video encoding parameters. ```json [ "-c:v", "libvpx-vp9", "-an", "-b:v", "2M" ] ``` -------------------------------- ### Getting current date and time Source: https://gdl-org.github.io/docs/formatting.html Format the current local date and time. ```python {_now:%Y-%m} ``` -------------------------------- ### Access Metadata with Field Names Source: https://gdl-org.github.io/docs/formatting.html Examples of accessing metadata using various field name techniques. ```text {title} ``` ```text {title[6]} ``` ```text {title[3:8]} ``` ```text {title_ja[b3:18]} ``` ```text {empty|title} ``` ```text {extractor.url} ``` ```text {user[name]} ``` ```text {user['name']} ``` ```text {title[24]|empty|extractor.url[15:-1]} ``` -------------------------------- ### Configure Extractor Blacklist and Whitelist Source: https://gdl-org.github.io/docs/configuration.html Example configuration for ignoring or allowing child extractors based on identifiers. ```json ["imgur", "redgifs:user", "*:image"] ``` -------------------------------- ### Ugoira mkvmerge Arguments Example Source: https://gdl-org.github.io/docs/configuration.html Specify additional command-line arguments for mkvmerge when used for Ugoira processing. This allows customization of the merging process. ```json [ "--no-date", "--disable-lacing" ] ``` -------------------------------- ### Configure Standard Stream Encoding Source: https://gdl-org.github.io/docs/configuration.html Set the encoding for a standard stream. This example configures UTF-8 encoding with error replacement. ```string "utf-8" ``` -------------------------------- ### Follow URLs with Format String Source: https://gdl-org.github.io/docs/configuration.html Specify a format string to extract URLs and process them with child extractors. Example uses curly braces for content and \fE for body/html/text. ```text * "{content}" * "\fE body or html or text" ``` -------------------------------- ### Define Tag List Comments Source: https://gdl-org.github.io/docs/configuration.html Example of using comments within a tag list file. ```text # this is a comment ``` -------------------------------- ### Apply Conversion Specifiers Source: https://gdl-org.github.io/docs/formatting.html Examples of using single-character conversion specifiers to transform values. ```text {foo!l} ``` ```text {foo!u} ``` ```text {foo!c} ``` ```text {foo!C} ``` ```text {foo!g} ``` ```text {tags!j} ``` ```text {lang!L} ``` ```text {foo!n} ``` ```text {space!W} ``` ```text {bar!t} ``` ```text {date!T} ``` ```text {created!d} ``` ```text {created!D} ``` ```text {jpn!q} ``` ```text {jpn_url!Q} ``` ```text {html!U} ``` ```text {html!H} ``` ```text {lorem!R} ``` ```text {tags!s} ``` ```text {tags!S} ``` -------------------------------- ### Add Custom Metadata Keywords Source: https://gdl-org.github.io/docs/configuration.html Include additional name-value pairs in metadata dictionaries. Example shows 'type' and 'type_id'. ```json {"type": "Pixel Art", "type_id": 123} ``` -------------------------------- ### Define Subconfiguration Files Source: https://gdl-org.github.io/docs/configuration.html List additional configuration files to be loaded. ```json ["~/cfg-twitter.json", "~/cfg-reddit.json"] ``` -------------------------------- ### exec.session Source: https://gdl-org.github.io/docs/configuration.html Determines whether subprocesses are started in a new session. ```APIDOC ## exec.session ### Description Start subprocesses in a new session. On Windows, this means passing CREATE_NEW_PROCESS_GROUP as a creationflags argument to subprocess.Popen On POSIX systems, this means enabling the start_new_session argument of subprocess.Popen to have it call setsid(). ### Type bool ### Default false ``` -------------------------------- ### GDL Expression Source: https://gdl-org.github.io/docs/configuration.html Defines what a GDL Expression is, its type, and provides examples. ```APIDOC ## Expression ### Description A Python Expression is a combination of values, variables, operators, and function calls that evaluate to a single value. ### Type `string` ### Reference * https://docs.python.org/3/reference/expressions.html ### Example ``` * "1 + 2 + 3" * "str(id) + '_' + title" * "' - '.join(tags[:3]) if tags else 'no tags'" ``` ``` -------------------------------- ### extractor.vk.offset Source: https://gdl-org.github.io/docs/configuration.html Sets a custom starting offset for paginating image results from VK. ```APIDOC ## extractor.vk.offset ### Description Custom offset starting value when paginating over image results. ### Type integer ### Default 0 ``` -------------------------------- ### Define Input Files Configuration Source: https://gdl-org.github.io/docs/configuration.html Specify additional input files using a list of paths. ```json ["~/urls.txt", "$HOME/input"] ``` -------------------------------- ### Postprocessor Configuration Source: https://gdl-org.github.io/docs/configuration.html Configure various postprocessing steps for downloaded files. ```APIDOC ## Postprocessor Configuration ### Description An object containing a "name" attribute specifying the post-processor type, as well as any of its options. It is possible to set a "filter" Condition similar to file-filter to only run a post-processor conditionally. It is possible set a "whitelist" or "blacklist" to only enable or disable a post-processor for the specified extractor categories. It is possible to specify a post-processor's mode & event as part of its name by adding /MODE & @EVENT. ### Parameters #### Request Body - **name** (string) - Required - The name of the post-processor. Can include mode and event, e.g., "metadata/jsonl@post". - **format** (string) - Optional - Format string for metadata postprocessor. - **compression** (string) - Optional - Compression method for zip postprocessor (e.g., "store"). - **extension** (string) - Optional - File extension for zip postprocessor (e.g., "cbz"). - **filter** (string) - Optional - Condition to filter when the postprocessor runs. - **whitelist** (array) - Optional - List of extractor categories to enable the postprocessor for. - **blacklist** (array) - Optional - List of extractor categories to disable the postprocessor for. ### Available Postprocessor Types - **actions**: Perform Action(s) - **classify**: Categorize files by filename extension - **compare**: Compare versions of the same file and replace/enumerate them on mismatch - **directory**: Reevaluate directory Format Strings - **exec**: Execute external commands - **hash**: Compute file hash digests - **metadata**: Write metadata to separate files - **mtime**: Set file modification time according to its metadata - **python**: Call Python functions - **rename**: Rename previously downloaded files - **ugoira**: Convert Pixiv Ugoira to WebM using FFmpeg - **zip**: Store files in a ZIP archive ### Request Example ```json { "name": "mtime" } ``` ```json { "name": "metadata/print@prepare", "format": "{id}: {date}" } ``` ```json { "name": "zip", "compression": "store", "extension": "cbz", "filter": "extension not in ('zip', 'rar')", "whitelist": ["mangadex", "pixiv"] } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "Postprocessor configuration updated successfully" } ``` ``` -------------------------------- ### Configure YouTubeDL Raw Options Source: https://gdl-org.github.io/docs/configuration.html Pass additional options directly to the YoutubeDL constructor. Refer to yt-dlp or youtube-dl documentation for available options. ```json { "quiet": true, "writesubtitles": true, "merge_output_format": "mkv" } ``` -------------------------------- ### Using template file with format string Source: https://gdl-org.github.io/docs/formatting.html Specify a path to a template file containing a regular format string. ```python \fT ~/.templates/booru.txt ``` -------------------------------- ### Configuration Options Source: https://gdl-org.github.io/docs/configuration.html Details on various configuration parameters for gallery-dl. ```APIDOC ## filters-environment ### Description Evaluate Expressions in a special environment preventing them from raising fatal exceptions. ### Type bool | string ### Default true ### Options - `true`: Wrap expressions in a try/except block; Evaluate expressions raising an exception as false. - `false` | `"raw"`: Do not wrap expressions in a special environment. - `"tryexcept"`: Wrap expressions in a try/except block; Evaluate expressions raising an exception as false. - `"defaultdict"`: Prevent exceptions when accessing undefined variables by using a defaultdict ## format-operator-dot ### Description In standard Format Strings, allow the dot operator . to function as a general access operator in addition to regular attribute access. ### Type bool ### Default true ### Usage - `obj.attribute` - `dict.fieldname` - `list.123` ## format-separator ### Description Character(s) used as argument separator in Format String format specifiers. ### Type string ### Default "/" ### Example Setting this option to "#" would allow a replacement operation to be Rold#new# instead of the default Rold/new/ ## input-files ### Description Additional input files. ### Type list of Path ### Example `["~/urls.txt", "$HOME/input"]` ## signals-ignore ### Description The list of signal names to ignore, i.e. set SIG_IGN as signal handler for. ### Type list of strings ### Example `["SIGTTOU", "SIGTTIN", "SIGTERM"]` ## signals-actions ### Description Action(s) to perform when a signal is received. ### Type object (signal → Action(s)) ### Example ```json { "SIGINT" : "flag download = stop", "SIGUSR1": [ "print Received SIGUSR1", "exec notify.sh", "exit 127" ] } ``` ## subconfigs ### Description Additional configuration files to load. ### Type list of Path ### Example `["~/cfg-twitter.json", "~/cfg-reddit.json"]` ## warnings ### Description The Warnings Filter action used for (urllib3) warnings. ### Type string ### Default "default" ``` -------------------------------- ### General Options Source: https://gdl-org.github.io/docs/options.html Basic configuration options for file naming, destination paths, and program information. ```APIDOC ## General Options ### Description Basic configuration options for file naming, destination paths, and program information. ### Parameters - **-h, --help** - Print help message and exit - **--version** - Print program version and exit - **-f, --filename** (string) - Filename format string - **-d, --destination** (path) - Target location for downloads - **-D, --directory** (path) - Exact location for downloads - **--restrict-filenames** (string) - Replace restricted characters (windows, windows+, unix, ascii, ascii+) - **--windows-filenames** - Force Windows-compatible filenames - **-X, --extractors** (path) - Load external extractors - **--compat** - Restore legacy category names ``` -------------------------------- ### Execute Multiple Commands in Succession Source: https://gdl-org.github.io/docs/configuration.html Provide a list of commands to be executed sequentially. Subsequent commands are skipped if a previous one fails (non-zero exit status). ```shell [ ["echo", "{user[account]}", "{id}"] ["magick", "convert" "{_path}", "\fF {_path.rpartition('.')[0]}.png"], "rm {}", ] ``` -------------------------------- ### Configure Manga chapter order Source: https://gdl-org.github.io/docs/configuration.html Control the order in which manga chapters are extracted. Set to true to start with the latest chapter. ```ini extractor.[manga-extractor].chapter-reverse = true ``` -------------------------------- ### Configure Hash Algorithms (String Format) Source: https://gdl-org.github.io/docs/configuration.html Specify hash algorithms and their corresponding field names as a comma-separated string. If the algorithm is omitted, the field name is used as the algorithm. ```ini "sha256:hash_sha,sha3_512:hash_sha3" ``` -------------------------------- ### Forwarding Parent Metadata to Children Source: https://gdl-org.github.io/docs/configuration.html Example of how parent metadata is forwarded to child extractors, nested under a specified field name like '_p_'. ```json { "id": "child-id", "_p_": {"id": "parent-id"} } ``` -------------------------------- ### Selection Options Source: https://gdl-org.github.io/docs/options.html Command-line options to control and filter downloads. ```APIDOC ## Selection Options ### Description Command-line options to control and filter downloads. ### Parameters #### Selection Options - **-A, --abort N[:TARGET]** (string) - 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' - **-T, --terminate N** (string) - Stop current & parent extractors and proceed with the next input URL after N consecutive file downloads were skipped. - **--filesize-min SIZE** (string) - Do not download files smaller than SIZE (e.g. 500k or 2.5M). - **--filesize-max SIZE** (string) - Do not download files larger than SIZE (e.g. 500k or 2.5M). - **--download-archive FILE** (string) - Record successfully downloaded files in FILE and skip downloading any file already in it. - **--date-before DATE** (string) - 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-after DATE** (string) - Process only posts created after this date. Stop extraction when an older post is encountered. - **--blacklist CATEGORIES** (string) - Ignore the given comma-separated category names or category:subcategory pairs when spawning child extractors for external URLs (e.g. 'pixiv', 'pixiv:user,*:artist'). - **--whitelist CATEGORIES** (string) - Allow only the given comma-separated category names or category:subcategory pairs to allow when spawning child extractors for external URLs. - **--tags-blacklist TAGS** (string) - 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-whitelist TAGS** (string) - Allow only posts tagged with at least one of the tags given as comma-separated list or path to a file containing them. - **--range RANGE** (string) - 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'). - **--post-range RANGE** (string) - Like '--range', but for posts. - **--child-range RANGE** (string) - Like '--range', but for child extractors handling manga chapters, external URLs, etc. - **--filter EXPR** (string) - 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')". - **--post-filter EXPR** (string) - Like '--filter', but for posts. - **--child-filter EXPR** (string) - Like '--filter', but for child extractors handling manga chapters, external URLs, etc. ``` -------------------------------- ### Configure Downloader Settings Source: https://gdl-org.github.io/docs/gallery-dl-example.conf Sets global download behavior such as rate limiting, retries, and module selection. ```json "downloader": { "#": "restrict download speed to 1 MB/s", "rate": "1M", "#": "show download progress indicator after 2 seconds", "progress": 2.0, "#": "retry failed downloads up to 3 times", "retries": 3, "#": "consider a download 'failed' after 8 seconds of inactivity", "timeout": 8.0, "#": "write '.part' files into a special directory", "part-directory": "/tmp/.download/", "#": "do not update file modification times", "mtime": false, "ytdl": { "#": "use yt-dlp instead of youtube-dl", "module": "yt_dlp" } } ``` -------------------------------- ### Path Restriction Character Mapping Source: https://gdl-org.github.io/docs/configuration.html Define custom replacements for invalid path characters. This example maps specific characters and ranges to their replacements. ```json {"/": "_", "+": "_+_", "({[": "(", "]})": ")", "a-z": "*"} ``` -------------------------------- ### Configure Proxies by Scheme Source: https://gdl-org.github.io/docs/configuration.html Specify different proxy servers for different schemes (e.g., http, https) or even for specific hosts. This allows for granular control over network connections. ```json { "http" : "http://10.10.1.10:3128", "https": "http://10.10.1.10:1080", "http://10.20.1.128": "http://10.10.1.10:5323" } ``` -------------------------------- ### Configure Output and Logging Source: https://gdl-org.github.io/docs/gallery-dl-example.conf Defines logging levels, ANSI formatting, and file output paths for logs and unsupported URLs. ```json "output": { "log": { "level": "info", "#": "use different ANSI colors for each log level", "format": { "debug" : "\u001b[0;37m{name}: {message}\u001b[0m", "info" : "\u001b[1;37m{name}: {message}\u001b[0m", "warning": "\u001b[1;33m{name}: {message}\u001b[0m", "error" : "\u001b[1;31m{name}: {message}\u001b[0m" } }, "#": "shorten filenames to fit into one terminal line", "#": "while also considering wider East-Asian characters", "shorten": "eaw", "#": "enable ANSI escape sequences on Windows", "ansi": true, "#": "write logging messages to a separate file", "logfile": { "path": "~/gallery-dl/log.txt", "mode": "w", "level": "debug" }, "#": "write unrecognized URLs to a separate file", "unsupportedfile": { "path": "~/gallery-dl/unsupported.txt", "mode": "a", "format": "{asctime} {message}", "format-date": "%Y-%m-%d-%H-%M-%S" } } ``` -------------------------------- ### Configure downloader file size limits Source: https://gdl-org.github.io/docs/configuration.html Set minimum and maximum file size limits for downloads. Accepts values with k, m, g, t, p suffixes (case-insensitive). ```ini downloader.*.filesize-min = "500k" downloader.*.filesize-max = "2.5M" ``` -------------------------------- ### Ugoira FFmpeg Cropping Filter Example Source: https://gdl-org.github.io/docs/configuration.html This option automatically adds a cropping filter to FFmpeg arguments when using libx264/libx265 encoders to prevent errors caused by odd dimensions. It ensures width and height are divisible by 2. ```json [ "-vf", "crop=iw-mod(iw\,2):ih-mod(ih\,2)" ] ``` -------------------------------- ### Define Exec Command with Arguments Source: https://gdl-org.github.io/docs/configuration.html Use a list to specify the program and its arguments. Format Strings are evaluated for each element. ```shell ["echo", "{user[account]}", "{id}"] ``` -------------------------------- ### Input Options Source: https://gdl-org.github.io/docs/options.html Options for specifying input sources and handling file-based URL lists. ```APIDOC ## Input Options ### Description Options for specifying input sources and handling file-based URL lists. ### Parameters - **-i, --input-file** (file) - Download URLs from file - **-I, --input-file-comment** (file) - Download URLs and comment them out after success - **-x, --input-file-delete** (file) - Download URLs and delete file after success - **--no-input** - Do not prompt for passwords/tokens ``` -------------------------------- ### Configure ytdl module and raw options Source: https://gdl-org.github.io/docs/configuration.html Specify the ytdl module to use and pass raw options directly to the YoutubeDL constructor. Useful for advanced customization of video/audio extraction. ```ini extractor.ytdl.module = "yt-dlp" extractor.ytdl.raw-options = { "quiet": true, "writesubtitles": true, "merge_output_format": "mkv" } ``` -------------------------------- ### Global Configuration Override Source: https://gdl-org.github.io/docs/configuration.html Shows how to define a global setting that overrides all other extractor-level values. ```json { "extractor": { "": "" }, "": "" } ``` -------------------------------- ### Actions and Postprocessors Source: https://gdl-org.github.io/docs/configuration.html Configuration for automated actions and post-processing tasks. ```APIDOC ## Actions and Postprocessors ### Description Define actions to perform based on log patterns and post-processing steps for downloaded files. ### Parameters - **extractor.*.actions** (object/list) - Optional - Perform an Action when logging a message matched by pattern. - **extractor.*.postprocessors** (object/list) - Optional - A list of post processors to be applied to each downloaded file. - **extractor.*.postprocessor-options** (object) - Optional - Additional options added to each post processor. ``` -------------------------------- ### Boosty Extractor Configuration Source: https://gdl-org.github.io/docs/configuration.html Settings for controlling Boosty post and video quality extraction. ```APIDOC ## Boosty Extractor Settings ### Parameters - **extractor.boosty.allowed** (bool) - Optional - Request only available posts. Default: true - **extractor.boosty.bought** (bool) - Optional - Request only purchased posts. Default: false - **extractor.boosty.videos** (bool/list) - Optional - Download videos. Supports format selection (e.g., 'full_hd', 'high'). ``` -------------------------------- ### Configure Standard Stream with Options Source: https://gdl-org.github.io/docs/configuration.html Reconfigure a standard stream with specific encoding, error handling, and line buffering options. ```json { "encoding": "utf-8", "errors": "replace", "line_buffering": true } ``` -------------------------------- ### Downloader Options Source: https://gdl-org.github.io/docs/options.html Configuration flags for controlling download behavior and file handling. ```APIDOC ## Downloader Options ### Parameters #### Query Parameters - **--limit-rate** (RATE) - Optional - Maximum download rate (e.g. 500k, 2.5M) - **--chunk-size** (SIZE) - Optional - Size of in-memory data chunks (default: 32k) - **--no-part** (flag) - Optional - Do not use .part files - **--no-skip** (flag) - Optional - Do not skip downloads; overwrite existing files - **--no-mtime** (flag) - Optional - Do not set file modification times - **--no-download** (flag) - Optional - Do not download any files ``` -------------------------------- ### Using Jinja templates Source: https://gdl-org.github.io/docs/formatting.html Format a value using a Jinja template. The template is evaluated in the context of the current metadata. ```python \fJ '{{title | trim}}' by {{artist | capitalize}} ``` -------------------------------- ### exec.commands Source: https://gdl-org.github.io/docs/configuration.html Specifies multiple commands to be run in succession. ```APIDOC ## exec.commands ### Description Multiple commands to run in succession. All commands after the first returning with a non-zero exit status will not be run. ### Type list of commands ### Example ``` [ ["echo", "{user[account]}", "{id}"] ["magick", "convert" "{_path}", "\fF {_path.rpartition('.')[0]}.png"], "rm {}", ] ``` ``` -------------------------------- ### ArtStation Extractor Configuration Source: https://gdl-org.github.io/docs/configuration.html Settings for controlling ArtStation media and search result extraction. ```APIDOC ## ArtStation Extractor Settings ### Parameters - **extractor.artstation.previews** (bool) - Optional - Download embed previews. Default: false - **extractor.artstation.videos** (bool) - Optional - Download video clips. Default: true - **extractor.artstation.search.pro-first** (bool) - Optional - Enable 'Show Studio and Pro member artwork first'. Default: true ``` -------------------------------- ### Chaining and combining format specifiers Source: https://gdl-org.github.io/docs/formatting.html Demonstrates chaining multiple gallery-dl format specifiers with standard Python format specifiers. ```python {foo:?//RF/B/Ro/e/> 10} ``` -------------------------------- ### Applying conversions with C Source: https://gdl-org.github.io/docs/formatting.html Apply one or more string conversions to the value. ```python {tags:CSgc/} ``` -------------------------------- ### compare.equal Source: https://gdl-org.github.io/docs/configuration.html Configures the action to take when files are found to be equal during comparison. ```APIDOC ## compare.equal ### Description The action to take when files do compare as equal. ### Options - "abort:N": Stop the current extractor run after N consecutive files compared as equal. - "terminate:N": Stop the current extractor run, including parent extractors, after N consecutive files compared as equal. - "exit:N": Exit the program after N consecutive files compared as equal. ### Type string ### Default "null" ``` -------------------------------- ### Configure SQLite PRAGMA Statements Source: https://gdl-org.github.io/docs/configuration.html A list of SQLite PRAGMA statements to be executed during archive initialization. This allows for fine-tuning SQLite behavior, such as journal modes or synchronous settings. ```json ["journal_mode=WAL", "synchronous=NORMAL"] ``` -------------------------------- ### Configure Postprocessors Source: https://gdl-org.github.io/docs/gallery-dl-example.conf Defines metadata extraction and media conversion tasks, including CBZ archiving and Ugoira transcoding. ```json "postprocessor": { "#": "write 'content' metadata into separate files", "content": { "name" : "metadata", "#": "write data for every post instead of each individual file", "event": "post", "filename": "{post_id|tweet_id|id}.txt", "#": "write only the values for 'content' or 'description", "mode" : "custom", "format": "{content|description}\n" }, "#": "put files into a '.cbz' archive", "cbz": { "name": "zip", "extension": "cbz" }, "#": "various ugoira post processor configurations to create different file formats", "ugoira-webm": { "name": "ugoira", "extension": "webm", "ffmpeg-args": ["-c:v", "libvpx-vp9", "-an", "-b:v", "0", "-crf", "30"], "ffmpeg-twopass": true, "ffmpeg-demuxer": "image2" }, "ugoira-mp4": { "name": "ugoira", "extension": "mp4", "ffmpeg-args": ["-c:v", "libx264", "-an", "-b:v", "4M", "-preset", "veryslow"], "ffmpeg-twopass": true, "libx264-prevent-odd": true }, "ugoira-gif": { "name": "ugoira", "extension": "gif", "ffmpeg-args": ["-filter_complex", "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse"] }, "ugoira-copy": { "name": "ugoira", "extension": "mkv", "ffmpeg-args": ["-c", "copy"], "libx264-prevent-odd": false, "repeat-last-frame": false } } ``` -------------------------------- ### Logging Configuration Source: https://gdl-org.github.io/docs/configuration.html Configure the extended logging output for GDL. ```APIDOC ## Logging Configuration ### Description Extended logging output configuration. ### Parameters #### Request Body - **format** (string | object) - Optional - General Format String for logging messages or an object with Format Strings for each loglevel. Default: "[{name}][{levelname}] {message}" for logfile, "{message}" for unsupportedfile and errorfile. - **format-date** (string) - Optional - Format string for {asctime} fields in logging messages. Default: "%Y-%m-%d %H:%M:%S". - **level** (string) - Optional - Minimum logging message level (one of "debug", "info", "warning", "error", "exception"). Default: "info". - **path** (string) - Optional - Path to the output file. - **mode** (string) - Optional - Mode in which the file is opened; use "w" to truncate or "a" to append. Default: "w" for logfile and unsupportedfile, "a" for errorfile. - **encoding** (string) - Optional - File encoding. Default: "utf-8". - **defer** (boolean) - Optional - Defer file opening/creation until writing the first logging message. Default: false for logfile, true for unsupportedfile and errorfile. ### Request Example ```json { "format": "{asctime} {name}: {message}", "format-date": "%H:%M:%S", "path": "~/log.txt", "encoding": "ascii", "defer": true } ``` ```json { "level": "debug", "format": { "debug": "debug: {message}", "info": "[{name}] {message}", "warning": "Warning: {message}", "error": "ERROR: {message}" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "Logging configuration updated successfully" } ``` ``` -------------------------------- ### downloader.ytdl Configuration Source: https://gdl-org.github.io/docs/configuration.html Configuration options for the YouTubeDL downloader module. ```APIDOC ## downloader.ytdl.deprecations ### Description Allow yt-dlp/youtube-dl to warn about deprecated options and features. ### Type `bool` ### Default `false` ``` ```APIDOC ## downloader.ytdl.format ### Description Specify the format selection string for yt-dlp/youtube-dl. ### Type `string` ### Default Default of the ytdl module used. ("bestvideo*+bestaudio/best" for yt_dlp, "bestvideo+bestaudio/best" for youtube_dl) ### See Also yt-dlp format selection / youtube-dl format selection ``` ```APIDOC ## downloader.ytdl.forward-cookies ### Description Forward gallery-dl's cookies to yt-dlp/youtube-dl. ### Type `bool` ### Default `true` ``` ```APIDOC ## downloader.ytdl.logging ### Description Route yt-dlp's/youtube-dl's output through gallery-dl's logging system. Otherwise, it will be written directly to stdout/stderr. ### Type `bool` ### Default `true` ### Note Set `quiet` and `no_warnings` in `downloader.ytdl.raw-options` to true to suppress all output. ``` ```APIDOC ## downloader.ytdl.module ### Description The ytdl Module to import. Setting this to null will try to import "yt_dlp" followed by "youtube_dl" as fallback. ### Type `Module` ### Default `null` ### Example ``` * "yt-dlp" * "/home/user/.local/lib/python3.13/site-packages/youtube_dl" ``` ``` ```APIDOC ## downloader.ytdl.outtmpl ### Description The Output Template used to generate filenames for files downloaded with ytdl. ### Type `string` ### Default `null` ### See Also yt-dlp output template / youtube-dl output template ### Special Values - `null`: generate filenames with `extractor.*.filename` - `"default"`: use yt-dlp's/youtube-dl's default, currently "% (title)s [% (id)s].%(ext)s" for yt_dlp / "% (title)s-% (id)s.%(ext)s" for youtube_dl ### Note An output template other than `null` might cause unexpected results in combination with certain options (e.g. `"skip": "enumerate"`) ``` ```APIDOC ## downloader.ytdl.raw-options ### Description Additional options passed directly to the YoutubeDL constructor. Available options can be found in yt-dlp's docstrings / youtube-dl's docstrings. ### Type `object (name → value)` ### Example ```json { "quiet": true, "writesubtitles": true, "merge_output_format": "mkv" } ``` ``` -------------------------------- ### Configure HTTP Proxy Source: https://gdl-org.github.io/docs/configuration.html Set a proxy server for all outgoing HTTP requests. If the scheme is omitted, http:// is assumed. ```shell "http://10.10.1.10:3128" ``` -------------------------------- ### exec.command Source: https://gdl-org.github.io/docs/configuration.html Defines the command to be executed. ```APIDOC ## exec.command ### Description The command to run. * If this is a string, it will be executed using the system's shell, e.g. /bin/sh. Any {} will be replaced with the full path of a file or target directory, depending on exec.event * If this is a list, the first element specifies the program name and any further elements its arguments. Each element of this list is evaluated as a Format String using the files' metadata as well as {_path}, {_temppath}, {_directory}, and {_filename}. ### Type string or list of strings ### Example ``` * "convert {} {}.png && rm {}" * ["echo", "{user[account]}", "{id}"] ``` ``` -------------------------------- ### Configure Zerochan file extensions Source: https://gdl-org.github.io/docs/configuration.html Define the list of filename extensions to attempt when building download URLs for Zerochan. This is useful when the API does not provide metadata. ```ini extractor.zerochan.extensions = ["webp", "gif", "jpg"] ``` -------------------------------- ### Using template file with Jinja Source: https://gdl-org.github.io/docs/formatting.html Specify a path to a template file containing a Jinja template. ```python \fTF ~/.templates/jinja.txt ``` -------------------------------- ### Extractor Initialization Options Source: https://gdl-org.github.io/docs/configuration.html Configuration options that control when and how the extractor initializes its internal components. ```APIDOC ## extractor.*.init ### Description Controls when to initialize extractor internals (postprocessors, archives, path-* options, etc). ### Type * bool * string ### Default `false` ### Values * `true`: Initialize everything immediately upon extractor start. * `false | "lazy"`: Initialize data structures when processing the first post or not at all when an extractor never yields a post. ``` -------------------------------- ### Define Exec Command with Shell Source: https://gdl-org.github.io/docs/configuration.html Use a string to execute a command via the system's shell. The '{}' placeholder is replaced with the file path. ```shell "convert {} {}.png && rm {}" ``` -------------------------------- ### Networking Options Source: https://gdl-org.github.io/docs/options.html Configuration flags for managing HTTP requests, proxies, and connection protocols. ```APIDOC ## Networking Options ### Parameters #### Query Parameters - **--retries** (N) - Optional - Maximum number of retries for failed HTTP requests or -1 for infinite retries (default: 4) - **--user-agent** (UA) - Optional - User-Agent request header - **--http-timeout** (SECONDS) - Optional - Timeout for HTTP connections (default: 30.0) - **--proxy** (URL) - Optional - Use the specified proxy - **--xff** (VALUE) - Optional - Use a fake 'X-Forwarded-For' HTTP header - **--source-address** (IP) - Optional - Client-side IP address to bind to - **--force-ipv4** (flag) - Optional - Make all connections via IPv4 - **--force-ipv6** (flag) - Optional - Make all connections via IPv6 - **--no-check-certificate** (flag) - Optional - Disable HTTPS certificate validation ``` -------------------------------- ### Extension Mapping Configuration Source: https://gdl-org.github.io/docs/configuration.html Map common image file extensions to a standard one, like 'jpg', for consistency. This helps in normalizing file types. ```json { "jpeg": "jpg", "jpe" : "jpg", "jfif": "jpg", "jif" : "jpg", "jfi" : "jpg" } ``` -------------------------------- ### Configure Manga page download order Source: https://gdl-org.github.io/docs/configuration.html Determine whether manga chapter pages are downloaded in reverse order. Set to true to download pages from last to first. ```ini extractor.[manga-extractor].page-reverse = true ``` -------------------------------- ### Configure downloader part file usage Source: https://gdl-org.github.io/docs/configuration.html Control the use of .part files during downloads. When enabled, downloads are written to .part files and renamed upon completion, supporting download resuming. ```ini downloader.*.part = false ``` -------------------------------- ### exec.error Source: https://gdl-org.github.io/docs/configuration.html Specifies actions to run when a command fails. ```APIDOC ## exec.error ### Description Run these Action(s) when command fails and returns with a non-zero exit status. ### Type Action(s) ```