2 from __future__ import unicode_literals
4 from .common import InfoExtractor
7 class EggheadCourseIE(InfoExtractor):
8 IE_DESC = 'egghead.io course'
9 IE_NAME = 'egghead:course'
10 _VALID_URL = r'https://egghead\.io/courses/(?P<id>[^/?#&]+)'
12 'url': 'https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript',
15 'id': 'professor-frisby-introduces-composable-functional-javascript',
16 'title': 'Professor Frisby Introduces Composable Functional JavaScript',
17 'description': 're:(?s)^This course teaches the ubiquitous.*You\'ll start composing functionality before you know it.$',
21 def _real_extract(self, url):
22 playlist_id = self._match_id(url)
24 course = self._download_json(
25 'https://egghead.io/api/v1/series/%s' % playlist_id, playlist_id)
29 'wistia:%s' % lesson['wistia_id'], ie='Wistia',
30 video_id=lesson['wistia_id'], video_title=lesson.get('title'))
31 for lesson in course['lessons'] if lesson.get('wistia_id')]
33 return self.playlist_result(
34 entries, playlist_id, course.get('title'),
35 course.get('description'))