[YoutubeDL] format spec: fix handling of '/' with ','

When using 'bestvideo/best,bestaudio', 'bestvideo/best' must be set as the current_selector (instead of appending it to the selectors), otherwise when it gets the ',' it would append 'None' to the selectors.
This commit is contained in:
Jaime Marquínez Ferrándiz
2015-07-04 21:30:26 +02:00
parent cf2ac6df68
commit f5f4a27a96
2 changed files with 9 additions and 2 deletions

View File

@ -958,8 +958,7 @@ class YoutubeDL(object):
elif string == '/':
first_choice = current_selector
second_choice = _parse_format_selection(tokens, inside_choice=True)
current_selector = None
selectors.append(FormatSelector(PICKFIRST, (first_choice, second_choice), []))
current_selector = FormatSelector(PICKFIRST, (first_choice, second_choice), [])
elif string == '[':
if not current_selector:
current_selector = FormatSelector(SINGLE, 'best', [])