1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-15 15:42:53 +01:00

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

This commit is contained in:
Jaime Marquínez Ferrándiz 2013-03-31 12:19:13 +02:00
parent bc97f6d60c
commit ef767f9fd5

View File

@ -309,6 +309,8 @@ def _extract_subtitle(self, video_id):
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)