diff options
| author | 2025-05-26 06:46:00 -0400 | |
|---|---|---|
| committer | 2025-05-26 06:46:00 -0400 | |
| commit | 6424318a059207759b9055cf8a8df91c0ddac7c8 (patch) | |
| tree | 3fb8adec807ad1ffeba4889a506b05e680ca8051 /gallery_dl/downloader/ytdl.py | |
| parent | 2bef55427baa34bf0f78d52590bbf27b2c5f3a56 (diff) | |
| parent | 7672a750cb74bf31e21d76aad2776367fd476155 (diff) | |
Update upstream source from tag 'upstream/1.29.7'
Update to upstream version '1.29.7'
with Debian dir 264267cd1ebd5c7205fe1f137a394d0ae1a2fb3b
Diffstat (limited to 'gallery_dl/downloader/ytdl.py')
| -rw-r--r-- | gallery_dl/downloader/ytdl.py | 19 |
1 files changed, 14 insertions, 5 deletions
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): |
