aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-06-29 22:11:18 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-07-20 12:56:10 +0200
commit2f799533ae680dc788c8b4f6ce41272cf89689cc (patch)
tree006113b7ccee43191dc5996c6a10b8df4cfd1e02
parent88ae5991cd777f05b437dbe7b4399f1ff25d6b85 (diff)
YoutubeIE: don't crash when trying to get automatic captions if the videos has standard subtitles.
-rw-r--r--youtube_dl/extractor/youtube.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 30036524f..2b03226f6 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -270,7 +270,9 @@ class YoutubeIE(InfoExtractor):
subtitles_url = caption_url + '&' + params
sub = self._download_webpage(subtitles_url, video_id, u'Downloading automatic captions')
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)
return {}