diff options
| author | 2025-05-26 06:45:53 -0400 | |
|---|---|---|
| committer | 2025-05-26 06:45:53 -0400 | |
| commit | 7672a750cb74bf31e21d76aad2776367fd476155 (patch) | |
| tree | d51170cce0e6d11a919386def8fa0e05dc9cf54b /gallery_dl/downloader | |
| parent | c679cd7a13bdbf6896e53d68fe2093910bc6625a (diff) | |
New upstream version 1.29.7.upstream/1.29.7
Diffstat (limited to 'gallery_dl/downloader')
| -rw-r--r-- | gallery_dl/downloader/http.py | 5 | ||||
| -rw-r--r-- | gallery_dl/downloader/ytdl.py | 19 |
2 files changed, 18 insertions, 6 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index faea9e5..c58e2fb 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -322,7 +322,10 @@ class HttpDownloader(DownloaderBase): self.downloading = False if self.mtime: - kwdict.setdefault("_mtime", response.headers.get("Last-Modified")) + if "_http_lastmodified" in kwdict: + kwdict["_mtime"] = kwdict["_http_lastmodified"] + else: + kwdict["_mtime"] = response.headers.get("Last-Modified") else: kwdict["_mtime"] = None diff --git a/gallery_dl/downloader/ytdl.py b/gallery_dl/downloader/ytdl.py index 7a20dc2..1fc2f82 100644 --- a/gallery_dl/downloader/ytdl.py +++ b/gallery_dl/downloader/ytdl.py @@ -130,18 +130,27 @@ class YoutubeDLDownloader(DownloaderBase): if pathfmt.exists(): pathfmt.temppath = "" return True - if self.part and self.partdir: - pathfmt.temppath = os.path.join( - self.partdir, pathfmt.filename) - - self._set_outtmpl(ytdl_instance, pathfmt.temppath.replace("%", "%%")) self.out.start(pathfmt.path) + if self.part: + pathfmt.kwdict["extension"] = pathfmt.prefix + "part" + filename = pathfmt.build_filename(pathfmt.kwdict) + pathfmt.kwdict["extension"] = info_dict["ext"] + if self.partdir: + path = os.path.join(self.partdir, filename) + else: + path = pathfmt.realdirectory + filename + else: + path = pathfmt.realpath + + self._set_outtmpl(ytdl_instance, path.replace("%", "%%")) try: ytdl_instance.process_info(info_dict) except Exception as exc: self.log.debug("", exc_info=exc) return False + + pathfmt.temppath = info_dict["filepath"] return True def _download_playlist(self, ytdl_instance, pathfmt, info_dict): |
