Browse Source

[subtittles] Check that the result is not empty

totalwebcasting
Philipp Hagemeister 11 years ago
parent
commit
5cef4ff09b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      youtube_dl/extractor/subtitles.py

+ 2
- 1
youtube_dl/extractor/subtitles.py View File

@ -68,13 +68,14 @@ class SubtitlesInfoExtractor(InfoExtractor):
def _request_subtitle_url(self, sub_lang, url):
""" makes the http request for the subtitle """
try:
return self._download_subtitle_url(sub_lang, url)
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
if not sub:
self._downloader.report_warning(u'Did not fetch video subtitles')
return
return sub
def _get_available_subtitles(self, video_id, webpage):
"""


Loading…
Cancel
Save