diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-03-19 16:31:22 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-03-20 09:34:52 +0530 |
commit | 4d971a16b831a45147b6ae7ce53b3e105d204da7 (patch) | |
tree | d04b539d32909eab2effde0041fb2e880d5198fe | |
parent | 356153077695ecc89fcc4955264a32cda2e5f177 (diff) | |
download | hypervideo-pre-4d971a16b831a45147b6ae7ce53b3e105d204da7.tar.lz hypervideo-pre-4d971a16b831a45147b6ae7ce53b3e105d204da7.tar.xz hypervideo-pre-4d971a16b831a45147b6ae7ce53b3e105d204da7.zip |
Merge webm formats into mkv if thumbnails are to be embedded (#173)
Co-authored by: Damiano Amatruda <damiano.amatruda@outlook.com>
-rw-r--r-- | yt_dlp/YoutubeDL.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 8681a18e9..1e46b76b5 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -2343,10 +2343,17 @@ class YoutubeDL(object): requested_formats = info_dict['requested_formats'] old_ext = info_dict['ext'] - if self.params.get('merge_output_format') is None and not compatible_formats(requested_formats): - info_dict['ext'] = 'mkv' - self.report_warning( - 'Requested formats are incompatible for merge and will be merged into mkv.') + if self.params.get('merge_output_format') is None: + if not compatible_formats(requested_formats): + info_dict['ext'] = 'mkv' + self.report_warning( + 'Requested formats are incompatible for merge and will be merged into mkv.') + if (info_dict['ext'] == 'webm' + and self.params.get('writethumbnail', False) + and info_dict.get('thumbnails')): + info_dict['ext'] = 'mkv' + self.report_warning( + 'webm doesn\'t support embedding a thumbnail, mkv will be used.') def correct_ext(filename): filename_real_ext = os.path.splitext(filename)[1][1:] |