[pp:metadata] add '"mode": "print"' (#2691)
https://github.com/mikf/gallery-dl/issues/2691#issuecomment-3276158980
This commit is contained in:
@@ -45,6 +45,15 @@ class MetadataPP(PostProcessor):
|
||||
cfmt = "\n".join(cfmt) + "\n"
|
||||
self._content_fmt = formatter.parse(cfmt).format_map
|
||||
ext = "txt"
|
||||
elif mode == "print":
|
||||
nl = "\n"
|
||||
if isinstance(cfmt, list):
|
||||
cfmt = f"{nl.join(cfmt)}{nl}"
|
||||
if cfmt[-1] != nl and (cfmt[0] != "\f" or cfmt[1] == "F"):
|
||||
cfmt = f"{cfmt}{nl}"
|
||||
self.write = self._write_custom
|
||||
self._content_fmt = formatter.parse(cfmt).format_map
|
||||
filename = "-"
|
||||
elif mode == "jsonl":
|
||||
self.write = self._write_json
|
||||
self._json_encode = self._make_encoder(options).encode
|
||||
|
||||
Reference in New Issue
Block a user