ensure info_dict contains formats before passing to yt-dlp
This commit is contained in:
parent
e59ed7c200
commit
4f8194417d
1 changed files with 4 additions and 0 deletions
|
|
@ -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.'
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue