Fix thumbnail filename determination (Fixes #1945)
authorPhilipp Hagemeister <phihag@phihag.de>
Wed, 11 Dec 2013 07:54:48 +0000 (08:54 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Wed, 11 Dec 2013 07:54:48 +0000 (08:54 +0100)
youtube_dl/YoutubeDL.py

index cabe309802c68fc56bdff49d34e5ea2b5d216fd2..c77777ba04cc734ece8e3e12bdc34df72f325919 100644 (file)
@@ -827,7 +827,7 @@ class YoutubeDL(object):
         if self.params.get('writethumbnail', False):
             if info_dict.get('thumbnail') is not None:
                 thumb_format = determine_ext(info_dict['thumbnail'], u'jpg')
-                thumb_filename = filename.rpartition('.')[0] + u'.' + thumb_format
+                thumb_filename = os.path.splitext(filename)[0] + u'.' + thumb_format
                 self.to_screen(u'[%s] %s: Downloading thumbnail ...' %
                                (info_dict['extractor'], info_dict['id']))
                 try: