aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/postprocessor
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-04-15 05:25:37 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-04-15 05:25:37 -0400
commitb830dc03b3b7c9dd119648e1be9c1145d56e096c (patch)
treee9d03b6b4ab93990243c0038c20ada2464fa4072 /gallery_dl/postprocessor
parent662e5ac868a5c1a3e7bc95b37054b3a0ca4db74f (diff)
New upstream version 1.29.4.upstream/1.29.4
Diffstat (limited to 'gallery_dl/postprocessor')
-rw-r--r--gallery_dl/postprocessor/metadata.py9
-rw-r--r--gallery_dl/postprocessor/ugoira.py7
2 files changed, 9 insertions, 7 deletions
diff --git a/gallery_dl/postprocessor/metadata.py b/gallery_dl/postprocessor/metadata.py
index 3ef9fbc..fbb3fb8 100644
--- a/gallery_dl/postprocessor/metadata.py
+++ b/gallery_dl/postprocessor/metadata.py
@@ -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
@@ -180,7 +184,10 @@ class MetadataPP(PostProcessor):
pathfmt.directory_formatters = self._directory_formatters
pathfmt.directory_conditions = ()
segments = pathfmt.build_directory(pathfmt.kwdict)
- directory = pathfmt.clean_path(os.sep.join(segments) + os.sep)
+ if segments:
+ directory = pathfmt.clean_path(os.sep.join(segments) + os.sep)
+ else:
+ directory = "." + os.sep
return os.path.join(self._base(pathfmt), directory)
finally:
pathfmt.directory_conditions = conditions
diff --git a/gallery_dl/postprocessor/ugoira.py b/gallery_dl/postprocessor/ugoira.py
index 3a32b39..c1bfc20 100644
--- a/gallery_dl/postprocessor/ugoira.py
+++ b/gallery_dl/postprocessor/ugoira.py
@@ -156,12 +156,7 @@ class UgoiraPP(PostProcessor):
return self.log.debug("", exc_info=exc)
if self.convert(pathfmt, tempdir):
- if self.delete:
- pathfmt.delete = True
- elif pathfmt.extension != "zip":
- self.log.info(pathfmt.filename)
- pathfmt.set_extension("zip")
- pathfmt.build_path()
+ pathfmt.delete = self.delete
def convert_from_files(self, pathfmt):
if not self._convert_files: