aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-01-23 18:58:28 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-01-23 18:58:28 +0100
commit5779b3e1fe4dd76972d3c00bb12cc1131765d0c1 (patch)
tree45cdeefb128ff2a3fc07db6a6c75732c4284a501 /youtube_dl
parent62cd676c7474f696804eda653558ada94c5953a0 (diff)
parent0c17278843a30d4aea1f8334985e6fbae17000d9 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/atresplayer.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/youtube_dl/extractor/atresplayer.py b/youtube_dl/extractor/atresplayer.py
index 8fd69b971..f42862be3 100644
--- a/youtube_dl/extractor/atresplayer.py
+++ b/youtube_dl/extractor/atresplayer.py
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
import time
import hmac
-from .common import InfoExtractor
+from .subtitles import SubtitlesInfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
@@ -17,7 +17,7 @@ from ..utils import (
)
-class AtresPlayerIE(InfoExtractor):
+class AtresPlayerIE(SubtitlesInfoExtractor):
_VALID_URL = r'https?://(?:www\.)?atresplayer\.com/television/[^/]+/[^/]+/[^/]+/(?P<id>.+?)_\d+\.html'
_TESTS = [
{
@@ -143,6 +143,15 @@ class AtresPlayerIE(InfoExtractor):
description = xpath_text(art, './description', 'description')
thumbnail = xpath_text(episode, './media/asset/files/background', 'thumbnail')
+ subtitles = {}
+ subtitle = xpath_text(episode, './media/asset/files/subtitle', 'subtitle')
+ if subtitle:
+ subtitles['es'] = subtitle
+
+ if self._downloader.params.get('listsubtitles', False):
+ self._list_available_subtitles(video_id, subtitles)
+ return
+
return {
'id': video_id,
'title': title,
@@ -150,4 +159,5 @@ class AtresPlayerIE(InfoExtractor):
'thumbnail': thumbnail,
'duration': duration,
'formats': formats,
+ 'subtitles': self.extract_subtitles(video_id, subtitles),
}