aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-02-05 20:15:13 +0600
committerSergey M․ <dstftw@gmail.com>2015-02-05 20:15:13 +0600
commit1b0f3919c1ffafb7d76d5d029f3516c44bb86550 (patch)
treedf3f55ad55eb43514dedb0b56e2469ab3cbcdd0b /youtube_dl
parent7dfc3566250894147910bd6b79530f97770a47f3 (diff)
parent6a348cf7d507f0373e9a6f67358202b66a858cd1 (diff)
Merge branch 'Frenzie-npo'
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/npo.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/youtube_dl/extractor/npo.py b/youtube_dl/extractor/npo.py
index 175b14583..54be06a4e 100644
--- a/youtube_dl/extractor/npo.py
+++ b/youtube_dl/extractor/npo.py
@@ -1,6 +1,6 @@
from __future__ import unicode_literals
-from .common import InfoExtractor
+from .subtitles import SubtitlesInfoExtractor
from ..utils import (
fix_xml_ampersands,
parse_duration,
@@ -11,7 +11,7 @@ from ..utils import (
)
-class NPOBaseIE(InfoExtractor):
+class NPOBaseIE(SubtitlesInfoExtractor):
def _get_token(self, video_id):
token_page = self._download_webpage(
'http://ida.omroep.nl/npoplayer/i.js',
@@ -161,6 +161,16 @@ class NPOIE(NPOBaseIE):
self._sort_formats(formats)
+ subtitles = {}
+ if metadata.get('tt888') == 'ja':
+ subtitles['nl'] = 'http://e.omroep.nl/tt888/%s' % video_id
+
+ if self._downloader.params.get('listsubtitles', False):
+ self._list_available_subtitles(video_id, subtitles)
+ return
+
+ subtitles = self.extract_subtitles(video_id, subtitles)
+
return {
'id': video_id,
'title': metadata['titel'],
@@ -169,6 +179,7 @@ class NPOIE(NPOBaseIE):
'upload_date': unified_strdate(metadata.get('gidsdatum')),
'duration': parse_duration(metadata.get('tijdsduur')),
'formats': formats,
+ 'subtitles': subtitles,
}