mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2025-01-08 14:17:54 +01:00
[tvplay] Extract subtitles for Viafree (closes #12685)
This commit is contained in:
parent
7c24a58bdb
commit
8ae3d21533
@ -310,7 +310,6 @@ class TVPlayIE(InfoExtractor):
|
|||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
# TODO: webvtt in m3u8
|
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
sami_path = video.get('sami_path')
|
sami_path = video.get('sami_path')
|
||||||
if sami_path:
|
if sami_path:
|
||||||
@ -321,6 +320,24 @@ class TVPlayIE(InfoExtractor):
|
|||||||
'url': sami_path,
|
'url': sami_path,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
subtitles_webvtt = video.get('subtitles_webvtt')
|
||||||
|
if subtitles_webvtt:
|
||||||
|
lang = self._search_regex(
|
||||||
|
r'_([a-z]{2})\.vtt', subtitles_webvtt, 'lang',
|
||||||
|
default=compat_urlparse.urlparse(url).netloc.rsplit('.', 1)[-1])
|
||||||
|
subtitles[lang] = [{
|
||||||
|
'url': subtitles_webvtt,
|
||||||
|
}]
|
||||||
|
|
||||||
|
subtitles_for_hearing_impaired = video.get('subtitles_for_hearing_impaired')
|
||||||
|
if subtitles_for_hearing_impaired:
|
||||||
|
lang = self._search_regex(
|
||||||
|
r'_([a-z]{2})_', subtitles_for_hearing_impaired, 'lang',
|
||||||
|
default=compat_urlparse.urlparse(url).netloc.rsplit('.', 1)[-1])
|
||||||
|
subtitles[lang + '_sdh'] = [{
|
||||||
|
'url': subtitles_for_hearing_impaired,
|
||||||
|
}]
|
||||||
|
|
||||||
series = video.get('format_title')
|
series = video.get('format_title')
|
||||||
episode_number = int_or_none(video.get('format_position', {}).get('episode'))
|
episode_number = int_or_none(video.get('format_position', {}).get('episode'))
|
||||||
season = video.get('_embedded', {}).get('season', {}).get('title')
|
season = video.get('_embedded', {}).get('season', {}).get('title')
|
||||||
|
Loading…
Reference in New Issue
Block a user