[ThumbnailsConvertor] Fix filename escaping

Closes #4604
Authored by: pukkandan, dirkf
This commit is contained in:
pukkandan 2022-11-11 14:08:12 +05:30
parent f4b2c59cfe
commit 8522226d2f
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39

View file

@ -1081,9 +1081,9 @@ def fixup_webp(self, info, idx=-1):
@staticmethod
def _options(target_ext):
yield from ('-update', '1')
if target_ext == 'jpg':
return ['-bsf:v', 'mjpeg2jpeg']
return []
yield from ('-bsf:v', 'mjpeg2jpeg')
def convert_thumbnail(self, thumbnail_filename, target_ext):
thumbnail_conv_filename = replace_extension(thumbnail_filename, target_ext)
@ -1092,7 +1092,7 @@ def convert_thumbnail(self, thumbnail_filename, target_ext):
_, source_ext = os.path.splitext(thumbnail_filename)
self.real_run_ffmpeg(
[(thumbnail_filename, [] if source_ext == '.gif' else ['-f', 'image2', '-pattern_type', 'none'])],
[(thumbnail_conv_filename.replace('%', '%%'), self._options(target_ext))])
[(thumbnail_conv_filename, self._options(target_ext))])
return thumbnail_conv_filename
def run(self, info):