Fix attachments in subpaths

This commit is contained in:
Riteo 2024-09-08 13:22:18 +02:00
parent 7fb0c05ff6
commit 45d1f2bb6c
2 changed files with 5 additions and 2 deletions

View file

@ -1,6 +1,8 @@
# flake8: noqa: F401
# isort: off
from .demo import DemoIE
from .youtube import ( # Youtube is moved to the top to improve performance
YoutubeIE,
YoutubeClipIE,

View file

@ -673,11 +673,12 @@ def run(self, info):
for json_lang, json_filename in json_subs.items():
escaped_json_filename = self._ffmpeg_filename_argument(json_filename)
json_basename = os.path.basename(json_filename)
opts.extend([
'-map', f'-0:m:filename:{json_lang}.json?',
'-attach', escaped_json_filename,
f'-metadata:s:m:filename:{escaped_json_filename}', 'mimetype=application/json',
f'-metadata:s:m:filename:{escaped_json_filename}', f'filename={json_lang}.json',
f'-metadata:s:m:filename:{json_basename}', 'mimetype=application/json',
f'-metadata:s:m:filename:{json_basename}', f'filename={json_lang}.json',
])
temp_filename = prepend_extension(filename, 'temp')