From acd96480fc1f261466cffd27ce490445f48fe87e Mon Sep 17 00:00:00 2001 From: remitamine Date: Sat, 21 Nov 2015 13:42:17 +0100 Subject: [PATCH] [pluralsight] do not extract videos if user doesn't have permission --- youtube_dl/extractor/pluralsight.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/pluralsight.py b/youtube_dl/extractor/pluralsight.py index 93244f41d..e549e97b0 100644 --- a/youtube_dl/extractor/pluralsight.py +++ b/youtube_dl/extractor/pluralsight.py @@ -110,6 +110,10 @@ class PluralsightIE(InfoExtractor): if clip_index is None: continue if compat_str(clip_index) == clip_id: + if module_.get('authorized') is False: + raise ExtractorError( + '%s said: Your current subscription level does not allow you to view this module.' % self.IE_NAME, + expected=True) clip = clip_ break @@ -215,7 +219,7 @@ class PluralsightCourseIE(InfoExtractor): for module in course_data: for clip in module.get('clips', []): player_parameters = clip.get('playerParameters') - if not player_parameters: + if not player_parameters or clip.get('userMayViewClip') is False: continue entries.append(self.url_result( 'http://www.pluralsight.com/training/player?%s' % player_parameters,