From 4f8194417d3dd8ab90006dedff45e63cb03ea877 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Thu, 24 Apr 2025 15:57:10 +0300 Subject: [PATCH] ensure info_dict contains formats before passing to yt-dlp --- app/library/Download.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/library/Download.py b/app/library/Download.py index 8dc44aeb..7b59098e 100644 --- a/app/library/Download.py +++ b/app/library/Download.py @@ -218,6 +218,10 @@ class Download: f"Live stream detected for '{self.info.title}', The following opts '{deletedOpts=}' have been deleted which are known to cause issues with live stream and post stream manifestless mode." ) + if isinstance(self.info_dict, dict) and len(self.info_dict.get("formats", [])) < 1: + msg = f"Failed to extract formats for '{self.info.url}'. The extracted info dict is empty." + raise ValueError(msg) # noqa: TRY301 + self.logger.info( f'Task id="{self.info.id}" PID="{os.getpid()}" title="{self.info.title}" preset="{self.preset}" cookies="{bool(params.get("cookiefile"))}" started.' )