From ece8a2a1b6a39af3e548c6559b239528eb7d5399 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 28 Jan 2021 14:17:18 +0530 Subject: [PATCH] [embedthumbnail] Fix for missing output filename for ffmpeg call (Closes #38) --- youtube_dlc/postprocessor/embedthumbnail.py | 2 +- youtube_dlc/postprocessor/ffmpeg.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dlc/postprocessor/embedthumbnail.py b/youtube_dlc/postprocessor/embedthumbnail.py index bad005cca..2bce72bea 100644 --- a/youtube_dlc/postprocessor/embedthumbnail.py +++ b/youtube_dlc/postprocessor/embedthumbnail.py @@ -155,7 +155,7 @@ def is_webp(path): if not _has_mutagen: raise EmbedThumbnailPPError('module mutagen was not found. Please install.') size_regex = r',\s*(?P\d+)x(?P\d+)\s*[,\[]' - size_result = self.run_ffmpeg_multiple_files([thumbnail_filename], '', ['-hide_banner']) + size_result = self.run_ffmpeg(thumbnail_filename, thumbnail_filename, ['-hide_banner']) mobj = re.search(size_regex, size_result) width, height = int(mobj.group('w')), int(mobj.group('h')) mimetype = ('image/%s' % ('png' if thumbnail_ext == 'png' else 'jpeg')).encode('ascii') diff --git a/youtube_dlc/postprocessor/ffmpeg.py b/youtube_dlc/postprocessor/ffmpeg.py index 94eeec980..2bc75e784 100644 --- a/youtube_dlc/postprocessor/ffmpeg.py +++ b/youtube_dlc/postprocessor/ffmpeg.py @@ -268,7 +268,7 @@ def run_ffmpeg_multiple_files(self, input_paths, out_path, opts): return stderr.decode('utf-8', 'replace') def run_ffmpeg(self, path, out_path, opts): - self.run_ffmpeg_multiple_files([path], out_path, opts) + return self.run_ffmpeg_multiple_files([path], out_path, opts) def _ffmpeg_filename_argument(self, fn): # Always use 'file:' because the filename may contain ':' (ffmpeg