]> git.bitcoin.ninja Git - youtube-dl/commitdiff
YoutubeIE: don't crash when trying to get automatic captions if the videos has standa...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 29 Jun 2013 20:11:18 +0000 (22:11 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 20 Jul 2013 10:56:10 +0000 (12:56 +0200)
youtube_dl/extractor/youtube.py

index 30036524f9b0542c3629552f19cbb0634355e4cb..2b03226f60ede0545497d1386f7ad4e3c6d32ba8 100644 (file)
@@ -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 {}