Browse Source

[YoutubeDL] Sanitize format_id (Closes #8494)

totalwebcasting
Sergey M․ 9 years ago
parent
commit
e2effb08a4
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      youtube_dl/YoutubeDL.py

+ 3
- 0
youtube_dl/YoutubeDL.py View File

@ -1288,6 +1288,9 @@ class YoutubeDL(object):
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] = []


Loading…
Cancel
Save