[lynda] Fix for invalid json response when no transcript is available

This commit is contained in:
ping 2019-03-27 16:46:40 +08:00
parent 8cb10807ed
commit e5b3c59c43
No known key found for this signature in database
GPG Key ID: 6CCF56BCEDD24084

View File

@ -247,7 +247,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)
subs = self._download_json(url, None, False, fatal=False)
if not subs:
return {}
fixed_subs = self._fix_subtitles(subs)
if fixed_subs:
return {'en': [{'ext': 'srt', 'data': fixed_subs}]}