[YoutubeDL] Do not write requested info in info JSON file (Closes #5562, closes ...
authorSergey M․ <dstftw@gmail.com>
Thu, 30 Apr 2015 17:55:05 +0000 (23:55 +0600)
committerSergey M․ <dstftw@gmail.com>
Thu, 30 Apr 2015 17:55:05 +0000 (23:55 +0600)
youtube_dl/YoutubeDL.py

index 9d4a2dce88da5c57c079a822bab56207f9e85638..e747c6892dcb4bc712a112f2a439551f91e591be 100755 (executable)
@@ -1337,8 +1337,11 @@ class YoutubeDL(object):
                 self.to_screen('[info] Video description metadata is already present')
             else:
                 self.to_screen('[info] Writing video description metadata as JSON to: ' + infofn)
+                filtered_info_dict = dict(
+                    (k, v) for k, v in info_dict.items()
+                    if not k in ['requested_formats', 'requested_subtitles'])
                 try:
-                    write_json_file(info_dict, infofn)
+                    write_json_file(filtered_info_dict, infofn)
                 except (OSError, IOError):
                     self.report_error('Cannot write metadata to JSON file ' + infofn)
                     return