1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-25 03:32:05 +00:00

[lynda] Skip invalid subtitles (closes #15159)

This commit is contained in:
Sergey M․ 2018-01-03 16:41:28 +07:00
parent f0c6c2bce2
commit 75ba0efb52
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

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