aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/postprocessor
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-03-01 19:51:39 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2025-03-01 19:51:39 -0500
commit889c7b8caec8fc0b9c7a583ed1d9cfa43518fc42 (patch)
treecff4a7de7032843e4efe521d92dfce485ae944f1 /gallery_dl/postprocessor
parenta26df18796ff4e506b16bf32fcec9336233b9e2e (diff)
New upstream version 1.29.0.upstream/1.29.0
Diffstat (limited to 'gallery_dl/postprocessor')
-rw-r--r--gallery_dl/postprocessor/common.py19
-rw-r--r--gallery_dl/postprocessor/compare.py4
-rw-r--r--gallery_dl/postprocessor/ugoira.py8
3 files changed, 16 insertions, 15 deletions
diff --git a/gallery_dl/postprocessor/common.py b/gallery_dl/postprocessor/common.py
index a9143a6..3099547 100644
--- a/gallery_dl/postprocessor/common.py
+++ b/gallery_dl/postprocessor/common.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2018-2023 Mike Fährmann
+# Copyright 2018-2025 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -8,7 +8,7 @@
"""Common classes and constants used by postprocessor modules."""
-from .. import util, formatter, archive
+from .. import archive
class PostProcessor():
@@ -25,11 +25,11 @@ class PostProcessor():
archive_path = options.get("archive")
if archive_path:
extr = job.extractor
- archive_path = util.expand_path(archive_path)
+ archive_table = options.get("archive-table")
archive_prefix = options.get("archive-prefix")
if archive_prefix is None:
- archive_prefix = extr.category
+ archive_prefix = extr.category if archive_table is None else ""
archive_format = options.get("archive-format")
if archive_format is None:
@@ -38,13 +38,14 @@ class PostProcessor():
archive_format = prefix + extr.archive_fmt
try:
- if "{" in archive_path:
- archive_path = formatter.parse(archive_path).format_map(
- job.pathfmt.kwdict)
- self.archive = archive.DownloadArchive(
+ self.archive = archive.connect(
archive_path,
- archive_prefix + archive_format,
+ archive_prefix,
+ archive_format,
+ archive_table,
+ "file",
options.get("archive-pragma"),
+ job.pathfmt.kwdict,
"_archive_" + self.name,
)
except Exception as exc:
diff --git a/gallery_dl/postprocessor/compare.py b/gallery_dl/postprocessor/compare.py
index 3bb63c8..c6bc54d 100644
--- a/gallery_dl/postprocessor/compare.py
+++ b/gallery_dl/postprocessor/compare.py
@@ -9,7 +9,7 @@
"""Compare versions of the same file and replace/enumerate them on mismatch"""
from .common import PostProcessor
-from .. import text, util, exception
+from .. import text, util, output, exception
import os
@@ -83,7 +83,7 @@ class ComparePP(PostProcessor):
self._equal_cnt += 1
if self._equal_cnt >= self._equal_max:
util.remove_file(pathfmt.temppath)
- print()
+ output.stderr_write("\n")
raise self._equal_exc()
pathfmt.delete = True
diff --git a/gallery_dl/postprocessor/ugoira.py b/gallery_dl/postprocessor/ugoira.py
index fec4ab0..3a32b39 100644
--- a/gallery_dl/postprocessor/ugoira.py
+++ b/gallery_dl/postprocessor/ugoira.py
@@ -9,7 +9,7 @@
"""Convert Pixiv Ugoira to WebM"""
from .common import PostProcessor
-from .. import util
+from .. import util, output
import subprocess
import tempfile
import zipfile
@@ -226,13 +226,13 @@ class UgoiraPP(PostProcessor):
if self._finalize:
self._finalize(pathfmt, tempdir)
except OSError as exc:
- print()
+ output.stderr_write("\n")
self.log.error("Unable to invoke FFmpeg (%s: %s)",
exc.__class__.__name__, exc)
self.log.debug("", exc_info=exc)
pathfmt.realpath = pathfmt.temppath
except Exception as exc:
- print()
+ output.stderr_write("\n")
self.log.error("%s: %s", exc.__class__.__name__, exc)
self.log.debug("", exc_info=exc)
pathfmt.realpath = pathfmt.temppath
@@ -296,7 +296,7 @@ class UgoiraPP(PostProcessor):
out = None if self.output else subprocess.DEVNULL
retcode = util.Popen(args, stdout=out, stderr=out).wait()
if retcode:
- print()
+ output.stderr_write("\n")
self.log.error("Non-zero exit status when running %s (%s)",
args, retcode)
raise ValueError()