mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-08-24 08:11:14 +02:00
[YoutubeDL] Autocalculate ext when ext is None
This commit is contained in:
parent
e25586e471
commit
5b1d85754e
@ -1299,7 +1299,7 @@ def process_video_result(self, info_dict, download=True):
|
|||||||
for subtitle_format in subtitle:
|
for subtitle_format in subtitle:
|
||||||
if subtitle_format.get('url'):
|
if subtitle_format.get('url'):
|
||||||
subtitle_format['url'] = sanitize_url(subtitle_format['url'])
|
subtitle_format['url'] = sanitize_url(subtitle_format['url'])
|
||||||
if 'ext' not in subtitle_format:
|
if subtitle_format.get('ext') is None:
|
||||||
subtitle_format['ext'] = determine_ext(subtitle_format['url']).lower()
|
subtitle_format['ext'] = determine_ext(subtitle_format['url']).lower()
|
||||||
|
|
||||||
if self.params.get('listsubtitles', False):
|
if self.params.get('listsubtitles', False):
|
||||||
@ -1354,7 +1354,7 @@ def process_video_result(self, info_dict, download=True):
|
|||||||
note=' ({0})'.format(format['format_note']) if format.get('format_note') is not None else '',
|
note=' ({0})'.format(format['format_note']) if format.get('format_note') is not None else '',
|
||||||
)
|
)
|
||||||
# Automatically determine file extension if missing
|
# Automatically determine file extension if missing
|
||||||
if 'ext' not in format:
|
if format.get('ext') is None:
|
||||||
format['ext'] = determine_ext(format['url']).lower()
|
format['ext'] = determine_ext(format['url']).lower()
|
||||||
# Automatically determine protocol if missing (useful for format
|
# Automatically determine protocol if missing (useful for format
|
||||||
# selection purposes)
|
# selection purposes)
|
||||||
|
Loading…
Reference in New Issue
Block a user