mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
Don’t try to merge the formats if ffmpeg or avconv are not installed
This commit is contained in:
parent
a9f53ce7ea
commit
58c3c7ae38
1 changed files with 9 additions and 1 deletions
|
@ -908,6 +908,14 @@ def dl(name, info):
|
||||||
if info_dict.get('requested_formats') is not None:
|
if info_dict.get('requested_formats') is not None:
|
||||||
downloaded = []
|
downloaded = []
|
||||||
success = True
|
success = True
|
||||||
|
merger = FFmpegMergerPP(self)
|
||||||
|
if not merger._get_executable():
|
||||||
|
postprocessors = []
|
||||||
|
self.report_warning('You have requested multiple '
|
||||||
|
'formats but ffmpeg or avconv are not installed.'
|
||||||
|
' The formats won\'t be merged')
|
||||||
|
else:
|
||||||
|
postprocessors = [merger]
|
||||||
for f in info_dict['requested_formats']:
|
for f in info_dict['requested_formats']:
|
||||||
new_info = dict(info_dict)
|
new_info = dict(info_dict)
|
||||||
new_info.update(f)
|
new_info.update(f)
|
||||||
|
@ -916,7 +924,7 @@ def dl(name, info):
|
||||||
downloaded.append(fname)
|
downloaded.append(fname)
|
||||||
partial_success = dl(fname, new_info)
|
partial_success = dl(fname, new_info)
|
||||||
success = success and partial_success
|
success = success and partial_success
|
||||||
info_dict['__postprocessors'] = [FFmpegMergerPP(self)]
|
info_dict['__postprocessors'] = postprocessors
|
||||||
info_dict['__files_to_merge'] = downloaded
|
info_dict['__files_to_merge'] = downloaded
|
||||||
else:
|
else:
|
||||||
# Just a single file
|
# Just a single file
|
||||||
|
|
Loading…
Reference in a new issue