aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-01-26 15:53:07 +0530
committerpukkandan <pukkandan@gmail.com>2021-01-26 15:53:32 +0530
commit9882064024abdad7d37771459e9df11bcdec1115 (patch)
tree04815d022d6ed8f489119d04ee9a8a38ec6218c5
parent2d6921210d1cf04f041787b527af99a8488780c4 (diff)
downloadhypervideo-pre-9882064024abdad7d37771459e9df11bcdec1115.tar.lz
hypervideo-pre-9882064024abdad7d37771459e9df11bcdec1115.tar.xz
hypervideo-pre-9882064024abdad7d37771459e9df11bcdec1115.zip
[movefiles] Don't give "cant find" warning when move is unnecessary
-rw-r--r--youtube_dlc/postprocessor/movefilesafterdownload.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dlc/postprocessor/movefilesafterdownload.py b/youtube_dlc/postprocessor/movefilesafterdownload.py
index 4146a9549..7dcf12a3b 100644
--- a/youtube_dlc/postprocessor/movefilesafterdownload.py
+++ b/youtube_dlc/postprocessor/movefilesafterdownload.py
@@ -28,14 +28,14 @@ class MoveFilesAfterDownloadPP(PostProcessor):
self.files_to_move[info['filepath']] = finalpath
for oldfile, newfile in self.files_to_move.items():
- if not os.path.exists(encodeFilename(oldfile)):
- self.report_warning('File "%s" cannot be found' % oldfile)
- continue
if not newfile:
newfile = os.path.join(finaldir, os.path.basename(encodeFilename(oldfile)))
oldfile, newfile = compat_str(oldfile), compat_str(newfile)
if os.path.abspath(encodeFilename(oldfile)) == os.path.abspath(encodeFilename(newfile)):
continue
+ if not os.path.exists(encodeFilename(oldfile)):
+ self.report_warning('File "%s" cannot be found' % oldfile)
+ continue
if os.path.exists(encodeFilename(newfile)):
if self.get_param('overwrites', True):
self.report_warning('Replacing existing file "%s"' % newfile)