[postprocessor/embedthumbnail] Skipping if thumbnail file missing
authorYen Chi Hsuan <yan12125@gmail.com>
Thu, 18 Jun 2015 14:05:02 +0000 (22:05 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 18 Jun 2015 14:05:02 +0000 (22:05 +0800)
Fixes #5996

youtube_dl/postprocessor/embedthumbnail.py

index 774494efd1dbc9af1901bf67d1453689e846b780..e19dbf73d5fe36c602d9ffb83cd2d02ab39cb5e1 100644 (file)
@@ -35,6 +35,11 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
 
         thumbnail_filename = info['thumbnails'][-1]['filename']
 
+        if not os.path.exists(encodeFilename(thumbnail_filename)):
+            self._downloader.report_warning(
+                'Skipping embedding the thumbnail because the file is missing.')
+            return [], info
+
         if info['ext'] == 'mp3':
             options = [
                 '-c', 'copy', '-map', '0', '-map', '1',