mirror of https://github.com/yt-dlp/yt-dlp.git
parent
c9d14bd22a
commit
376aa24b15
|
@ -2810,10 +2810,14 @@ class YoutubeDL:
|
||||||
self.params.get('subtitleslangs'), {'all': all_sub_langs}, use_regex=True)
|
self.params.get('subtitleslangs'), {'all': all_sub_langs}, use_regex=True)
|
||||||
except re.error as e:
|
except re.error as e:
|
||||||
raise ValueError(f'Wrong regex for subtitlelangs: {e.pattern}')
|
raise ValueError(f'Wrong regex for subtitlelangs: {e.pattern}')
|
||||||
elif normal_sub_langs:
|
|
||||||
requested_langs = ['en'] if 'en' in normal_sub_langs else normal_sub_langs[:1]
|
|
||||||
else:
|
else:
|
||||||
requested_langs = ['en'] if 'en' in all_sub_langs else all_sub_langs[:1]
|
requested_langs = LazyList(itertools.chain(
|
||||||
|
['en'] if 'en' in normal_sub_langs else [],
|
||||||
|
filter(lambda f: f.startswith('en'), normal_sub_langs),
|
||||||
|
['en'] if 'en' in all_sub_langs else [],
|
||||||
|
filter(lambda f: f.startswith('en'), all_sub_langs),
|
||||||
|
normal_sub_langs, all_sub_langs,
|
||||||
|
))[:1]
|
||||||
if requested_langs:
|
if requested_langs:
|
||||||
self.to_screen(f'[info] {video_id}: Downloading subtitles: {", ".join(requested_langs)}')
|
self.to_screen(f'[info] {video_id}: Downloading subtitles: {", ".join(requested_langs)}')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue