mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 02:14:32 +01:00
Add language prefixes for --sub-lang
This commit is contained in:
parent
75ef77c1b1
commit
f64af79b0c
@ -1664,7 +1664,13 @@ class YoutubeDL(object):
|
||||
requested_langs = available_subs.keys()
|
||||
else:
|
||||
if self.params.get('subtitleslangs', False):
|
||||
requested_langs = self.params.get('subtitleslangs')
|
||||
requested_langs = []
|
||||
for lang in self.params.get('subtitleslangs'):
|
||||
if lang.endswith('*'):
|
||||
prefix = lang[:-1]
|
||||
requested_langs += [l for l in available_subs.keys() if l.startswith(prefix)]
|
||||
else:
|
||||
requested_langs.append(lang)
|
||||
elif 'en' in available_subs:
|
||||
requested_langs = ['en']
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user