diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index f7fc828ef..d12131acd 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -2908,6 +2908,8 @@ def download_with_info_file(self, info_filename): @staticmethod def sanitize_info(info_dict, remove_private_keys=False): ''' Sanitize the infodict for converting to json ''' + if info_dict is None: + return info_dict info_dict.setdefault('epoch', int(time.time())) remove_keys = {'__original_infodict'} # Always remove this since this may contain a copy of the entire dict keep_keys = ['_type'], # Always keep this to facilitate load-info-json