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 # flake8: noqa: F401
# isort: off # isort: off
from .demo import DemoIE
from .youtube import ( # Youtube is moved to the top to improve performance from .youtube import ( # Youtube is moved to the top to improve performance
YoutubeIE, YoutubeIE,
YoutubeClipIE, YoutubeClipIE,

View File

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