X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fpostprocessor%2Fembedthumbnail.py;h=4868a42fdca9f486bed5e1def3ffaf08b26fda39;hb=233c1c0e76d64c9e13dc8968bfd8a014c49e66a8;hp=a2d6b14dbb47387c33c8514cd141879ab0c83753;hpb=09aa111918c35cc091253d06b4de0b6f396b8e80;p=youtube-dl.git diff --git a/youtube_dl/postprocessor/embedthumbnail.py b/youtube_dl/postprocessor/embedthumbnail.py index a2d6b14db..4868a42fd 100644 --- a/youtube_dl/postprocessor/embedthumbnail.py +++ b/youtube_dl/postprocessor/embedthumbnail.py @@ -11,6 +11,7 @@ from ..compat import ( compat_urlretrieve, ) from ..utils import ( + determine_ext, check_executable, encodeFilename, PostProcessingError, @@ -27,7 +28,7 @@ class EmbedThumbnailPP(FFmpegPostProcessor): def run(self, info): filename = info['filepath'] temp_filename = prepend_extension(filename, 'temp') - temp_thumbnail = prepend_extension(filename, 'thumb') + temp_thumbnail = filename + '.' + determine_ext(info['thumbnail']) if not info.get('thumbnail'): raise EmbedThumbnailPPError('Thumbnail was not found. Nothing to do.') @@ -35,7 +36,8 @@ class EmbedThumbnailPP(FFmpegPostProcessor): compat_urlretrieve(info['thumbnail'], temp_thumbnail) if info['ext'] == 'mp3': - options = ['-i', temp_thumbnail, '-c', 'copy', '-map', '0', '-map', '1', + options = [ + '-i', temp_thumbnail, '-c', 'copy', '-map', '0', '-map', '1', '-metadata:s:v', 'title="Album cover"', '-metadata:s:v', 'comment="Cover (Front)"'] self._downloader.to_screen('[ffmpeg] Adding thumbnail to "%s"' % filename)