Skip to content

Use a configuration file

Save settings in JSON and pass --config to reuse them. This example uses an installed CopyManga extension.

Create ./profiles/copymanga.json:

{
"version": 1,
"source": "copymanga",
"output": "./manga",
"jobs": 2,
"retries": 2
}

version must be the number 1. For source, use an ID from comic-dl sources. jobs controls chapter concurrency, and retries controls the number of additional attempts after a transient error. Extensions installed with add load automatically, so you don’t need to list them in this file.

Run these commands from the parent directory of profiles/:

终端窗口
comic-dl l xiangkanbaitiantongxuederuanruobiaoqing --config ./profiles/copymanga.json
comic-dl d xiangkanbaitiantongxuederuanruobiaoqing --config ./profiles/copymanga.json -c 2-4

The CLI does not look for a config file automatically; pass --config each time. A relative output path in JSON is resolved from the directory containing the config file, so this writes to ./profiles/manga/. With no output directory set in the CLI or config, download writes to the current working directory.

An output path like "~/manga" instead starts at your home directory.

终端窗口
comic-dl d xiangkanbaitiantongxuederuanruobiaoqing --config ./profiles/copymanga.json -c 2-4 -o ./preview --jobs 1

CLI options take precedence and do not rewrite the config file. Relative paths passed on the command line start at the current working directory, so this writes to ./preview/ instead of ./profiles/preview/. You can also override the default source with --source.

Keep separate config files for different sources or output directories. Set cookies and API keys as directed by the extension’s README. See configuration and environment variables for all supported settings.