[YoutubeDL] Improve thumbnails' filenames deducing (closes #26010) (#27244)
authorcompujo <2576634+compujo@users.noreply.github.com>
Fri, 11 Dec 2020 20:12:31 +0000 (15:12 -0500)
committerGitHub <noreply@github.com>
Fri, 11 Dec 2020 20:12:31 +0000 (03:12 +0700)
youtube_dl/YoutubeDL.py

index fdd68f616695f664b3a23ab23099e2a77415b149..6f477bc3205952b32b4c4bf6f7622589740d0fb9 100755 (executable)
@@ -2410,7 +2410,7 @@ class YoutubeDL(object):
             thumb_ext = determine_ext(t['url'], 'jpg')
             suffix = '_%s' % t['id'] if len(thumbnails) > 1 else ''
             thumb_display_id = '%s ' % t['id'] if len(thumbnails) > 1 else ''
-            t['filename'] = thumb_filename = os.path.splitext(filename)[0] + suffix + '.' + thumb_ext
+            t['filename'] = thumb_filename = replace_extension(filename + suffix, thumb_ext, info_dict.get('ext'))
 
             if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(thumb_filename)):
                 self.to_screen('[%s] %s: Thumbnail %sis already present' %