1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-22 16:44:32 +01:00

YoutubeIE: don't crash when trying to get automatic captions if the videos has standard subtitles.

This commit is contained in:
Jaime Marquínez Ferrándiz 2013-06-29 22:11:18 +02:00
parent 88ae5991cd
commit 2f799533ae

View File

@ -270,7 +270,9 @@ class YoutubeIE(InfoExtractor):
subtitles_url = caption_url + '&' + params subtitles_url = caption_url + '&' + params
sub = self._download_webpage(subtitles_url, video_id, u'Downloading automatic captions') sub = self._download_webpage(subtitles_url, video_id, u'Downloading automatic captions')
return {sub_lang: sub} return {sub_lang: sub}
except KeyError: # An extractor error can be raise by the download process if there are
# no automatic captions but there are subtitles
except (KeyError, ExtractorError):
self._downloader.report_warning(err_msg) self._downloader.report_warning(err_msg)
return {} return {}