diff options
| author | 2020-04-14 18:18:40 -0400 | |
|---|---|---|
| committer | 2020-04-14 18:18:40 -0400 | |
| commit | cf188f30e1c27bdb900fa2623a9ff91b944633b2 (patch) | |
| tree | 94803cd79aa8aaefd09d9bbc7b9c8029b415c885 /gallery_dl/util.py | |
| parent | e4887ae6b00c50fbbde531cc274c77b076bd821d (diff) | |
New upstream version 1.13.4upstream/1.13.4
Diffstat (limited to 'gallery_dl/util.py')
| -rw-r--r-- | gallery_dl/util.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gallery_dl/util.py b/gallery_dl/util.py index 47fad9e..83cf84b 100644 --- a/gallery_dl/util.py +++ b/gallery_dl/util.py @@ -840,16 +840,15 @@ class PathFormat(): shutil.copyfile(self.temppath, self.realpath) os.unlink(self.temppath) - if "_mtime" in self.kwdict: + mtime = self.kwdict.get("_mtime") + if mtime: # Set file modification time - mtime = self.kwdict["_mtime"] - if mtime: - try: - if isinstance(mtime, str): - mtime = mktime_tz(parsedate_tz(mtime)) - os.utime(self.realpath, (time.time(), mtime)) - except Exception: - pass + try: + if isinstance(mtime, str): + mtime = mktime_tz(parsedate_tz(mtime)) + os.utime(self.realpath, (time.time(), mtime)) + except Exception: + pass class DownloadArchive(): |
