mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2025-02-17 01:17:54 +01:00
Calculate regex default only once
This commit is contained in:
parent
2872ea4494
commit
be7ed83941
@ -313,11 +313,10 @@ class TVPlayIE(InfoExtractor):
|
||||
# TODO: webvtt in m3u8
|
||||
subtitles = {}
|
||||
sub_paths = [video.get(key) for key in ['sami_path', 'subtitles_webvtt', 'subtitles_for_hearing_impaired']]
|
||||
default = compat_urlparse.urlparse(url).netloc.rsplit('.', 1)[-1]
|
||||
for path in sub_paths:
|
||||
if path:
|
||||
lang = self._search_regex(
|
||||
r'_(.*)(\.)', path, 'lang',
|
||||
default=compat_urlparse.urlparse(url).netloc.rsplit('.', 1)[-1])
|
||||
lang = self._search_regex(r'_(.*)(\.)', path, 'lang', default)
|
||||
subtitles[lang] = [{
|
||||
'url': path,
|
||||
}]
|
||||
|
Loading…
Reference in New Issue
Block a user