1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-23 00:54:31 +01:00

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

View File

@ -316,7 +316,7 @@ class TVPlayIE(InfoExtractor):
default = compat_urlparse.urlparse(url).netloc.rsplit('.', 1)[-1] default = compat_urlparse.urlparse(url).netloc.rsplit('.', 1)[-1]
for path in sub_paths: for path in sub_paths:
if path: 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] = [{ subtitles[lang] = [{
'url': path, 'url': path,
}] }]