projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7fcea29
)
[YoutubeDL] Sanitize format_id (Closes #8494)
author
Sergey M․
<dstftw@gmail.com>
Wed, 10 Feb 2016 15:16:58 +0000
(21:16 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 10 Feb 2016 15:16:58 +0000
(21:16 +0600)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index 50228bb321d3b4076bdff438624b5136da2f6e87..3cabfbc03257691f5c27a0cc05cd8376086ba7b9 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-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] = []