diff --git a/docs/configuration.rst b/docs/configuration.rst index d03dd2d5..3d0ba4a3 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1465,8 +1465,8 @@ Description Select how to write metadata. * ``"json"``: all metadata using `json.dump() `_ * ``"tags"``: ``tags`` separated by newlines - * ``"custom"``: result of applying `metadata.format`_ to a file's - metadata dictionary + * ``"custom"``: result of applying `metadata.content-format`_ + to a file's metadata dictionary =========== ===== metadata.extension @@ -1490,8 +1490,8 @@ Description Custom format string to build filename extensions for metadata Note: `metadata.extension`_ is ignored if this option is set. =========== ===== -metadata.format ---------------- +metadata.content-format +----------------------- =========== ===== Type ``string`` Example ``"tags:\n\n{tags:J\n}\n"`` diff --git a/gallery_dl/postprocessor/metadata.py b/gallery_dl/postprocessor/metadata.py index 20f47a15..75c5fffa 100644 --- a/gallery_dl/postprocessor/metadata.py +++ b/gallery_dl/postprocessor/metadata.py @@ -20,7 +20,8 @@ class MetadataPP(PostProcessor): mode = options.get("mode", "json") if mode == "custom": self.write = self._write_custom - self.contentfmt = util.Formatter(options.get("format")).format_map + cfmt = options.get("content-format") or options.get("format") + self.contentfmt = util.Formatter(cfmt).format_map ext = "txt" elif mode == "tags": self.write = self._write_tags