From 633ab0c56ffcda9bf2c5d5bb598023e1f7aa86eb Mon Sep 17 00:00:00 2001 From: Sacha Arnoud Date: Mon, 20 Sep 2021 14:33:30 +0000 Subject: [PATCH] json serialization bugs --- youtube_dl/YoutubeDL.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 02c36fb69..c6d906f13 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1771,7 +1771,7 @@ class YoutubeDL(object): self.to_stdout(formatSeconds(info_dict['duration'])) print_mandatory('format') if self.params.get('forcejson', False): - self.to_stdout(json.dumps(info_dict)) + self.to_stdout(json.dumps(info_dict, default=lambda _:'')) def process_info(self, info_dict): """Process a single resolved IE result.""" @@ -2076,7 +2076,7 @@ class YoutubeDL(object): raise else: if self.params.get('dump_single_json', False): - self.to_stdout(json.dumps(res)) + self.to_stdout(json.dumps(res, default=lambda _:'')) return self._download_retcode