projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[tumblr] Simplify and extract duration
[youtube-dl]
/
youtube_dl
/
extractor
/
pluralsight.py
diff --git
a/youtube_dl/extractor/pluralsight.py
b/youtube_dl/extractor/pluralsight.py
index 1bdcacbaa9b342f4229bbfe82aa5f8aa0fde529a..fd32836ccaf61b171f9dcafbbfce24c7764b18c1 100644
(file)
--- 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<author>[^&]+)&name=(?P<name>[^&]+)(?:&mode=live)?&clip=(?P<clip>\d+)&course=(?P<course>[^&]+)'
_LOGIN_URL = 'https://www.pluralsight.com/id/'
IE_NAME = 'pluralsight'
_VALID_URL = r'https?://(?:www\.)?pluralsight\.com/training/player\?author=(?P<author>[^&]+)&name=(?P<name>[^&]+)(?:&mode=live)?&clip=(?P<clip>\d+)&course=(?P<course>[^&]+)'
_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 = {
_NETRC_MACHINE = 'pluralsight'
_TEST = {
@@
-42,9
+41,7
@@
class PluralsightIE(InfoExtractor):
def _login(self):
(username, password) = self._get_login_info()
if username is None:
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')
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)
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')
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')
'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', []):
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
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'))
'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)
return self.playlist_result(entries, course_id, title, description)