diff options
| author | 2020-09-28 18:27:52 -0400 | |
|---|---|---|
| committer | 2020-09-28 18:27:52 -0400 | |
| commit | 0d515b6f4c526758687c329b3a643ad845827d36 (patch) | |
| tree | f20f52694170f8274dce4f46dc1196eec278eaac /gallery_dl/postprocessor | |
| parent | 6ae34ce3013c0c2926556d139ea3397fb13756cd (diff) | |
| parent | 9074eee175f76b824fbb6695d56426105191c51c (diff) | |
Update upstream source from tag 'upstream/1.15.0'
Update to upstream version '1.15.0'
with Debian dir 7d11d19156690c131c977e4caeac73f32019dd58
Diffstat (limited to 'gallery_dl/postprocessor')
| -rw-r--r-- | gallery_dl/postprocessor/zip.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gallery_dl/postprocessor/zip.py b/gallery_dl/postprocessor/zip.py index 6970e95..a6e5bc3 100644 --- a/gallery_dl/postprocessor/zip.py +++ b/gallery_dl/postprocessor/zip.py @@ -33,23 +33,23 @@ class ZipPP(PostProcessor): algorithm) algorithm = "store" + self.zfile = None self.path = job.pathfmt.realdirectory - args = (self.path[:-1] + ext, "a", - self.COMPRESSION_ALGORITHMS[algorithm], True) + self.args = (self.path[:-1] + ext, "a", + self.COMPRESSION_ALGORITHMS[algorithm], True) if options.get("mode") == "safe": self.run = self._write_safe - self.zfile = None - self.args = args else: self.run = self._write - self.zfile = zipfile.ZipFile(*args) def _write(self, pathfmt, zfile=None): # 'NameToInfo' is not officially documented, but it's available # for all supported Python versions and using it directly is a lot # faster than calling getinfo() if zfile is None: + if self.zfile is None: + self.zfile = zipfile.ZipFile(*self.args) zfile = self.zfile if pathfmt.filename not in zfile.NameToInfo: zfile.write(pathfmt.temppath, pathfmt.filename) |
