]> jfr.im git - yt-dlp.git/blobdiff - youtube_dlc/postprocessor/movefilesafterdownload.py
Multiple output templates for different file types
[yt-dlp.git] / youtube_dlc / postprocessor / movefilesafterdownload.py
index 7dcf12a3b3a18f76fbf0d8b334915d6bb93f6b87..7f34ac5c5ec8c1d5d1baf6000b85166986ca8205 100644 (file)
@@ -25,6 +25,7 @@ def run(self, info):
         dl_path, dl_name = os.path.split(encodeFilename(info['filepath']))
         finaldir = info.get('__finaldir', dl_path)
         finalpath = os.path.join(finaldir, dl_name)
+        self.files_to_move.update(info['__files_to_move'])
         self.files_to_move[info['filepath']] = finalpath
 
         for oldfile, newfile in self.files_to_move.items():
@@ -39,7 +40,7 @@ def run(self, info):
             if os.path.exists(encodeFilename(newfile)):
                 if self.get_param('overwrites', True):
                     self.report_warning('Replacing existing file "%s"' % newfile)
-                    os.path.remove(encodeFilename(newfile))
+                    os.remove(encodeFilename(newfile))
                 else:
                     self.report_warning(
                         'Cannot move file "%s" out of temporary directory since "%s" already exists. '