mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-03 10:14:42 +01:00
[atresplayer] Extract subtitles from streaming manifests
This commit is contained in:
parent
b2cd5da460
commit
c811e8d8bd
@ -86,18 +86,19 @@ def _real_extract(self, url):
|
|||||||
title = episode['titulo']
|
title = episode['titulo']
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
|
subtitles = {}
|
||||||
for source in episode.get('sources', []):
|
for source in episode.get('sources', []):
|
||||||
src = source.get('src')
|
src = source.get('src')
|
||||||
if not src:
|
if not src:
|
||||||
continue
|
continue
|
||||||
src_type = source.get('type')
|
src_type = source.get('type')
|
||||||
if src_type == 'application/vnd.apple.mpegurl':
|
if src_type == 'application/vnd.apple.mpegurl':
|
||||||
formats.extend(self._extract_m3u8_formats(
|
formats, subtitles = self._extract_m3u8_formats(
|
||||||
src, video_id, 'mp4', 'm3u8_native',
|
src, video_id, 'mp4', 'm3u8_native',
|
||||||
m3u8_id='hls', fatal=False))
|
m3u8_id='hls', fatal=False)
|
||||||
elif src_type == 'application/dash+xml':
|
elif src_type == 'application/dash+xml':
|
||||||
formats.extend(self._extract_mpd_formats(
|
formats, subtitles = self._extract_mpd_formats(
|
||||||
src, video_id, mpd_id='dash', fatal=False))
|
src, video_id, mpd_id='dash', fatal=False)
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
heartbeat = episode.get('heartbeat') or {}
|
heartbeat = episode.get('heartbeat') or {}
|
||||||
@ -115,4 +116,5 @@ def _real_extract(self, url):
|
|||||||
'channel': get_meta('channel'),
|
'channel': get_meta('channel'),
|
||||||
'season': get_meta('season'),
|
'season': get_meta('season'),
|
||||||
'episode_number': int_or_none(get_meta('episodeNumber')),
|
'episode_number': int_or_none(get_meta('episodeNumber')),
|
||||||
|
'subtitles': subtitles,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user