From 8cb7fc44db010e965d808ee679ef0725cb6e147c Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 30 Jul 2023 03:21:35 +0530 Subject: [PATCH] Fix `--check-formats` Bug in bc344cd456380999c1ee74554dfd432a38f32ec7 --- yt_dlp/YoutubeDL.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index c9cf07e53..6e8be40ba 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -2339,13 +2339,13 @@ class YoutubeDL: return new_dict def _check_formats(formats): - if (self.params.get('check_formats') is not None + if self.params.get('check_formats') == 'selected': + yield from self._check_formats(formats) + return + elif (self.params.get('check_formats') is not None or self.params.get('allow_unplayable_formats')): yield from formats return - elif self.params.get('check_formats') == 'selected': - yield from self._check_formats(formats) - return for f in formats: if f.get('has_drm'):