Skip to content

Extractors

Keys inside plugin.json's extractors[] array. See Register a metadata reader.

extractors[].exts

string[]Default: []

Lowercase file extensions without leading dots (for example ["png", "webp"]) that this extractor processes. When omitted, extractors with only png_text or regex default to ["png"]; command, json and page extractors match all extensions.

extractors[].png_text

Record<string, string>Default: {} · Zero permissions

Map of PNG text chunk keyword (tEXt, zTXt or iTXt) to target field key.

extractors[].regex

object[]Default: [] · Zero permissions

Regular expression rules extracting the first capture group from named PNG text chunks.

extractors[].command

string[]Default: [] · Requires files.read + exec

Executable and arguments (for example ["python", "read.py", "{input}", "{parts}"]) printing a flat JSON object of field values to stdout (30 s timeout). Relative executable paths resolve against the plugin folder.

extractors[].json

object | nullDefault: null · Zero permissions

Declarative JSON Pointer extraction over a grouped companion file (up to 8 MB).

extractors[].page

string | nullDefault: null · Requires files.read

Relative path to a hidden HTML extractor page served from the plugin's origin (plugin:// on Linux and macOS, http://plugin.<id>.localhost/ on Windows) that handles plugin.extract via curio.extractDone (60 s timeout).

extractors[].id

string | nullDefault: "x<index>"

Short reader identifier forming <plugin_id>/<id> in Field.readers, field.failures and plugin.extract. When omitted, Curio assigns x1, x2 and so on by position.

extractors[].version

integerDefault: 0

Reader version number. Incrementing version triggers a one-time automatic rescan of matching files per library.

extractors[].fields

string[]Default: []

Declared output field keys populated by this extractor. Required for page extractors and recommended for command extractors so fields that are no longer returned are cleared on rescan.

extractors[].json.role

stringRequired inside json

Companion role (declared in formats[].companions) to search for the JSON file (for example "metadata").

extractors[].json.file

stringDefault: ""

Case-insensitive filename suffix filter matching the first companion of role whose name ends with file (for example ".civitai.info").

extractors[].json.fields

Record<string, string>Required inside json

Map of output field key (or __title, __annotation or __source_url to fill empty item metadata) to RFC 6901 JSON Pointer (for example "/civitai/trainedWords").

extractors[].regex[].chunk

stringRequired inside regex[]

PNG text chunk keyword to search (for example "parameters").

extractors[].regex[].pattern

stringRequired inside regex[]

Regular expression whose first capture group becomes the extracted field value.

extractors[].regex[].field

stringRequired inside regex[]

Target field key receiving the captured string.