From e5b3c59c436be6f730239929ed3714a4f5066eb0 Mon Sep 17 00:00:00 2001 From: ping Date: Wed, 27 Mar 2019 16:46:40 +0800 Subject: [PATCH] [lynda] Fix for invalid json response when no transcript is available --- youtube_dl/extractor/lynda.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/lynda.py b/youtube_dl/extractor/lynda.py index 3084c6dff..96d041502 100644 --- a/youtube_dl/extractor/lynda.py +++ b/youtube_dl/extractor/lynda.py @@ -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}]}