aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/postprocessor/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/postprocessor/common.py')
-rw-r--r--gallery_dl/postprocessor/common.py19
1 files changed, 10 insertions, 9 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: