[postprocessor/atomicparsley] Don't try to remove the temporary and original files...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Mon, 13 Apr 2015 20:50:40 +0000 (22:50 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Mon, 13 Apr 2015 20:50:40 +0000 (22:50 +0200)
youtube_dl/postprocessor/atomicparsley.py

index 448ccc5f342e42959aae0619854fa80d1e1cd978..a5dfc136afddb983d23cbf6c3f87fedaacbb1999 100644 (file)
@@ -50,8 +50,13 @@ class AtomicParsleyPP(PostProcessor):
             msg = stderr.decode('utf-8', 'replace').strip()
             raise AtomicParsleyPPError(msg)
 
-        os.remove(encodeFilename(filename))
         os.remove(encodeFilename(temp_thumbnail))
-        os.rename(encodeFilename(temp_filename), encodeFilename(filename))
+        # for formats that don't support thumbnails (like 3gp) AtomicParsley
+        # won't create to the temporary file
+        if b'No changes' in stdout:
+            self._downloader.report_warning('The file format doesn\'t support embedding a thumbnail')
+        else:
+            os.remove(encodeFilename(filename))
+            os.rename(encodeFilename(temp_filename), encodeFilename(filename))
 
         return True, info