Add better regex for subtitles extraction

This commit is contained in:
David Pedersen 2020-02-04 19:55:20 +01:00
parent be7ed83941
commit 62535b93cf
1 changed files with 1 additions and 1 deletions

View File

@ -316,7 +316,7 @@ class TVPlayIE(InfoExtractor):
default = compat_urlparse.urlparse(url).netloc.rsplit('.', 1)[-1]
for path in sub_paths:
if path:
lang = self._search_regex(r'_(.*)(\.)', path, 'lang', default)
lang = self._search_regex(r'_([a-z]{2}(?:_sdh)?)\.(?:vtt|xml)', path, 'lang', default)
subtitles[lang] = [{
'url': path,
}]