Ver Fonte

[lynda] Skip invalid subtitles (closes #15159)

Sergey M․ há 7 anos atrás
pai
commit
75ba0efb52
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      youtube_dl/extractor/lynda.py

+ 3 - 2
youtube_dl/extractor/lynda.py

@@ -244,8 +244,9 @@ class LyndaIE(LyndaBaseIE):
     def _get_subtitles(self, video_id):
         url = 'https://www.lynda.com/ajax/player?videoId=%s&type=transcript' % video_id
         subs = self._download_json(url, None, False)
-        if subs:
-            return {'en': [{'ext': 'srt', 'data': self._fix_subtitles(subs)}]}
+        fixed_subs = self._fix_subtitles(subs)
+        if fixed_subs:
+            return {'en': [{'ext': 'srt', 'data': fixed_subs}]}
         else:
             return {}