mirror of https://github.com/yt-dlp/yt-dlp.git
parent
dcd55f766d
commit
3aa915400d
|
@ -2663,12 +2663,15 @@ class YoutubeDL(object):
|
||||||
# given in subtitleslangs. See https://github.com/yt-dlp/yt-dlp/issues/1041
|
# given in subtitleslangs. See https://github.com/yt-dlp/yt-dlp/issues/1041
|
||||||
requested_langs = []
|
requested_langs = []
|
||||||
for lang_re in self.params.get('subtitleslangs'):
|
for lang_re in self.params.get('subtitleslangs'):
|
||||||
if lang_re == 'all':
|
|
||||||
requested_langs.extend(all_sub_langs)
|
|
||||||
continue
|
|
||||||
discard = lang_re[0] == '-'
|
discard = lang_re[0] == '-'
|
||||||
if discard:
|
if discard:
|
||||||
lang_re = lang_re[1:]
|
lang_re = lang_re[1:]
|
||||||
|
if lang_re == 'all':
|
||||||
|
if discard:
|
||||||
|
requested_langs = []
|
||||||
|
else:
|
||||||
|
requested_langs.extend(all_sub_langs)
|
||||||
|
continue
|
||||||
current_langs = filter(re.compile(lang_re + '$').match, all_sub_langs)
|
current_langs = filter(re.compile(lang_re + '$').match, all_sub_langs)
|
||||||
if discard:
|
if discard:
|
||||||
for lang in current_langs:
|
for lang in current_langs:
|
||||||
|
|
Loading…
Reference in New Issue