diff --git a/yt_dlp/postprocessor/renamer.py b/yt_dlp/postprocessor/renamer.py index e73b922ab29b..15326178470f 100644 --- a/yt_dlp/postprocessor/renamer.py +++ b/yt_dlp/postprocessor/renamer.py @@ -93,6 +93,7 @@ def run(self, info): prefix = prefix.replace(' ', '.').replace('\'', '').replace(',', '') newfile = re.sub(r'\.{2,}', '.', f'{dir_path}/{prefix}.{suffix}') + newfile = re.sub(r'\\|\/|\:|\*|\?|\"|\<|\>|\|', '_', newfile) self.to_screen('Renaming file "%s" to "%s"' % (file, newfile)) shutil.move(file, newfile) info['filepath'] = newfile