mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-20 05:47:24 +01:00
Do not pass -map -0:s
multiple times
This commit is contained in:
parent
0cc0f3f086
commit
4aa3c401d4
@ -662,13 +662,17 @@ def run(self, info):
|
|||||||
|
|
||||||
opts = [*self.stream_copy_opts(ext=info['ext'])]
|
opts = [*self.stream_copy_opts(ext=info['ext'])]
|
||||||
|
|
||||||
|
if sub_langs and sub_names:
|
||||||
|
# We have regular subtitles available to embed. Don't copy the
|
||||||
|
# existing subtitles, we may be running the postprocessor a second
|
||||||
|
# time.
|
||||||
|
opts.extend([
|
||||||
|
'-map', '-0:s',
|
||||||
|
])
|
||||||
|
|
||||||
for i, (lang, name) in enumerate(zip(sub_langs, sub_names)):
|
for i, (lang, name) in enumerate(zip(sub_langs, sub_names)):
|
||||||
lang_code = ISO639Utils.short2long(lang) or lang
|
lang_code = ISO639Utils.short2long(lang) or lang
|
||||||
opts.extend([
|
opts.extend([
|
||||||
# Don't copy the existing subtitles, we may be running the
|
|
||||||
# postprocessor a second time
|
|
||||||
'-map', '-0:s',
|
|
||||||
|
|
||||||
'-map', f'{i + 1}:0',
|
'-map', f'{i + 1}:0',
|
||||||
f'-metadata:s:s:{i}', f'language={lang_code}',
|
f'-metadata:s:s:{i}', f'language={lang_code}',
|
||||||
])
|
])
|
||||||
|
Loading…
Reference in New Issue
Block a user