X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fsubtitles.py;h=db33745c14472f7f3e7749978585f0b2b2c53af2;hb=7e660ac113b5af8f92de2bbc9579426ea3d89581;hp=4b4c5235d09ea8a6f75b7d182abf87bfc573557f;hpb=ea36cbac5e089d5e37a2f92ea58375a5883d0af2;p=youtube-dl diff --git a/youtube_dl/extractor/subtitles.py b/youtube_dl/extractor/subtitles.py index 4b4c5235d..db33745c1 100644 --- a/youtube_dl/extractor/subtitles.py +++ b/youtube_dl/extractor/subtitles.py @@ -62,10 +62,13 @@ 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) + sub = 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 @@ -79,7 +82,11 @@ class SubtitlesInfoExtractor(InfoExtractor): 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): """