From e2effb08a46817104b56a6242616fd60848251d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Wed, 10 Feb 2016 21:16:58 +0600 Subject: [PATCH] [YoutubeDL] Sanitize format_id (Closes #8494) --- youtube_dl/YoutubeDL.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 50228bb32..3cabfbc03 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1288,6 +1288,9 @@ def process_video_result(self, info_dict, download=True): if format.get('format_id') is None: format['format_id'] = compat_str(i) + else: + # Sanitize format_id from characters used in format selector expression + format['format_id'] = re.sub('[\s,/+\[\]()]', '_', format['format_id']) format_id = format['format_id'] if format_id not in formats_dict: formats_dict[format_id] = []