[postprocessor/EmbedThumbnail,postprocessor/FFmpegMetadata] Fix error on attaching thumbnails and info json for mkv/mka (#6647)

Authored by: Lesmiscore

Current yt-dlp code never hit this bug, but would hit once filename sanitization gets better
This commit is contained in:
Lesmiscore 2023-03-28 01:17:42 +09:00 committed by GitHub
parent 95a383be1b
commit 0f0875ed55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -107,7 +107,7 @@ def run(self, info):
options.extend(['-map', '-0:%d' % old_stream]) options.extend(['-map', '-0:%d' % old_stream])
new_stream -= 1 new_stream -= 1
options.extend([ options.extend([
'-attach', thumbnail_filename, '-attach', self._ffmpeg_filename_argument(thumbnail_filename),
'-metadata:s:%d' % new_stream, 'mimetype=%s' % mimetype, '-metadata:s:%d' % new_stream, 'mimetype=%s' % mimetype,
'-metadata:s:%d' % new_stream, 'filename=cover.%s' % thumbnail_ext]) '-metadata:s:%d' % new_stream, 'filename=cover.%s' % thumbnail_ext])

View file

@ -809,7 +809,7 @@ def _get_infojson_opts(self, info, infofn):
new_stream -= 1 new_stream -= 1
yield ( yield (
'-attach', infofn, '-attach', self._ffmpeg_filename_argument(infofn),
f'-metadata:s:{new_stream}', 'mimetype=application/json', f'-metadata:s:{new_stream}', 'mimetype=application/json',
f'-metadata:s:{new_stream}', 'filename=info.json', f'-metadata:s:{new_stream}', 'filename=info.json',
) )