[lynda] Fix for invalid json response when no transcript is available
This commit is contained in:
parent
8cb10807ed
commit
e5b3c59c43
@ -247,7 +247,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, fatal=False)
|
||||||
|
if not subs:
|
||||||
|
return {}
|
||||||
fixed_subs = self._fix_subtitles(subs)
|
fixed_subs = self._fix_subtitles(subs)
|
||||||
if fixed_subs:
|
if fixed_subs:
|
||||||
return {'en': [{'ext': 'srt', 'data': fixed_subs}]}
|
return {'en': [{'ext': 'srt', 'data': fixed_subs}]}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user