aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-01-03 16:41:28 +0700
committerSergey M․ <dstftw@gmail.com>2018-01-03 16:41:28 +0700
commit75ba0efb52c898601ef9febcba3e7a84ff2f311e (patch)
treecbc753ddaa8044a9d8d9cad088574e941975ad95
parentf0c6c2bce29281d37d2bbd589143b35323e38e3d (diff)
downloadyoutube-dl-75ba0efb52c898601ef9febcba3e7a84ff2f311e.zip
youtube-dl-75ba0efb52c898601ef9febcba3e7a84ff2f311e.tar.gz
youtube-dl-75ba0efb52c898601ef9febcba3e7a84ff2f311e.tar.bz2
[lynda] Skip invalid subtitles (closes #15159)
-rw-r--r--youtube_dl/extractor/lynda.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/extractor/lynda.py b/youtube_dl/extractor/lynda.py
index 1b6f509..0d6026a 100644
--- a/youtube_dl/extractor/lynda.py
+++ b/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 {}