Incorrect variable is used to check whether thumbnail exists
authoralimirjamali <ali.mirjamali@gmail.com>
Mon, 16 Dec 2013 16:44:28 +0000 (20:14 +0330)
committeralimirjamali <ali.mirjamali@gmail.com>
Mon, 16 Dec 2013 16:44:28 +0000 (20:14 +0330)
Dear @phihag

I believe in line 848, the correct variable to check is 'thumb_filename' rather than 'infofn'

Kindly advise

Mit freundlichen Gruessen
Ali

youtube_dl/YoutubeDL.py

index 2fa34ebc9ab22599cab4d3e91b1410b919c23617..b1f87415b9f07cd05c6de01a2c4fa6e9b013895e 100644 (file)
@@ -845,7 +845,7 @@ class YoutubeDL(object):
             if info_dict.get('thumbnail') is not None:
                 thumb_format = determine_ext(info_dict['thumbnail'], u'jpg')
                 thumb_filename = os.path.splitext(filename)[0] + u'.' + thumb_format
-                if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(infofn)):
+                if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(thumb_filename)):
                     self.to_screen(u'[%s] %s: Thumbnail is already present' %
                                    (info_dict['extractor'], info_dict['id']))
                 else: