]> jfr.im git - yt-dlp.git/commitdiff
Fix `--print` with `--ignore-no-formats` when url is `None` (#3000)
authorMMM <redacted>
Wed, 9 Mar 2022 21:12:23 +0000 (22:12 +0100)
committerGitHub <redacted>
Wed, 9 Mar 2022 21:12:23 +0000 (13:12 -0800)
Authored by: flashdagger

yt_dlp/YoutubeDL.py

index 3ee3ed7d2b2e28354f54de459e281ee00f739d63..355369c21b45af3677fd4ba1529777e50b7425f7 100644 (file)
@@ -2777,7 +2777,7 @@ def print_optional(field):
         if info_dict.get('requested_formats') is not None:
             # For RTMP URLs, also include the playpath
             info_dict['urls'] = '\n'.join(f['url'] + f.get('play_path', '') for f in info_dict['requested_formats'])
-        elif 'url' in info_dict:
+        elif info_dict.get('url'):
             info_dict['urls'] = info_dict['url'] + info_dict.get('play_path', '')
 
         if (self.params.get('forcejson')