[pp:metadata] add 'metadata-path' option (#6582)

https://github.com/mikf/gallery-dl/issues/6582#issuecomment-2781643835
This commit is contained in:
Mike Fährmann
2025-04-09 20:24:14 +02:00
parent a1bf71d0bd
commit edd90fbf02
3 changed files with 25 additions and 0 deletions

View File

@@ -108,6 +108,7 @@ class MetadataPP(PostProcessor):
self.omode = options.get("open", omode)
self.encoding = options.get("encoding", "utf-8")
self.skip = options.get("skip", False)
self.meta_path = options.get("metadata-path")
def run(self, pathfmt):
archive = self.archive
@@ -120,6 +121,9 @@ class MetadataPP(PostProcessor):
directory = self._directory(pathfmt)
path = directory + self._filename(pathfmt)
if self.meta_path is not None:
pathfmt.kwdict[self.meta_path] = path
if self.skip and os.path.exists(path):
return