Browse Source

Fix crash when subtitles are not found and the option --all-subs is given

rtmp_test
Jaime Marquínez Ferrándiz 12 years ago
parent
commit
ef767f9fd5
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      youtube_dl/InfoExtractors.py

+ 2
- 0
youtube_dl/InfoExtractors.py View File

@ -309,6 +309,8 @@ class YoutubeIE(InfoExtractor):
def _extract_all_subtitles(self, video_id): def _extract_all_subtitles(self, video_id):
sub_lang_list = self._get_available_subtitles(video_id) sub_lang_list = self._get_available_subtitles(video_id)
sub_format = self._downloader.params.get('subtitlesformat') 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 = [] subtitles = []
for sub_lang in sub_lang_list: 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) subtitle = self._request_subtitle(sub_lang, sub_lang_list[sub_lang].encode('utf-8'), video_id, sub_format)


Loading…
Cancel
Save