From 0f0875ed555514f32522a0f30554fb08825d5124 Mon Sep 17 00:00:00 2001 From: Lesmiscore Date: Tue, 28 Mar 2023 01:17:42 +0900 Subject: [PATCH] [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 --- yt_dlp/postprocessor/embedthumbnail.py | 2 +- yt_dlp/postprocessor/ffmpeg.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/postprocessor/embedthumbnail.py b/yt_dlp/postprocessor/embedthumbnail.py index b02d9d499..88a767132 100644 --- a/yt_dlp/postprocessor/embedthumbnail.py +++ b/yt_dlp/postprocessor/embedthumbnail.py @@ -107,7 +107,7 @@ def run(self, info): options.extend(['-map', '-0:%d' % old_stream]) new_stream -= 1 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, 'filename=cover.%s' % thumbnail_ext]) diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py index 0e8f4c70b..63fc9ace6 100644 --- a/yt_dlp/postprocessor/ffmpeg.py +++ b/yt_dlp/postprocessor/ffmpeg.py @@ -809,7 +809,7 @@ def _get_infojson_opts(self, info, infofn): new_stream -= 1 yield ( - '-attach', infofn, + '-attach', self._ffmpeg_filename_argument(infofn), f'-metadata:s:{new_stream}', 'mimetype=application/json', f'-metadata:s:{new_stream}', 'filename=info.json', )