aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/subtitles.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-02-03 05:18:30 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-02-03 05:18:30 +0100
commitb4bcffefa3883ec469457cf13e500d1180d4931e (patch)
tree5b01045571ebee541e0755c9b1bd25442deb4393 /youtube_dl/extractor/subtitles.py
parent009a3408f5195442c4bd0471a91a0b38d283382d (diff)
[blip.tv] Add support for subtitles (#2274)
Diffstat (limited to 'youtube_dl/extractor/subtitles.py')
-rw-r--r--youtube_dl/extractor/subtitles.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/youtube_dl/extractor/subtitles.py b/youtube_dl/extractor/subtitles.py
index 4b4c5235d..6b3027782 100644
--- a/youtube_dl/extractor/subtitles.py
+++ b/youtube_dl/extractor/subtitles.py
@@ -62,24 +62,30 @@ class SubtitlesInfoExtractor(InfoExtractor):
subtitles[sub_lang] = subtitle
return subtitles
+ def _download_subtitle_url(self, sub_lang, url):
+ return self._download_webpage(url, None, note=False)
+
def _request_subtitle_url(self, sub_lang, url):
""" makes the http request for the subtitle """
try:
- sub = self._download_webpage(url, None, note=False)
+ return self._download_subtitle_url(sub_lang, url)
except ExtractorError as err:
self._downloader.report_warning(u'unable to download video subtitles for %s: %s' % (sub_lang, compat_str(err)))
return
if not sub:
self._downloader.report_warning(u'Did not fetch video subtitles')
return
- return sub
def _get_available_subtitles(self, video_id, webpage):
"""
returns {sub_lang: url} or {} if not available
Must be redefined by the subclasses
"""
- pass
+
+ # By default, allow implementations to simply pass in the result
+ assert isinstance(webpage, dict), \
+ '_get_available_subtitles not implemented'
+ return webpage
def _get_available_automatic_caption(self, video_id, webpage):
"""