A feature-rich command-line audio/video downloader
Improve temporary filename handling of special cases
Ricardo Garcia7d950ca1d654
diff --git a/youtube-dl b/youtube-dlindex 415cf70737..64c590fbfc 100755--- a/youtube-dl+++ b/youtube-dl@@ -238,7 +238,9 @@ class FileDownloader(object):@staticmethoddef temp_name(filename):"""Returns a temporary filename for the given filename."""- return filename + '.part'+ if filename == u'-' or (os.path.exists(filename) and not os.path.isfile(filename)):+ return filename+ return filename + u'.part'@staticmethoddef format_bytes(bytes):@@ -361,6 +363,8 @@ class FileDownloader(object):def try_rename(self, old_filename, new_filename):try:+ if old_filename == new_filename:+ returnos.rename(old_filename, new_filename)except (IOError, OSError), err:self.trouble(u'ERROR: unable to rename file')