aboutsummaryrefslogtreecommitdiffhomepage
path: root/youtube_dl/extractor/atresplayer.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <[email protected]>2015-02-15 18:32:40 +0100
committerJaime Marquínez Ferrándiz <[email protected]>2015-02-16 21:51:07 +0100
commit6b597516c12c7fd81e832f3ec05dd0dca6089823 (patch)
tree0dfe9e251d8cff25f4cf0368f50e9965e22d1703 /youtube_dl/extractor/atresplayer.py
parentb5857f62e2c2ca70316e041212aa9e89d54cc253 (diff)
downloadyoutube-dl-6b597516c12c7fd81e832f3ec05dd0dca6089823.tar.gz
youtube-dl-6b597516c12c7fd81e832f3ec05dd0dca6089823.zip
[atresplayer] Convert to new subtitles system
Diffstat (limited to 'youtube_dl/extractor/atresplayer.py')
-rw-r--r--youtube_dl/extractor/atresplayer.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/youtube_dl/extractor/atresplayer.py b/youtube_dl/extractor/atresplayer.py
index f016368fa..7669e0e3d 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 .subtitles import SubtitlesInfoExtractor
+from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
@@ -17,7 +17,7 @@ from ..utils import (
)
-class AtresPlayerIE(SubtitlesInfoExtractor):
+class AtresPlayerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?atresplayer\.com/television/[^/]+/[^/]+/[^/]+/(?P<id>.+?)_\d+\.html'
_TESTS = [
{
@@ -144,13 +144,12 @@ class AtresPlayerIE(SubtitlesInfoExtractor):
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
+ subtitle_url = xpath_text(episode, './media/asset/files/subtitle', 'subtitle')
+ if subtitle_url:
+ subtitles['es'] = [{
+ 'ext': 'srt',
+ 'url': subtitle_url,
+ }]
return {
'id': video_id,
@@ -159,5 +158,5 @@ class AtresPlayerIE(SubtitlesInfoExtractor):
'thumbnail': thumbnail,
'duration': duration,
'formats': formats,
- 'subtitles': self.extract_subtitles(video_id, subtitles),
+ 'subtitles': subtitles,
}