Fix crash when subtitles are not found and the option --all-subs is given
authorJaime Marquínez Ferrándiz <jaimemf93@gmail.com>
Sun, 31 Mar 2013 10:19:13 +0000 (12:19 +0200)
committerJaime Marquínez Ferrándiz <jaimemf93@gmail.com>
Sun, 31 Mar 2013 10:19:13 +0000 (12:19 +0200)
youtube_dl/InfoExtractors.py

index 13b1f99b56a84a50ecde5e9b79b371cd1264f59b..1bd9e25c4390018fa2a8e97b41653e5623fe96c1 100755 (executable)
@@ -309,6 +309,8 @@ class YoutubeIE(InfoExtractor):
     def _extract_all_subtitles(self, video_id):
         sub_lang_list = self._get_available_subtitles(video_id)
         sub_format = self._downloader.params.get('subtitlesformat')
+        if  isinstance(sub_lang_list,tuple): #There was some error, it didn't get the available subtitles
+            return [(sub_lang_list[0], None, None)]
         subtitles = []
         for sub_lang in sub_lang_list:
             subtitle = self._request_subtitle(sub_lang, sub_lang_list[sub_lang].encode('utf-8'), video_id, sub_format)