0
0
Fork 0

[postprocessor/ffmpeg] Return correct filepath and ext in updated information in FFmpegExtractAudioPP

Return correct audio's filepath and ext instead of the video's when extracting audio and audio file already exists.
main
Pierre Mdawar 2016-10-15 22:12:03 +03:00 committed by Sergey M
parent 4b492e3579
commit 2273e2c530
1 changed files with 3 additions and 3 deletions

View File

@ -279,6 +279,9 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
prefix, sep, ext = path.rpartition('.') # not os.path.splitext, since the latter does not work on unicode in all setups prefix, sep, ext = path.rpartition('.') # not os.path.splitext, since the latter does not work on unicode in all setups
new_path = prefix + sep + extension new_path = prefix + sep + extension
information['filepath'] = new_path
information['ext'] = extension
# If we download foo.mp3 and convert it to... foo.mp3, then don't delete foo.mp3, silly. # If we download foo.mp3 and convert it to... foo.mp3, then don't delete foo.mp3, silly.
if (new_path == path or if (new_path == path or
(self._nopostoverwrites and os.path.exists(encodeFilename(new_path)))): (self._nopostoverwrites and os.path.exists(encodeFilename(new_path)))):
@ -300,9 +303,6 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
new_path, time.time(), information['filetime'], new_path, time.time(), information['filetime'],
errnote='Cannot update utime of audio file') errnote='Cannot update utime of audio file')
information['filepath'] = new_path
information['ext'] = extension
return [path], information return [path], information