X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Fpluralsight.py;h=fd32836ccaf61b171f9dcafbbfce24c7764b18c1;hb=140ac7396542d92a8ddd53be6c35c7a79db16180;hp=1bdcacbaa9b342f4229bbfe82aa5f8aa0fde529a;hpb=483fc223bb1509d11ac1843a5852f75c0aec3475;p=youtube-dl diff --git a/youtube_dl/extractor/pluralsight.py b/youtube_dl/extractor/pluralsight.py index 1bdcacbaa..fd32836cc 100644 --- a/youtube_dl/extractor/pluralsight.py +++ b/youtube_dl/extractor/pluralsight.py @@ -21,7 +21,6 @@ class PluralsightIE(InfoExtractor): IE_NAME = 'pluralsight' _VALID_URL = r'https?://(?:www\.)?pluralsight\.com/training/player\?author=(?P[^&]+)&name=(?P[^&]+)(?:&mode=live)?&clip=(?P\d+)&course=(?P[^&]+)' _LOGIN_URL = 'https://www.pluralsight.com/id/' - _ACCOUNT_CREDENTIALS_HINT = 'Use --username and --password options to provide lynda.com account credentials.' _NETRC_MACHINE = 'pluralsight' _TEST = { @@ -42,9 +41,7 @@ class PluralsightIE(InfoExtractor): def _login(self): (username, password) = self._get_login_info() if username is None: - raise ExtractorError( - 'Pluralsight account is required, use --username and --password options to provide account credentials.', - expected=True) + self.raise_login_required('Pluralsight account is required') login_page = self._download_webpage( self._LOGIN_URL, None, 'Downloading login page') @@ -184,6 +181,8 @@ class PluralsightCourseIE(InfoExtractor): def _real_extract(self, url): course_id = self._match_id(url) + # TODO: PSM cookie + course = self._download_json( 'http://www.pluralsight.com/data/course/%s' % course_id, course_id, 'Downloading course JSON') @@ -195,14 +194,9 @@ class PluralsightCourseIE(InfoExtractor): 'http://www.pluralsight.com/data/course/content/%s' % course_id, course_id, 'Downloading course data JSON') - may_not_view = 0 - entries = [] for module in course_data: for clip in module.get('clips', []): - if clip.get('userMayViewClip') is False: - may_not_view += 1 - continue player_parameters = clip.get('playerParameters') if not player_parameters: continue @@ -210,9 +204,4 @@ class PluralsightCourseIE(InfoExtractor): 'http://www.pluralsight.com/training/player?%s' % player_parameters, 'Pluralsight')) - if may_not_view > 0: - self._downloader.report_warning( - 'There are %d videos in this course that are not available for you. ' - 'Upgrade your account to get access to these videos.' % may_not_view) - return self.playlist_result(entries, course_id, title, description)