aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/PostProcessor.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-05-05 20:51:27 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2013-05-05 20:51:27 +0200
commit02d5eb935f020241ff33b4b91ba88b92eee66b97 (patch)
treefa53a474107c4a2b3b80d45e74ddf376f9dee4d5 /youtube_dl/PostProcessor.py
parent94ca71b7cce1516f0aaad43083fbb24ebbc91182 (diff)
parent486f0c947675eebb129414f8f46010206c9245b7 (diff)
Merge remote-tracking branch 'origin/master'
Conflicts: youtube_dl/InfoExtractors.py
Diffstat (limited to 'youtube_dl/PostProcessor.py')
-rw-r--r--youtube_dl/PostProcessor.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube_dl/PostProcessor.py b/youtube_dl/PostProcessor.py
index 70dc01004..0c6885dda 100644
--- a/youtube_dl/PostProcessor.py
+++ b/youtube_dl/PostProcessor.py
@@ -188,6 +188,11 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
prefix, sep, ext = path.rpartition(u'.') # not os.path.splitext, since the latter does not work on unicode in all setups
new_path = prefix + sep + extension
+
+ # If we download foo.mp3 and convert it to... foo.mp3, then don't delete foo.mp3, silly.
+ if new_path == path:
+ self._nopostoverwrites = True
+
try:
if self._nopostoverwrites and os.path.exists(encodeFilename(new_path)):
self._downloader.to_screen(u'[youtube] Post-process file %s exists, skipping' % new_path)
@@ -210,7 +215,7 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
self._downloader.to_stderr(u'WARNING: Cannot update utime of audio file')
information['filepath'] = new_path
- return False,information
+ return self._nopostoverwrites,information
class FFmpegVideoConvertor(FFmpegPostProcessor):
def __init__(self, downloader=None,preferedformat=None):