0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-22 02:15:12 +00:00

Ensure _type is present in info.json

Closes #2447
This commit is contained in:
pukkandan 2022-01-24 01:01:30 +05:30
parent d37707bda4
commit 6a5a30f9e2
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -3211,6 +3211,7 @@ def sanitize_info(info_dict, remove_private_keys=False):
if info_dict is None: if info_dict is None:
return info_dict return info_dict
info_dict.setdefault('epoch', int(time.time())) info_dict.setdefault('epoch', int(time.time()))
info_dict.setdefault('_type', 'video')
remove_keys = {'__original_infodict'} # Always remove this since this may contain a copy of the entire dict 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 keep_keys = ['_type'] # Always keep this to facilitate load-info-json
if remove_private_keys: if remove_private_keys: