aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-04-13 22:50:40 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-04-13 22:50:40 +0200
commit37b44fe7c1e462b748171c4af743f30c01c95fe1 (patch)
treed799f1c5bab5d60bc53ffaa45458d369b8977d4b
parent8f02ad4f12549865a2a4436328075f4b20b906ef (diff)
[postprocessor/atomicparsley] Don't try to remove the temporary and original files if the format is unsupported (fixes #5419)
-rw-r--r--youtube_dl/postprocessor/atomicparsley.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/youtube_dl/postprocessor/atomicparsley.py b/youtube_dl/postprocessor/atomicparsley.py
index 448ccc5f3..a5dfc136a 100644
--- a/youtube_dl/postprocessor/atomicparsley.py
+++ b/youtube_dl/postprocessor/atomicparsley.py
@@ -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