aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/atresplayer.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/atresplayer.py')
-rw-r--r--hypervideo_dl/extractor/atresplayer.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/hypervideo_dl/extractor/atresplayer.py b/hypervideo_dl/extractor/atresplayer.py
index c2cec98..8143eb4 100644
--- a/hypervideo_dl/extractor/atresplayer.py
+++ b/hypervideo_dl/extractor/atresplayer.py
@@ -1,7 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
-import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
@@ -75,7 +74,7 @@ class AtresPlayerIE(InfoExtractor):
self._request_webpage(target_url, None, 'Following Target URL')
def _real_extract(self, url):
- display_id, video_id = re.match(self._VALID_URL, url).groups()
+ display_id, video_id = self._match_valid_url(url).groups()
try:
episode = self._download_json(
@@ -86,18 +85,19 @@ class AtresPlayerIE(InfoExtractor):
title = episode['titulo']
formats = []
+ subtitles = {}
for source in episode.get('sources', []):
src = source.get('src')
if not src:
continue
src_type = source.get('type')
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',
- m3u8_id='hls', fatal=False))
+ m3u8_id='hls', fatal=False)
elif src_type == 'application/dash+xml':
- formats.extend(self._extract_mpd_formats(
- src, video_id, mpd_id='dash', fatal=False))
+ formats, subtitles = self._extract_mpd_formats(
+ src, video_id, mpd_id='dash', fatal=False)
self._sort_formats(formats)
heartbeat = episode.get('heartbeat') or {}
@@ -115,4 +115,5 @@ class AtresPlayerIE(InfoExtractor):
'channel': get_meta('channel'),
'season': get_meta('season'),
'episode_number': int_or_none(get_meta('episodeNumber')),
+ 'subtitles': subtitles,
}