mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-25 03:15:15 +01:00
[subtittles] Check that the result is not empty
This commit is contained in:
parent
91264ce572
commit
5cef4ff09b
@ -68,13 +68,14 @@ class SubtitlesInfoExtractor(InfoExtractor):
|
|||||||
def _request_subtitle_url(self, sub_lang, url):
|
def _request_subtitle_url(self, sub_lang, url):
|
||||||
""" makes the http request for the subtitle """
|
""" makes the http request for the subtitle """
|
||||||
try:
|
try:
|
||||||
return self._download_subtitle_url(sub_lang, url)
|
sub = self._download_subtitle_url(sub_lang, url)
|
||||||
except ExtractorError as err:
|
except ExtractorError as err:
|
||||||
self._downloader.report_warning(u'unable to download video subtitles for %s: %s' % (sub_lang, compat_str(err)))
|
self._downloader.report_warning(u'unable to download video subtitles for %s: %s' % (sub_lang, compat_str(err)))
|
||||||
return
|
return
|
||||||
if not sub:
|
if not sub:
|
||||||
self._downloader.report_warning(u'Did not fetch video subtitles')
|
self._downloader.report_warning(u'Did not fetch video subtitles')
|
||||||
return
|
return
|
||||||
|
return sub
|
||||||
|
|
||||||
def _get_available_subtitles(self, video_id, webpage):
|
def _get_available_subtitles(self, video_id, webpage):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user