mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 01:02:48 +01:00
Make duration_string
and resolution
available in --match-filter
Related: #1309
This commit is contained in:
parent
18f96d129b
commit
239df02103
@ -2177,6 +2177,9 @@ def sanitize_numeric_fields(info):
|
|||||||
if info_dict.get('display_id') is None and 'id' in info_dict:
|
if info_dict.get('display_id') is None and 'id' in info_dict:
|
||||||
info_dict['display_id'] = info_dict['id']
|
info_dict['display_id'] = info_dict['id']
|
||||||
|
|
||||||
|
if info_dict.get('duration') is not None:
|
||||||
|
info_dict['duration_string'] = formatSeconds(info_dict['duration'])
|
||||||
|
|
||||||
for ts_key, date_key in (
|
for ts_key, date_key in (
|
||||||
('timestamp', 'upload_date'),
|
('timestamp', 'upload_date'),
|
||||||
('release_timestamp', 'release_date'),
|
('release_timestamp', 'release_date'),
|
||||||
@ -2295,10 +2298,10 @@ def is_wellformed(f):
|
|||||||
res=self.format_resolution(format),
|
res=self.format_resolution(format),
|
||||||
note=format_field(format, 'format_note', ' (%s)'),
|
note=format_field(format, 'format_note', ' (%s)'),
|
||||||
)
|
)
|
||||||
# Automatically determine protocol if missing (useful for format
|
|
||||||
# selection purposes)
|
|
||||||
if format.get('protocol') is None:
|
if format.get('protocol') is None:
|
||||||
format['protocol'] = determine_protocol(format)
|
format['protocol'] = determine_protocol(format)
|
||||||
|
if format.get('resolution') is None:
|
||||||
|
format['resolution'] = self.format_resolution(format, default=None)
|
||||||
# Add HTTP headers, so that external programs can use them from the
|
# Add HTTP headers, so that external programs can use them from the
|
||||||
# json output
|
# json output
|
||||||
full_format_info = info_dict.copy()
|
full_format_info = info_dict.copy()
|
||||||
|
Loading…
Reference in New Issue
Block a user