From 81df42103e40ef3c0df9ee4c63c93db081c678da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 22 Aug 2025 22:32:46 +0200 Subject: [PATCH] [dl:ytdl] handle exceptions when processing playlists (#8085) and prevent calling 'process_info()' with empty playlist entries --- gallery_dl/downloader/ytdl.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gallery_dl/downloader/ytdl.py b/gallery_dl/downloader/ytdl.py index 9659782c..c236f91a 100644 --- a/gallery_dl/downloader/ytdl.py +++ b/gallery_dl/downloader/ytdl.py @@ -172,11 +172,19 @@ class YoutubeDLDownloader(DownloaderBase): pathfmt.build_path() self._set_outtmpl(ytdl_instance, pathfmt.realpath) + status = False for entry in info_dict["entries"]: + if not entry: + continue if self.rate_dyn is not None: ytdl_instance.params["ratelimit"] = self.rate_dyn() - ytdl_instance.process_info(entry) - return True + try: + ytdl_instance.process_info(entry) + status = True + except Exception as exc: + self.log.debug("", exc_info=exc) + self.log.error("%s: %s", exc.__class__.__name__, exc) + return status def _extract_info(self, ytdl, url): return ytdl.extract_info(url, download=False)